protected function getConstantValues(string $classIdentifier, string $regex) : array
    {
        $reflectionClass = new \ReflectionClass($classIdentifier);
        $constants = $reflectionClass->getConstants();

        $validValues = array_filter($constants, function ($constantName) use ($regex) {
            return preg_match($regex, $constantName);
        }, ARRAY_FILTER_USE_KEY);

        return $validValues;
    }
protected function getConstantValues(string $classIdentifier, string $regex) : array
    {
        $reflectionClass = new \ReflectionClass($classIdentifier);
        $constants = $reflectionClass->getConstants();

        $validValues = array_filter($constants, function ($constantName) use ($regex) {
            return preg_match($regex, $constantName);
        }, ARRAY_FILTER_USE_KEY);

        return $validValues;
    }
protected function getConstantValues ( string $ classIdentifier , string $ regex ) : array { $ reflectionClass = new \ ReflectionClass ( $ classIdentifier ) ; $ constants = $ reflectionClass -> getConstants ( ) ; $ validValues = array_filter ( $ constants , function ( $ constantName ) use ( $ regex ) { return preg_match ( $ regex , $ constantName ) ; } , ARRAY_FILTER_USE_KEY ) ; return $ validValues ; }
Returns the constant values of the given class when its name matches
the given regex.

@param string $classIdentifier
@param string $regex
@return array
Returns the constant values of the given class when its name matches the given regex .