Skip to content

Commit

Permalink
Handle instanceof Object
Browse files Browse the repository at this point in the history
  • Loading branch information
kylekatarnls committed Oct 12, 2018
1 parent 25b071a commit 3b1c99a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/JsPhpize/Parser/TokenExtractor.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,8 @@ protected function appendFunctionsCalls(&$value, $previousToken = null, $applica
$nextValue = new Constant('constant', $nextValue->name);
}

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

continue;
Expand Down

0 comments on commit 3b1c99a

Please sign in to comment.