File tree Expand file tree Collapse file tree 3 files changed +32
-2
lines changed
rules-tests/CodeQuality/Rector/ClassMethod/OptionalParametersAfterRequiredRector/Fixture Expand file tree Collapse file tree 3 files changed +32
-2
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ namespace Rector \Tests \CodeQuality \Rector \ClassMethod \OptionalParametersAfterRequiredRector \Fixture ;
6+
7+ class SkipInsideBlockStatements
8+ {
9+ private function handlePlugin (Request $ request )
10+ {
11+ {
12+ $ form = $ this ->createForm (ArticleFormType::class, $ article );
13+ return $ this ->render ('Article/edit.html.twig ' , [
14+ 'media ' => $ media ,
15+ 'form ' => $ form ->createView (),
16+ 'headline ' => $ headline ,
17+ 'article ' => $ article
18+ ]);
19+
20+ $ form = $ this ->createForm (HeadlineType::class, $ headline );
21+ return $ this ->render ('headline/new.html.twig ' , [
22+ 'headline ' => $ headline ,
23+ 'media ' => $ media ,
24+ 'form ' => $ form ->createView (),
25+ ]);
26+ }
27+ }
28+ }
Original file line number Diff line number Diff line change 1313use PhpParser \Node \Expr \NullsafeMethodCall ;
1414use PhpParser \Node \Expr \StaticCall ;
1515use PhpParser \Node \FunctionLike ;
16+ use PhpParser \Node \Stmt \Block ;
1617use PhpParser \Node \Stmt \ClassLike ;
1718use PhpParser \Node \Stmt \ClassMethod ;
1819use PhpParser \Node \Stmt \Declare_ ;
@@ -27,7 +28,7 @@ final class NodeAttributeReIndexer
2728{
2829 public static function reIndexStmtKeyNodeAttributes (Node $ node ): ?Node
2930 {
30- if (! $ node instanceof StmtsAwareInterface && ! $ node instanceof ClassLike && ! $ node instanceof Declare_) {
31+ if (! $ node instanceof StmtsAwareInterface && ! $ node instanceof ClassLike && ! $ node instanceof Declare_ && ! $ node instanceof Block ) {
3132 return null ;
3233 }
3334
Original file line number Diff line number Diff line change 55namespace Rector \PHPStan \NodeVisitor ;
66
77use PhpParser \Node ;
8+ use PhpParser \Node \Stmt \Block ;
89use PhpParser \Node \Stmt \ClassLike ;
910use PhpParser \Node \Stmt \Declare_ ;
1011use PhpParser \NodeVisitorAbstract ;
@@ -25,7 +26,7 @@ public function __construct(
2526
2627 public function enterNode (Node $ node ): ?Node
2728 {
28- if (! $ node instanceof StmtsAwareInterface && ! $ node instanceof ClassLike && ! $ node instanceof Declare_) {
29+ if (! $ node instanceof StmtsAwareInterface && ! $ node instanceof ClassLike && ! $ node instanceof Declare_ && ! $ node instanceof Block ) {
2930 return null ;
3031 }
3132
You can’t perform that action at this time.
0 commit comments