public function reflect($functionName) { return $this->sourceLocator->locateIdentifier(ClassReflector::buildDefaultReflector(), new Identifier($functionName, new IdentifierType(IdentifierType::IDENTIFIER_FUNCTION))); }
public function testIsUserDefined() { $php = '<?php function foo() {}'; $reflector = new FunctionReflector(new StringSourceLocator($php)); $function = $reflector->reflect('foo'); $this->assertTrue($function->isUserDefined()); }