src/Utils/Reflection/ReflectionUtil.php
public static function getAllProperties($class, $blacklist = [])
    {
        $classReflection = new \ReflectionClass($class);

        $properties = $classReflection->getProperties();

        if ($parentClass = $classReflection->getParentClass()) {
            $parentProps = self::getAllProperties($parentClass->getName(), $blacklist);
            if (!empty($parentProps)) {
                $properties = array_merge($parentProps, $properties);
            }
        }
        if (empty($blacklist)) {
            return $properties;
        }

        return array_filter(
            $properties,
            function (\ReflectionProperty $property) use ($blacklist) {
                return !$property->isStatic() && !in_array($property->name, $blacklist);
            }
        );
    }
public static function getAllProperties($class, $blacklist = [])
    {
        $classReflection = new \ReflectionClass($class);

        $properties = $classReflection->getProperties();

        if ($parentClass = $classReflection->getParentClass()) {
            $parentProps = self::getAllProperties($parentClass->getName(), $blacklist);
            if (!empty($parentProps)) {
                $properties = array_merge($parentProps, $properties);
            }
        }
        if (empty($blacklist)) {
            return $properties;
        }

        return array_filter(
            $properties,
            function (\ReflectionProperty $property) use ($blacklist) {
                return !$property->isStatic() && !in_array($property->name, $blacklist);
            }
        );
    }
public static function getAllProperties ( $ class , $ blacklist = [ ] ) { $ classReflection = new \ ReflectionClass ( $ class ) ; $ properties = $ classReflection -> getProperties ( ) ; if ( $ parentClass = $ classReflection -> getParentClass ( ) ) { $ parentProps = self :: getAllProperties ( $ parentClass -> getName ( ) , $ blacklist ) ; if ( ! empty ( $ parentProps ) ) { $ properties = array_merge ( $ parentProps , $ properties ) ; } } if ( empty ( $ blacklist ) ) { return $ properties ; } return array_filter ( $ properties , function ( \ ReflectionProperty $ property ) use ( $ blacklist ) { return ! $ property -> isStatic ( ) && ! in_array ( $ property -> name , $ blacklist ) ; } ) ; }
Get all the properties not blacklisted.

@param       $class
@param array $blacklist

@throws \ReflectionException

@return array|\ReflectionProperty[]
Get all the properties not blacklisted .