final private static function sortConstants(ReflectionClass $reflection): array
    {
        $constants = [];
        while ($reflection && __CLASS__ !== $reflection->getName()) {
            $scope = [];
            foreach ($reflection->getReflectionConstants() as $const) {
                if ($const->isPublic()) {
                    $scope[$const->getName()] = $const->getValue();
                }
            }
            $constants = $scope + $constants;
            $reflection = $reflection->getParentClass();
        }


        return $constants;
    }