src/Util/ClassUtil.php
public static function getAllProperties($object, bool $asString = true) {
        $validObject = ClassUtil::isValidObject($object);
        if (!$validObject) {
            return null;
        }
        $reflectionClass = new \ReflectionClass($object);
        $properties = $reflectionClass->getProperties();

        if ($asString) {
            return ArrayUtil::arrayToString($properties);
        } else {
            return $properties;
        }
    }
public static function getAllProperties($object, bool $asString = true) {
        $validObject = ClassUtil::isValidObject($object);
        if (!$validObject) {
            return null;
        }
        $reflectionClass = new \ReflectionClass($object);
        $properties = $reflectionClass->getProperties();

        if ($asString) {
            return ArrayUtil::arrayToString($properties);
        } else {
            return $properties;
        }
    }
public static function getAllProperties ( $ object , bool $ asString = true ) { $ validObject = ClassUtil :: isValidObject ( $ object ) ; if ( ! $ validObject ) { return null ; } $ reflectionClass = new \ ReflectionClass ( $ object ) ; $ properties = $ reflectionClass -> getProperties ( ) ; if ( $ asString ) { return ArrayUtil :: arrayToString ( $ properties ) ; } else { return $ properties ; } }
returns all properties of an object

TODO let caller define the visibility

@param      $object
@param bool $asString
@return null|\ReflectionProperty[]|string
@throws \ReflectionException
returns all properties of an object