src/Knp/DictionaryBundle/ValueTransformer/Constant.php
public function supports($value): bool
    {
        if (false === \is_string($value)) {
            return false;
        }

        $matches = [];

        if (0 === preg_match($this->pattern, $value, $matches)) {
            return false;
        }

        if (false === class_exists($matches['class']) && false === interface_exists($matches['class'])) {
            return false;
        }

        $constants = (new ReflectionClass($matches['class']))
            ->getConstants()
        ;

        return array_key_exists($matches['constant'], $constants);
    }
public function supports($value): bool
    {
        if (false === \is_string($value)) {
            return false;
        }

        $matches = [];

        if (0 === preg_match($this->pattern, $value, $matches)) {
            return false;
        }

        if (false === class_exists($matches['class']) && false === interface_exists($matches['class'])) {
            return false;
        }

        $constants = (new ReflectionClass($matches['class']))
            ->getConstants()
        ;

        return array_key_exists($matches['constant'], $constants);
    }
{@inheritdoc}