Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Commit

Permalink
Zend\Di\DefinitionList
Browse files Browse the repository at this point in the history
* Ensure Zend\Di\DefinitionList checks state of definition before asking for information inside getClassSupertypes()
  • Loading branch information
Ralph Schindler committed Sep 10, 2012
1 parent 0a3927d commit d26c6f2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions library/Zend/Di/DefinitionList.php
Expand Up @@ -144,9 +144,13 @@ public function getClassSupertypes($class)
$supertypes = array();
/** @var $definition Definition\DefinitionInterface */
foreach ($this as $definition) {
$supertypes = array_merge($supertypes, $definition->getClassSupertypes($class));
if ($definition->hasClass($class)) {
$supertypes = array_merge($supertypes, $definition->getClassSupertypes($class));
if (!$definition instanceof Definition\PartialMarker) {
return $supertypes;
}
}
}
// @todo remove duplicates?
return $supertypes;
}

Expand Down

0 comments on commit d26c6f2

Please sign in to comment.