for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace KunicMarko\SonataAnnotationBundle\Reader;
use KunicMarko\SonataAnnotationBundle\Annotation\AddRoute;
use KunicMarko\SonataAnnotationBundle\Annotation\RemoveRoute;
/**
* @author Marko Kunic <[email protected]>
*/
final class RouteReader
{
use AnnotationReaderTrait;
public function getRoutes(\ReflectionClass $class): array
$addRoutes = [];
$removeRoutes = [];
foreach ($this->getClassAnnotations($class) as $annotation) {
if ($annotation instanceof AddRoute) {
$addRoutes[$annotation->getName()] = $annotation;
continue;
}
if ($annotation instanceof RemoveRoute) {
$removeRoutes[$annotation->getName()] = $annotation;
return [$addRoutes, $removeRoutes];