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);
    }