Skip to content

Commit

Permalink
Fixed a BC break with symfony 4.3+
Browse files Browse the repository at this point in the history
  • Loading branch information
DamienHarper committed Feb 7, 2020
1 parent f7f8d8a commit d42c1d6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"doctrine/doctrine-migrations-bundle": "^1.3|^2.0",
"friendsofphp/php-cs-fixer": "^2.15",
"gedmo/doctrine-extensions": "^2.4",
"jwage/changelog-generator": "^1.2",
"matthiasnoback/symfony-dependency-injection-test": "^3.1|^4.0",
"phpstan/phpstan": "^0.12",
"phpstan/phpstan-doctrine": "^0.12",
Expand Down
2 changes: 2 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@ parameters:
- '~Cannot call method fetchColumn\(\) on Doctrine\\DBAL\\Driver\\Statement\|int~'
- '~Cannot call method fetchAll\(\) on Doctrine\\DBAL\\Driver\\Statement\|int~'
- '~Method Symfony\\Contracts\\EventDispatcher\\EventDispatcherInterface\:\:dispatch\(\) invoked with 2 parameters, 1 required.~'
- '~Method DH\\DoctrineAuditBundle\\Routing\\DoctrineAuditRoutingLoader\:\:load\(\) has parameter \$type with no typehint specified.~'
- '~Method DH\\DoctrineAuditBundle\\Routing\\DoctrineAuditRoutingLoader\:\:supports\(\) has parameter \$type with no typehint specified.~'
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<?php

declare(strict_types=1);

namespace DH\DoctrineAuditBundle\Routing;

use DH\DoctrineAuditBundle\Controller\AuditController;
use Symfony\Bundle\FrameworkBundle\Routing\AnnotatedRouteControllerLoader;
use Symfony\Component\Config\Loader\Loader;
use Symfony\Component\Config\Loader\LoaderInterface;
Expand All @@ -21,17 +20,17 @@ class DoctrineAuditRoutingLoader extends Loader implements LoaderInterface
*/
private $configuration;

public function load($resource, ?string $type = null): RouteCollection
public function load($resource, $type = null): RouteCollection
{
$routeCollection = new RouteCollection();
if (true === $this->configuration['enabled_viewer']) {
$routeCollection = $this->annotationLoader->load('DH\DoctrineAuditBundle\Controller\AuditController');
$routeCollection = $this->annotationLoader->load(AuditController::class);
}

return $routeCollection;
}

public function supports($resource, ?string $type = null): bool
public function supports($resource, $type = null): bool
{
return 'audit_loader' === $type;
}
Expand Down

0 comments on commit d42c1d6

Please sign in to comment.