Beispiel #1
0
 /**
  * Retrieve list of parents
  *
  * @param string $type
  * @return array
  */
 public function getParents($type)
 {
     if (!class_exists($type)) {
         return $this->_default;
     }
     return $this->_classReader->getParents($type) ?: $this->_default;
 }
Beispiel #2
0
 /**
  * Asserts that item type is collection defined type
  *
  * @param string $instanceName
  * @param string|int|null $index
  * @return void
  * @throws \InvalidArgumentException
  */
 private function assertValidTypeLazy($instanceName, $index = null)
 {
     $realType = $this->configInterface->getInstanceType($this->configInterface->getPreference($instanceName));
     if (!in_array($this->type, $this->classReaderInterface->getParents($realType), true)) {
         $this->throwTypeException($realType, $index);
     }
 }