File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed
rules/DowngradePhp80/Rector/FuncCall Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -199,15 +199,17 @@ public function refactor(Node $node): ?Node
199199 if ($ offset instanceof Arg) {
200200 $ offsetType = $ this ->getType ($ offset ->value );
201201 if ($ offsetType instanceof ConstantIntegerType && $ offsetType ->getValue () <= 0 ) {
202- return null ;
203- }
204-
205- $ length = $ node -> getArg ( ' length ' , 2 );
206- if ( $ length instanceof Arg) {
207- $ lengthType = $ this -> getType ( $ length -> value );
208- if ( $ lengthType instanceof ConstantIntegerType && $ lengthType -> getValue () >= 0 ) {
209- return null ;
202+ $ length = $ node -> getArg ( ' length ' , 2 ) ;
203+ if ( $ length instanceof Arg) {
204+ $ lengthType = $ this -> getType ( $ length -> value );
205+ if ( $ lengthType instanceof ConstantIntegerType && $ lengthType -> getValue () >= 0 ) {
206+ return null ;
207+ }
208+
209+ return new String_ ( $ node ) ;
210210 }
211+
212+ return null ;
211213 }
212214 }
213215
You can’t perform that action at this time.
0 commit comments