public static function getProperties(
        ?object $object,
        ?string $classOverride = null,
        ?int $propertyType = null
    ): array {
        $reflectionClass = self::getReflectionClass($object, $classOverride);
        $properties = [];
        $reflectionProperties = $reflectionClass->getProperties($propertyType);
        foreach ($reflectionProperties as $property) {
            $property->setAccessible(true);
            $properties[$property->getName()] = $property->getValue($object);
        }
        return $properties;
    }
public static function getProperties(
        ?object $object,
        ?string $classOverride = null,
        ?int $propertyType = null
    ): array {
        $reflectionClass = self::getReflectionClass($object, $classOverride);
        $properties = [];
        $reflectionProperties = $reflectionClass->getProperties($propertyType);
        foreach ($reflectionProperties as $property) {
            $property->setAccessible(true);
            $properties[$property->getName()] = $property->getValue($object);
        }
        return $properties;
    }
public static function getProperties ( ? object $ object , ? string $ classOverride = null , ? int $ propertyType = null ) : array { $ reflectionClass = self :: getReflectionClass ( $ object , $ classOverride ) ; $ properties = [ ] ; $ reflectionProperties = $ reflectionClass -> getProperties ( $ propertyType ) ; foreach ( $ reflectionProperties as $ property ) { $ property -> setAccessible ( true ) ; $ properties [ $ property -> getName ( ) ] = $ property -> getValue ( $ object ) ; } return $ properties ; }
Get properties.

@param object $object
@param string $classOverride Default null which means class from $object.
@param int $propertyType Default null.
@return string[]
@throws \ReflectionException
Get properties .