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

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

Replacement for the original getProperties() method which makes sure that PropertyReflection objects are returned instead of the orginal ReflectionProperty instances.
public getProperties ( integer $filter = null ) : array
$filter integer A filter mask
Результат array
    public function getProperties($filter = null)
    {
        $extendedProperties = [];
        $properties = $filter === null ? parent::getProperties() : parent::getProperties($filter);
        foreach ($properties as $property) {
            $extendedProperties[] = new PropertyReflection($this->getName(), $property->getName());
        }
        return $extendedProperties;
    }

Usage Example

 /**
  * @test
  */
 public function getPropertiesReturnsFlowsPropertyReflection()
 {
     $class = new ClassReflection(__CLASS__);
     $properties = $class->getProperties();
     $this->assertTrue(is_array($properties), 'The returned value is no array.');
     $this->assertInstanceOf(PropertyReflection::class, array_pop($properties), 'The returned properties are not of type \\Neos\\Flow\\Reflection\\PropertyReflection.');
 }