1313use Rector \Application \ChangedNodeScopeRefresher ;
1414use Rector \Application \Provider \CurrentFileProvider ;
1515use Rector \ChangesReporting \ValueObject \RectorWithLineChange ;
16- use Rector \Contract \Rector \HTMLAverseRectorInterface ;
1716use Rector \Contract \Rector \RectorInterface ;
1817use Rector \Exception \ShouldNotHappenException ;
1918use Rector \NodeDecorator \CreatedByRuleDecorator ;
@@ -56,11 +55,6 @@ public function __construct(
5655 public function run (RectorInterface $ rector , Node $ node ): int |Node |null |array
5756 {
5857 $ file = $ this ->getFile ();
59-
60- if ($ rector instanceof HTMLAverseRectorInterface && $ file ->containsHTML ()) {
61- return null ;
62- }
63-
6458 $ filePath = $ file ->getFilePath ();
6559
6660 // node already changed by this rule in a previous pass → hard skip
@@ -71,14 +65,14 @@ public function run(RectorInterface $rector, Node $node): int|Node|null|array
7165 // class/path skip is configured for this rule and file: run the rule on a deep clone to learn
7266 // whether it would actually have changed anything. Only a skip that prevents a real change
7367 // counts as used; the original node is left untouched, so the file stays skipped either way.
74- // $skipMatch = $this->skipper->matchSkip($rector, $filePath);
75- // if ($skipMatch instanceof SkipMatch) {
76- // if ($rector->refactor($this->cloneNode($node)) !== null) {
77- // $this->skipper->markSkipUsed($skipMatch);
78- // }
79- //
80- // return null;
81- // }
68+ $ skipMatch = $ this ->skipper ->matchSkip ($ rector , $ filePath );
69+ if ($ skipMatch instanceof SkipMatch) {
70+ if ($ rector ->refactor ($ this ->cloneNode ($ node )) !== null ) {
71+ $ this ->skipper ->markSkipUsed ($ skipMatch );
72+ }
73+
74+ return null ;
75+ }
8276
8377 // ensure origNode pulled before refactor to avoid changed during refactor, ref https://3v4l.org/YMEGN
8478 $ originalNode = $ node ->getAttribute (AttributeKey::ORIGINAL_NODE ) ?? $ node ;
0 commit comments