| Linux server27.hostingraja.org 2.6.32-954.3.5.lve1.4.93.el6.x86_64 #1 SMP Wed Oct 4 17:04:29 UTC 2023 x86_64 Path : /home/udaipurk/www/websites/rishhh/wp-content/plugins/image-optimization/classes/ |
| Current File : //home/udaipurk/www/websites/rishhh/wp-content/plugins/image-optimization/classes/basic-enum.php |
<?php
namespace ImageOptimization\Classes;
use ReflectionClass;
use ReflectionException;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
abstract class Basic_Enum {
private static array $entries = [];
/**
* @throws ReflectionException
*/
public static function get_values(): array {
return array_values( self::get_entries() );
}
/**
* @throws ReflectionException
*/
protected static function get_entries(): array {
$caller = get_called_class();
if ( ! array_key_exists( $caller, self::$entries ) ) {
$reflect = new ReflectionClass( $caller );
self::$entries[ $caller ] = $reflect->getConstants();
}
return self::$entries[ $caller ];
}
}