File tree 1 file changed +3
-8
lines changed
1 file changed +3
-8
lines changed Original file line number Diff line number Diff line change 6
6
use PHPStan \Analyser \Scope ;
7
7
use PHPStan \Reflection \FunctionReflection ;
8
8
use PHPStan \Type \Constant \ConstantIntegerType ;
9
- use PHPStan \Type \Constant \ConstantStringType ;
10
9
use PHPStan \Type \DynamicFunctionReturnTypeExtension ;
11
10
use PHPStan \Type \FloatType ;
12
11
use PHPStan \Type \IntegerRangeType ;
@@ -42,16 +41,12 @@ public function getTypeFromFunctionCall(
42
41
}
43
42
44
43
$ argType = $ scope ->getType ($ args [0 ]->value );
45
- $ constantScalars = $ argType ->getConstantScalarTypes ();
44
+ $ constantScalars = $ argType ->getConstantScalarValues ();
46
45
47
46
$ lengths = [];
48
47
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 );
55
50
$ lengths [] = $ length ;
56
51
}
57
52
You can’t perform that action at this time.
0 commit comments