Archived
1
0
Fork 0
This repository has been archived on 2023-09-27. You can view files and clone it, but cannot push or open issues or pull requests.
ts3web/config/Constants.php
Varakh bcbf9ad365 Prepare 2.2.7 next development cycle (#2)
Co-authored-by: Varakh <varakh@varakh.de>
Reviewed-on: #2
2023-04-06 20:58:15 +00:00

46 lines
809 B
PHP

<?php
/**
* Class Constants
*/
class Constants
{
/**
* Years tag
*/
const YEARS = '2020-2023';
/**
* Version tag
*/
const VERSION = '2.2.7-SNAPSHOT';
/**
* Return constant by its class name
*
* @param $value
* @return string|null
* @throws ReflectionException
*/
public static function get($value)
{
$constants = self::getConstants();
if (!array_key_exists($value, $constants)) {
return null;
}
return $constants[$value];
}
/**
* Gets all constants
*
* @return array
* @throws ReflectionException
*/
private static function getConstants()
{
$oClass = new ReflectionClass(__CLASS__);
return $oClass->getConstants();
}
}