Neos\Flow\Reflection\ClassReflection::getProperty PHP Метод

getProperty() публичный Метод

Replacement for the original getProperty() method which makes sure that a PropertyReflection object is returned instead of the orginal ReflectionProperty instance.
public getProperty ( string $name ) : PropertyReflection
$name string Name of the property
Результат PropertyReflection Property reflection object of the specified property in this class
    public function getProperty($name)
    {
        return new PropertyReflection($this->getName(), $name);
    }

Usage Example

 /**
  * @test
  */
 public function getPropertyReturnsFlowsPropertyReflection()
 {
     $class = new ClassReflection(__CLASS__);
     $this->assertInstanceOf(PropertyReflection::class, $class->getProperty('someProperty'), 'The returned property is not of type \\Neos\\Flow\\Reflection\\PropertyReflection.');
     $this->assertEquals('someProperty', $class->getProperty('someProperty')->getName(), 'The returned property seems not to be the right one.');
 }