/** * Process and reflect all the matching identifiers found inside a namespace node. * * @param Reflector $reflector * @param Node\Stmt\Namespace_ $namespace * @param IdentifierType $identifierType * @param LocatedSource $locatedSource * @return \BetterReflection\Reflection\Reflection[] */ private function reflectFromNamespace(Reflector $reflector, Node\Stmt\Namespace_ $namespace, IdentifierType $identifierType, LocatedSource $locatedSource) { $reflections = []; foreach ($namespace->stmts as $node) { $reflection = $this->reflectNode($reflector, $node, $locatedSource, $namespace); if (null !== $reflection && $identifierType->isMatchingReflector($reflection)) { $reflections[] = $reflection; } } return $reflections; }
public function testIsMatchingReflectorFunction() { $reflectionFunction = $this->createMock(ReflectionFunction::class); $type = new IdentifierType(IdentifierType::IDENTIFIER_FUNCTION); $this->assertTrue($type->isMatchingReflector($reflectionFunction)); }
public function testIsMatchingReflectorFunction() { $reflectionFunction = $this->getMockBuilder(ReflectionFunction::class)->disableOriginalConstructor()->getMock(); $type = new IdentifierType(IdentifierType::IDENTIFIER_FUNCTION); $this->assertTrue($type->isMatchingReflector($reflectionFunction)); }
public function testIsMatchingReflector() { $reflectionClass = $this->getMockBuilder(ReflectionClass::class)->disableOriginalConstructor()->getMock(); $classType = new IdentifierType(IdentifierType::IDENTIFIER_CLASS); $this->assertTrue($classType->isMatchingReflector($reflectionClass)); }