File tree 1 file changed +4
-5
lines changed
1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change 5
5
use PhpParser \Node \Arg ;
6
6
use PHPStan \Analyser \Scope ;
7
7
use PHPStan \Rules \Doctrine \ORM \DynamicQueryBuilderArgumentException ;
8
- use PHPStan \Type \ConstantScalarType ;
9
8
use PHPStan \Type \Doctrine \QueryBuilder \Expr \ExprType ;
10
9
use function count ;
11
10
use function strpos ;
@@ -39,20 +38,20 @@ public function processArgs(
39
38
$ array = [];
40
39
foreach ($ value ->getConstantArrays ()[0 ]->getKeyTypes () as $ i => $ keyType ) {
41
40
$ valueType = $ value ->getConstantArrays ()[0 ]->getValueTypes ()[$ i ];
42
- if (! $ valueType instanceof ConstantScalarType ) {
41
+ if (count ( $ valueType-> getConstantScalarValues ()) !== 1 ) {
43
42
throw new DynamicQueryBuilderArgumentException ();
44
43
}
45
- $ array [$ keyType ->getValue ()] = $ valueType ->getValue () ;
44
+ $ array [$ keyType ->getValue ()] = $ valueType ->getConstantScalarValues ()[ 0 ] ;
46
45
}
47
46
48
47
$ args [] = $ array ;
49
48
continue ;
50
49
}
51
- if (! $ value instanceof ConstantScalarType ) {
50
+ if (count ( $ value-> getConstantScalarValues ()) !== 1 ) {
52
51
throw new DynamicQueryBuilderArgumentException ();
53
52
}
54
53
55
- $ args [] = $ value ->getValue () ;
54
+ $ args [] = $ value ->getConstantScalarValues ()[ 0 ] ;
56
55
}
57
56
58
57
return $ args ;
You can’t perform that action at this time.
0 commit comments