BetterReflection\Reflector\FunctionReflector::reflect PHP Method

reflect() public method

Create a ReflectionFunction for the specified $functionName.
public reflect ( string $functionName ) : BetterReflection\Reflection\ReflectionFunction
$functionName string
return BetterReflection\Reflection\ReflectionFunction
    public function reflect($functionName)
    {
        return $this->sourceLocator->locateIdentifier(ClassReflector::buildDefaultReflector(), new Identifier($functionName, new IdentifierType(IdentifierType::IDENTIFIER_FUNCTION)));
    }

Usage Example

コード例 #1
0
 public function testIsUserDefined()
 {
     $php = '<?php function foo() {}';
     $reflector = new FunctionReflector(new StringSourceLocator($php));
     $function = $reflector->reflect('foo');
     $this->assertTrue($function->isUserDefined());
 }
All Usage Examples Of BetterReflection\Reflector\FunctionReflector::reflect
FunctionReflector