File tree Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Original file line number Diff line number Diff line change 66use PHPStan \Analyser \Scope ;
77use PHPStan \Reflection \FunctionReflection ;
88use PHPStan \Type \Constant \ConstantIntegerType ;
9- use PHPStan \Type \Constant \ConstantStringType ;
109use PHPStan \Type \DynamicFunctionReturnTypeExtension ;
1110use PHPStan \Type \FloatType ;
1211use PHPStan \Type \IntegerRangeType ;
@@ -42,16 +41,12 @@ public function getTypeFromFunctionCall(
4241 }
4342
4443 $ argType = $ scope ->getType ($ args [0 ]->value );
45- $ constantScalars = $ argType ->getConstantScalarTypes ();
44+ $ constantScalars = $ argType ->getConstantScalarValues ();
4645
4746 $ lengths = [];
4847 foreach ($ constantScalars as $ constantScalar ) {
49- $ stringScalar = $ constantScalar ->toString ();
50- if (!($ stringScalar instanceof ConstantStringType)) {
51- $ lengths = [];
52- break ;
53- }
54- $ length = strlen ($ stringScalar ->getValue ());
48+ $ stringScalar = (string ) $ constantScalar ;
49+ $ length = strlen ($ stringScalar );
5550 $ lengths [] = $ length ;
5651 }
5752
You can’t perform that action at this time.
0 commit comments