Skip to content

Commit

Permalink
Fix #631 - Add condition for expected type
Browse files Browse the repository at this point in the history
  • Loading branch information
jadb committed Oct 4, 2015
1 parent 71b42f4 commit e943361
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Generator/Resolvers/ElementResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@ public function resolveElement($definition, $reflectionElement, &$expectedName =
}
}

if (($pos = strpos($definition, '::')) || ($pos = strpos($definition, '->'))) {
if (($reflectionElement instanceof ClassReflectionInterface)
&& ($pos = strpos($definition, '::') || $pos = strpos($definition, '->'))) {
$reflectionElement = $this->resolveContextForClassProperty($definition, $reflectionElement, $pos);
$definition = substr($definition, $pos + 2);

Expand Down

0 comments on commit e943361

Please sign in to comment.