File "BasicEnum.php"

Full Path: /home/stylijtl/public_html/wp-content/plugins/elementor/vendor/elementor/wp-one-package/src/Common/BasicEnum.php
File size: 712 bytes
MIME-type: text/x-php
Charset: utf-8

<?php

namespace ElementorOne\Common;

if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly.
}

/*
 * BasicEnum class
 */
abstract class BasicEnum {

	/**
	 * Entries
	 * @var array
	 */
	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 ];
	}
}