diff --git a/rules-tests/CodeQuality/Rector/StmtsAwareInterface/DeclareStrictTypesTestsRector/Fixture/skip_html_php_mix.php.inc b/rules-tests/CodeQuality/Rector/StmtsAwareInterface/DeclareStrictTypesTestsRector/Fixture/skip_html_php_mix.php.inc new file mode 100644 index 00000000..c600657f --- /dev/null +++ b/rules-tests/CodeQuality/Rector/StmtsAwareInterface/DeclareStrictTypesTestsRector/Fixture/skip_html_php_mix.php.inc @@ -0,0 +1,12 @@ + + +file->containsHTML()) { + return null; + } + if ($this->shouldSkipNodes($nodes, $this->file)) { return null; } diff --git a/rules/PHPUnit120/Rector/Class_/RemoveOverrideFinalConstructTestCaseRector.php b/rules/PHPUnit120/Rector/Class_/RemoveOverrideFinalConstructTestCaseRector.php index f7938a82..9b426557 100644 --- a/rules/PHPUnit120/Rector/Class_/RemoveOverrideFinalConstructTestCaseRector.php +++ b/rules/PHPUnit120/Rector/Class_/RemoveOverrideFinalConstructTestCaseRector.php @@ -71,17 +71,17 @@ public function refactor(Node $node): Node|null return null; } - $constructClassMethod = $node->getMethod(MethodName::CONSTRUCT); - - if ($constructClassMethod instanceof ClassMethod) { - foreach ($node->stmts as $key => $stmt) { - if ($stmt instanceof ClassMethod && $this->isName($stmt, MethodName::CONSTRUCT)) { - unset($node->stmts[$key]); + foreach ($node->stmts as $key => $stmt) { + if (! $stmt instanceof ClassMethod) { + continue; + } - $node->setAttribute('hasRemovedFinalConstruct', true); - return $node; - } + if (! $this->isName($stmt, MethodName::CONSTRUCT)) { + continue; } + + unset($node->stmts[$key]); + return $node; } return null;