public static function getConstants($objectOrClass): array
    {
        try {
            $reflectionClass = self::getReflectionClass($objectOrClass);
            return $reflectionClass->getConstants();
        } catch (\Exception $e) {
            return [];
        }
    }