diff --git a/rules/CodeQuality/Rector/ClassMethod/ExplicitReturnNullRector.php b/rules/CodeQuality/Rector/ClassMethod/ExplicitReturnNullRector.php index 6c1da48ba5b..b8fdb1be397 100644 --- a/rules/CodeQuality/Rector/ClassMethod/ExplicitReturnNullRector.php +++ b/rules/CodeQuality/Rector/ClassMethod/ExplicitReturnNullRector.php @@ -113,7 +113,9 @@ public function refactor(Node $node): ?Node } $hasChanged = false; - $this->traverseNodesWithCallable((array) $node->stmts, static function (Node $node) use (&$hasChanged) : int|null|Return_ { + $this->traverseNodesWithCallable((array) $node->stmts, static function (Node $node) use ( + &$hasChanged + ): int|null|Return_ { if ($node instanceof Class_ || $node instanceof Function_ || $node instanceof Closure) { return NodeTraverser::DONT_TRAVERSE_CURRENT_AND_CHILDREN; }