private function getFromAnnotation(ReflectionClass $class): array
    {
        $sortings = Utils::getRecursiveClassAnnotations($this->getAnnotationReader(), $class, Sorting::class);

        $result = [];
        foreach ($sortings as $classWithAnnotation => $sorting) {
            foreach ($sorting->classes as $className) {
                $this->throwIfInvalidAnnotation($classWithAnnotation, 'Sorting', SortingInterface::class, $className);

                $name = lcfirst(preg_replace('~Type$~', '', Utils::getTypeName($className)));
                $result[$name] = new $className();
            }
        }

        return $result;
    }
private function getFromAnnotation(ReflectionClass $class): array
    {
        $sortings = Utils::getRecursiveClassAnnotations($this->getAnnotationReader(), $class, Sorting::class);

        $result = [];
        foreach ($sortings as $classWithAnnotation => $sorting) {
            foreach ($sorting->classes as $className) {
                $this->throwIfInvalidAnnotation($classWithAnnotation, 'Sorting', SortingInterface::class, $className);

                $name = lcfirst(preg_replace('~Type$~', '', Utils::getTypeName($className)));
                $result[$name] = new $className();
            }
        }

        return $result;
    }
private function getFromAnnotation ( ReflectionClass $ class ) : array { $ sortings = Utils :: getRecursiveClassAnnotations ( $ this -> getAnnotationReader ( ) , $ class , Sorting :: class ) ; $ result = [ ] ; foreach ( $ sortings as $ classWithAnnotation => $ sorting ) { foreach ( $ sorting -> classes as $ className ) { $ this -> throwIfInvalidAnnotation ( $ classWithAnnotation , 'Sorting' , SortingInterface :: class , $ className ) ; $ name = lcfirst ( preg_replace ( '~Type$~' , '' , Utils :: getTypeName ( $ className ) ) ) ; $ result [ $ name ] = new $ className ( ) ; } } return $ result ; }
Get all instance of custom sorting from the annotation

@param ReflectionClass $class

@return SortingInterface[]
Get all instance of custom sorting from the annotation