Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#391 Find audit route using the annotation loader #397

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Resources/config/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ services:

DH\AuditorBundle\Routing\RoutingAnnotationLoader:
arguments:
- '@routing.loader.annotation'
- '@routing.loader.attribute'
- '%dh_auditor.provider.doctrine.configuration%'
tags:
- { name: routing.loader }
Expand Down
10 changes: 5 additions & 5 deletions src/Routing/RoutingAnnotationLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@

use DH\AuditorBundle\Controller\ViewerController;
use RuntimeException;
use Symfony\Bundle\FrameworkBundle\Routing\AnnotatedRouteControllerLoader;
use Symfony\Bundle\FrameworkBundle\Routing\AttributeRouteControllerLoader;
use Symfony\Component\Config\Loader\Loader;
use Symfony\Component\Routing\RouteCollection;

class RoutingAnnotationLoader extends Loader
{
private AnnotatedRouteControllerLoader $annotatedRouteControllerLoader;
private AttributeRouteControllerLoader $attributeRouteControllerLoader;

Check failure on line 15 in src/Routing/RoutingAnnotationLoader.php

View workflow job for this annotation

GitHub Actions / Tests PHP 8.2, Symfony 5.*

Property DH\AuditorBundle\Routing\RoutingAnnotationLoader::$attributeRouteControllerLoader has unknown class Symfony\Bundle\FrameworkBundle\Routing\AttributeRouteControllerLoader as its type.

Check failure on line 15 in src/Routing/RoutingAnnotationLoader.php

View workflow job for this annotation

GitHub Actions / Tests PHP 8.3, Symfony 5.*

Property DH\AuditorBundle\Routing\RoutingAnnotationLoader::$attributeRouteControllerLoader has unknown class Symfony\Bundle\FrameworkBundle\Routing\AttributeRouteControllerLoader as its type.

private bool $isLoaded = false;

private array $configuration;

public function __construct(AnnotatedRouteControllerLoader $annotatedRouteController, array $configuration)
public function __construct(AttributeRouteControllerLoader $attributeRouteControllerLoader, array $configuration)

Check failure on line 21 in src/Routing/RoutingAnnotationLoader.php

View workflow job for this annotation

GitHub Actions / Tests PHP 8.2, Symfony 5.*

Parameter $attributeRouteControllerLoader of method DH\AuditorBundle\Routing\RoutingAnnotationLoader::__construct() has invalid type Symfony\Bundle\FrameworkBundle\Routing\AttributeRouteControllerLoader.

Check failure on line 21 in src/Routing/RoutingAnnotationLoader.php

View workflow job for this annotation

GitHub Actions / Tests PHP 8.3, Symfony 5.*

Parameter $attributeRouteControllerLoader of method DH\AuditorBundle\Routing\RoutingAnnotationLoader::__construct() has invalid type Symfony\Bundle\FrameworkBundle\Routing\AttributeRouteControllerLoader.
{
$this->annotatedRouteControllerLoader = $annotatedRouteController;
$this->attributeRouteControllerLoader = $attributeRouteControllerLoader;
$this->configuration = $configuration;
}

Expand All @@ -32,7 +32,7 @@

$routeCollection = new RouteCollection();
if (true === $this->configuration['viewer']) {
$routeCollection = $this->annotatedRouteControllerLoader->load(ViewerController::class);
$routeCollection = $this->attributeRouteControllerLoader->load(ViewerController::class);

Check failure on line 35 in src/Routing/RoutingAnnotationLoader.php

View workflow job for this annotation

GitHub Actions / Tests PHP 8.2, Symfony 5.*

Call to method load() on an unknown class Symfony\Bundle\FrameworkBundle\Routing\AttributeRouteControllerLoader.

Check failure on line 35 in src/Routing/RoutingAnnotationLoader.php

View workflow job for this annotation

GitHub Actions / Tests PHP 8.3, Symfony 5.*

Call to method load() on an unknown class Symfony\Bundle\FrameworkBundle\Routing\AttributeRouteControllerLoader.
}

$this->isLoaded = true;
Expand Down
Loading