Skip to content

Commit 3b1c99a

Browse files
committed
Handle instanceof Object
1 parent 25b071a commit 3b1c99a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/JsPhpize/Parser/TokenExtractor.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,8 @@ protected function appendFunctionsCalls(&$value, $previousToken = null, $applica
176176
$nextValue = new Constant('constant', $nextValue->name);
177177
}
178178

179-
$value = $nextValue instanceof Constant && $nextValue->value === 'Array'
180-
? new FunctionCall(new Variable('is_array', []), [$value], [])
179+
$value = $nextValue instanceof Constant && in_array($nextValue->value, ['Array', 'Object', 'String'])
180+
? new FunctionCall(new Variable('is_' . strtolower($nextValue->value), []), [$value], [])
181181
: new Dyiade('instanceof', $value, $nextValue);
182182

183183
continue;

0 commit comments

Comments
 (0)