/** * Check dependencies * * @param Compiler $compiler */ public function checkDependencies(Compiler $compiler) { $classDefinition = $this->_classDefinition; $extendedClass = $classDefinition->getExtendsClass(); if ($extendedClass) { if ($classDefinition->getType() == 'class') { if ($compiler->isClass($extendedClass)) { $extendedDefinition = $compiler->getClassDefinition($extendedClass); $classDefinition->setExtendsClassDefinition($extendedDefinition); } else { if ($compiler->isBundledClass($extendedClass)) { $extendedDefinition = $compiler->getInternalClassDefinition($extendedClass); $classDefinition->setExtendsClassDefinition($extendedDefinition); } else { $extendedDefinition = new ClassDefinitionRuntime($extendedClass); $classDefinition->setExtendsClassDefinition($extendedDefinition); $this->_logger->warning('Cannot locate class "' . $extendedClass . '" when extending class "' . $classDefinition->getCompleteName() . '"', 'nonexistent-class', $this->_originalNode); } } } else { if ($compiler->isInterface($extendedClass)) { $extendedDefinition = $compiler->getClassDefinition($extendedClass); $classDefinition->setExtendsClassDefinition($extendedDefinition); } else { if ($compiler->isBundledInterface($extendedClass)) { $extendedDefinition = $compiler->getInternalClassDefinition($extendedClass); $classDefinition->setExtendsClassDefinition($extendedDefinition); } else { $extendedDefinition = new ClassDefinitionRuntime($extendedClass); $classDefinition->setExtendsClassDefinition($extendedDefinition); $this->_logger->warning('Cannot locate class "' . $extendedClass . '" when extending interface "' . $classDefinition->getCompleteName() . '"', 'nonexistent-class', $this->_originalNode); } } } } $implementedInterfaces = $classDefinition->getImplementedInterfaces(); if ($implementedInterfaces) { $interfaceDefinitions = array(); foreach ($implementedInterfaces as $interface) { if ($compiler->isInterface($interface)) { $interfaceDefinitions[$interface] = $compiler->getClassDefinition($interface); } else { if ($compiler->isBundledInterface($interface)) { $interfaceDefinitions[$interface] = $compiler->getInternalClassDefinition($interface); } else { $extendedDefinition = new ClassDefinitionRuntime($extendedClass); $classDefinition->setExtendsClassDefinition($extendedDefinition); $this->_logger->warning('Cannot locate class "' . $interface . '" when extending interface "' . $classDefinition->getCompleteName() . '"', 'nonexistent-class', $this->_originalNode); } } } if ($interfaceDefinitions) { $classDefinition->setImplementedInterfaceDefinitions($interfaceDefinitions); } } }