private function getClassProperties($argument, $filter = null)
    {
        if (null === $filter) {
            $filter = \ReflectionProperty::IS_STATIC | \ReflectionProperty::IS_PUBLIC | \ReflectionProperty::IS_PROTECTED | \ReflectionProperty::IS_PRIVATE;
        }

        $reflectionClass = new \ReflectionClass($argument);

        if ($parentClass = $reflectionClass->getParentClass()) {
            return array_merge($this->getClassProperties($parentClass->getName(), $filter), $reflectionClass->getProperties($filter));
        }

        return $reflectionClass->getProperties($filter);
    }
private function getClassProperties($argument, $filter = null)
    {
        if (null === $filter) {
            $filter = \ReflectionProperty::IS_STATIC | \ReflectionProperty::IS_PUBLIC | \ReflectionProperty::IS_PROTECTED | \ReflectionProperty::IS_PRIVATE;
        }

        $reflectionClass = new \ReflectionClass($argument);

        if ($parentClass = $reflectionClass->getParentClass()) {
            return array_merge($this->getClassProperties($parentClass->getName(), $filter), $reflectionClass->getProperties($filter));
        }

        return $reflectionClass->getProperties($filter);
    }
private function getClassProperties ( $ argument , $ filter = null ) { if ( null === $ filter ) { $ filter = \ ReflectionProperty :: IS_STATIC | \ ReflectionProperty :: IS_PUBLIC | \ ReflectionProperty :: IS_PROTECTED | \ ReflectionProperty :: IS_PRIVATE ; } $ reflectionClass = new \ ReflectionClass ( $ argument ) ; if ( $ parentClass = $ reflectionClass -> getParentClass ( ) ) { return array_merge ( $ this -> getClassProperties ( $ parentClass -> getName ( ) , $ filter ) , $ reflectionClass -> getProperties ( $ filter ) ) ; } return $ reflectionClass -> getProperties ( $ filter ) ; }
Return properties of a class and all its inheritance hierarchy.

@param object|string $argument Object or class name to get properties from
@param null|int      $filter   Optional filter, for filtering desired property types. It's configured using the `\ReflectionProperty` constants, and defaults to all property types.

@throws \ReflectionException if the class to reflect does not exist

@return \ReflectionProperty[]
Return properties of a class and all its inheritance hierarchy .