public static createFromName ( string $className, string $propertyName ) : BetterReflection\Reflection\ReflectionMethod | ||
$className | string | |
$propertyName | string | |
Результат | BetterReflection\Reflection\ReflectionMethod |
public static function createFromName($className, $propertyName)
{
return ReflectionClass::createFromName($className)->getProperty($propertyName);
}
public function testCreateFromName() { $property = ReflectionProperty::createFromName(\ReflectionFunctionAbstract::class, 'name'); $this->assertInstanceOf(ReflectionProperty::class, $property); $this->assertSame('name', $property->getName()); }