Permalink
Browse files

Fixed warnings in polymorphic return values

  • Loading branch information...
andresgutierrez committed Jun 4, 2015
1 parent 5fdefa5 commit 00118e6202da68895656f6fcd2f60793550d07d6
Showing with 4 additions and 2 deletions.
  1. +4 −2 Library/Operators/Other/NewInstanceOperator.php
@@ -61,8 +61,10 @@ public function compile(array $expression, CompilationContext $compilationContex
throw new CompilerException("Cannot use non-heap variable to store new instance", $expression);
}
if ($symbolVariable->hasDifferentDynamicType(array('unknown', 'undefined', 'object', 'null'))) {
$compilationContext->logger->warning('Possible attempt to use non-object in "new" operator', 'non-valid-new', $expression);
if ($symbolVariable->getName() != 'return_value') {
if ($symbolVariable->hasDifferentDynamicType(array('unknown', 'undefined', 'object', 'null'))) {
$compilationContext->logger->warning('Possible attempt to use non-object in "new" operator', 'non-valid-new', $expression);
}
}
/**

0 comments on commit 00118e6

Please sign in to comment.