File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change 66
77use PhpParser \Node ;
88use PhpParser \Node \Attribute ;
9+ use PhpParser \Node \ComplexType ;
10+ use PhpParser \Node \Identifier ;
11+ use PhpParser \Node \Name ;
912use PhpParser \Node \Scalar \String_ ;
1013use PhpParser \Node \Stmt \Class_ ;
1114use PhpParser \Node \Stmt \ClassMethod ;
@@ -134,7 +137,7 @@ public function refactor(Node $node): ?Node
134137 private function resolveReturnTypeOfDependsMethod (
135138 ClassMethod $ classMethod ,
136139 Class_ $ class
137- ): Node \ ComplexType |Node \ Identifier |Node \ Name |null {
140+ ): ComplexType |Identifier |Name |null {
138141 $ dependsMethodName = $ this ->resolveDependsAnnotationOrAttributeMethod ($ classMethod );
139142
140143 if ($ dependsMethodName === null || $ dependsMethodName === '' ) {
Original file line number Diff line number Diff line change 1212use PhpParser \Node \Expr \BinaryOp \NotIdentical ;
1313use PhpParser \Node \Expr \Cast \Bool_ ;
1414use PhpParser \Node \Expr \ClassConstFetch ;
15+ use PhpParser \Node \Expr \Closure ;
1516use PhpParser \Node \Expr \FuncCall ;
1617use PhpParser \Node \Expr \Instanceof_ ;
1718use PhpParser \Node \Expr \MethodCall ;
@@ -100,11 +101,11 @@ public function refactor(Node $node): ?Class_
100101
101102 $ useStaticAssert = $ classMethod ->isStatic () ?: $ this ->isBehatContext ($ node );
102103
103- $ this ->traverseNodesWithCallable ($ classMethod ->stmts , function (\ PhpParser \ Node $ node ) use (
104+ $ this ->traverseNodesWithCallable ($ classMethod ->stmts , function (Node $ node ) use (
104105 &$ useStaticAssert ,
105106 &$ hasChanged
106- ) {
107- if ($ node instanceof Expr \ Closure && $ node ->static ) {
107+ ): null | MethodCall | StaticCall {
108+ if ($ node instanceof Closure && $ node ->static ) {
108109 $ useStaticAssert = true ;
109110 return null ;
110111 }
You can’t perform that action at this time.
0 commit comments