Skip to content

Commit 68676a0

Browse files
committed
Adjust to AST types refactoring
1 parent 6ed8730 commit 68676a0

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

src/main/php/lang/ast/syntax/php/IsOperator.class.php

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,9 @@
11
<?php namespace lang\ast\syntax\php;
22

3-
use lang\ast\ArrayType;
4-
use lang\ast\FunctionType;
5-
use lang\ast\MapType;
63
use lang\ast\Node;
7-
use lang\ast\UnionType;
8-
use lang\ast\nodes\Assignment;
9-
use lang\ast\nodes\BinaryExpression;
10-
use lang\ast\nodes\Braced;
11-
use lang\ast\nodes\InstanceOfExpression;
12-
use lang\ast\nodes\InvokeExpression;
13-
use lang\ast\nodes\Literal;
14-
use lang\ast\nodes\Variable;
4+
use lang\ast\nodes\{Assignment, BinaryExpression, Braced, InstanceOfExpression, InvokeExpression, Literal, Variable};
155
use lang\ast\syntax\Extension;
6+
use lang\ast\types\{IsArray, IsFunction, IsMap, IsUnion};
167

178
class IsOperator implements Extension {
189

@@ -57,7 +48,7 @@ public function setup($language, $emitter) {
5748
}
5849

5950
// Verify builtin primitives with is_XXX(), value types with instanceof, others using is()
60-
if ($t instanceof FunctionType || $t instanceof ArrayType || $t instanceof MapType || $t instanceof UnionType) {
51+
if ($t instanceof IsFunction || $t instanceof IsArray || $t instanceof IsMap || $t instanceof IsUnion) {
6152
return new InvokeExpression(new Literal('is'), [new Literal('"'.$t->name().'"'), $node->expression]);
6253
} else {
6354
$literal= $t->literal();

0 commit comments

Comments
 (0)