<?php

namespace AppBundle\Enum;

/**
 * 
 */
abstract class AbstractEnum
{
    /**
     * Get the list of constants in the child class
     * @return array Keys are the constant name and values the constant values
     */
    public static function getConstants(): array
    {
        try {
            $class = new \ReflectionClass(get_called_class());

            return $class->getConstants();
        } catch (\ReflectionException $e) {
            return [];
        }
    }
}
