/** * Attempts to locate the specified identifier. * * @param Identifier $identifier * @return string */ private function locateIdentifier(Identifier $identifier) { if ($identifier->isClass()) { return $this->locateClassByName($identifier->getName()); } if ($identifier->isFunction()) { return $this->locateFunctionByName($identifier->getName()); } }
/** * Attempts to locate the specified identifier * * @param Identifier $identifier * @return string */ private function locateIdentifier(Identifier $identifier) { if ($identifier->isClass()) { return $this->locateClassByName($identifier->getName()); } if ($identifier->isFunction()) { return $this->locateFunctionByName($identifier->getName()); } throw new Exception\UnloadableIdentifierType('AutoloadSourceLocator cannot locate ' . $identifier->getType()->getName()); }
public function testIsTypesForFunction() { $identifier = new Identifier('Foo', new IdentifierType(IdentifierType::IDENTIFIER_FUNCTION)); $this->assertFalse($identifier->isClass()); $this->assertTrue($identifier->isFunction()); }