@@ -51,6 +51,10 @@ private static function trimName(string $name): string
51
51
return substr ($ name , 3 );
52
52
}
53
53
54
+ if (strpos ($ name , 'IsNot ' ) === 0 ) {
55
+ return 'Is ' . substr ($ name , 5 );
56
+ }
57
+
54
58
return $ name ;
55
59
}
56
60
@@ -148,6 +152,39 @@ private static function getExpressionResolvers(): array
148
152
new \PhpParser \Node \Expr \ConstFetch (new Name ('null ' ))
149
153
);
150
154
},
155
+ 'IsArray ' => function (Scope $ scope , Arg $ actual ) {
156
+ return new \PhpParser \Node \Expr \FuncCall (new Name ('is_array ' ), [$ actual ]);
157
+ },
158
+ 'IsBool ' => function (Scope $ scope , Arg $ actual ) {
159
+ return new \PhpParser \Node \Expr \FuncCall (new Name ('is_bool ' ), [$ actual ]);
160
+ },
161
+ 'IsCallable ' => function (Scope $ scope , Arg $ actual ) {
162
+ return new \PhpParser \Node \Expr \FuncCall (new Name ('is_callable ' ), [$ actual ]);
163
+ },
164
+ 'IsFloat ' => function (Scope $ scope , Arg $ actual ) {
165
+ return new \PhpParser \Node \Expr \FuncCall (new Name ('is_float ' ), [$ actual ]);
166
+ },
167
+ 'IsInt ' => function (Scope $ scope , Arg $ actual ) {
168
+ return new \PhpParser \Node \Expr \FuncCall (new Name ('is_int ' ), [$ actual ]);
169
+ },
170
+ 'IsIterable ' => function (Scope $ scope , Arg $ actual ) {
171
+ return new \PhpParser \Node \Expr \FuncCall (new Name ('is_iterable ' ), [$ actual ]);
172
+ },
173
+ 'IsNumeric ' => function (Scope $ scope , Arg $ actual ) {
174
+ return new \PhpParser \Node \Expr \FuncCall (new Name ('is_numeric ' ), [$ actual ]);
175
+ },
176
+ 'IsObject ' => function (Scope $ scope , Arg $ actual ) {
177
+ return new \PhpParser \Node \Expr \FuncCall (new Name ('is_object ' ), [$ actual ]);
178
+ },
179
+ 'IsResource ' => function (Scope $ scope , Arg $ actual ) {
180
+ return new \PhpParser \Node \Expr \FuncCall (new Name ('is_resource ' ), [$ actual ]);
181
+ },
182
+ 'IsString ' => function (Scope $ scope , Arg $ actual ) {
183
+ return new \PhpParser \Node \Expr \FuncCall (new Name ('is_string ' ), [$ actual ]);
184
+ },
185
+ 'IsScalar ' => function (Scope $ scope , Arg $ actual ) {
186
+ return new \PhpParser \Node \Expr \FuncCall (new Name ('is_scalar ' ), [$ actual ]);
187
+ },
151
188
'InternalType ' => function (Scope $ scope , Arg $ type , Arg $ value ) {
152
189
$ typeType = $ scope ->getType ($ type ->value );
153
190
if (!$ typeType instanceof ConstantStringType) {
0 commit comments