public function getClassProperties(\ReflectionClass $class) : array
    {
        $classes = $this->getClassHierarchy($class);

        /** @var \ReflectionProperty[] $properties */
        $properties = [];

        foreach ($classes as $hClass) {
            $hClassName = $hClass->getName();

            foreach ($hClass->getProperties() as $property) {
                if ($property->isStatic()) {
                    // exclude static properties
                    continue;
                }

                if ($property->getDeclaringClass()->getName() !== $hClassName) {
                    // exclude inherited properties
                    continue;
                }

                $properties[] = $property;
            }
        }

        return $this->filterReflectors($properties);
    }
public function getClassProperties(\ReflectionClass $class) : array
    {
        $classes = $this->getClassHierarchy($class);

        /** @var \ReflectionProperty[] $properties */
        $properties = [];

        foreach ($classes as $hClass) {
            $hClassName = $hClass->getName();

            foreach ($hClass->getProperties() as $property) {
                if ($property->isStatic()) {
                    // exclude static properties
                    continue;
                }

                if ($property->getDeclaringClass()->getName() !== $hClassName) {
                    // exclude inherited properties
                    continue;
                }

                $properties[] = $property;
            }
        }

        return $this->filterReflectors($properties);
    }
public function getClassProperties ( \ ReflectionClass $ class ) : array { $ classes = $ this -> getClassHierarchy ( $ class ) ; /** @var \ReflectionProperty[] $properties */ $ properties = [ ] ; foreach ( $ classes as $ hClass ) { $ hClassName = $ hClass -> getName ( ) ; foreach ( $ hClass -> getProperties ( ) as $ property ) { if ( $ property -> isStatic ( ) ) { // exclude static properties continue ; } if ( $ property -> getDeclaringClass ( ) -> getName ( ) !== $ hClassName ) { // exclude inherited properties continue ; } $ properties [ ] = $ property ; } } return $ this -> filterReflectors ( $ properties ) ; }
Returns reflections of all the non-static properties that make up one object.

Like ReflectionClass::getProperties(), this method:

- does not return overridden protected or public class properties, and only return the overriding one;
- returns properties inside a class in the order they are declared.

Unlike ReflectionClass::getProperties(), this method:

- returns the private properties of parent classes;
- returns properties in hierarchical order: properties from parent classes are returned first.

@param \ReflectionClass $class

@return \ReflectionProperty[]
Returns reflections of all the non - static properties that make up one object .