private static function getReflectionClass($objectOrClass, $classOverride = null): ReflectionClass
    {
        $class = $classOverride;
        if ($class === null) {
            if (is_object($objectOrClass)) {
                $class = get_class($objectOrClass);
            } else {
                $class = $objectOrClass;
            }
        }
        return new ReflectionClass($class);
    }
private static function getReflectionClass($objectOrClass, $classOverride = null): ReflectionClass
    {
        $class = $classOverride;
        if ($class === null) {
            if (is_object($objectOrClass)) {
                $class = get_class($objectOrClass);
            } else {
                $class = $objectOrClass;
            }
        }
        return new ReflectionClass($class);
    }
private static function getReflectionClass ( $ objectOrClass , $ classOverride = null ) : ReflectionClass { $ class = $ classOverride ; if ( $ class === null ) { if ( is_object ( $ objectOrClass ) ) { $ class = get_class ( $ objectOrClass ) ; } else { $ class = $ objectOrClass ; } } return new ReflectionClass ( $ class ) ; }
Get reflection class.

@param object|string $objectOrClass
@param string $classOverride Default null which means class from $object.
@return ReflectionClass
@throws \ReflectionException
Get reflection class .