Skip to content

Commit

Permalink
Remove $container parameter from controller constructors
Browse files Browse the repository at this point in the history
  • Loading branch information
mkilmanas committed Jan 22, 2024
1 parent 5a20408 commit d3a9773
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
5 changes: 5 additions & 0 deletions psalm.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,10 @@
<PossiblyNullArgument errorLevel="suppress" />
<PossiblyNullPropertyAssignmentValue errorLevel="suppress" />
<PossiblyNullReference errorLevel="suppress" />
<PropertyNotSetInConstructor>
<errorLevel type="suppress">
<referencedProperty name="Symfony\Bundle\FrameworkBundle\Controller\AbstractController::$container" /> <!-- Injected by Symfony DI via setContainer() because marked as #[Required] -->
</errorLevel>
</PropertyNotSetInConstructor>
</issueHandlers>
</psalm>
4 changes: 0 additions & 4 deletions src/Controllers/AuthenticationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
use Auth0\SDK\Auth0;
use Auth0\Symfony\Contracts\Controllers\AuthenticationControllerInterface;
use Auth0\Symfony\Security\Authenticator;
use Psr\Container\ContainerInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Exception\{BadRequestException, ConflictingHeadersException, SuspiciousOperationException};
use Symfony\Component\HttpFoundation\{RedirectResponse, Request, Response};
use Symfony\Component\Routing\RouterInterface;
use Throwable;
Expand All @@ -22,9 +20,7 @@ final class AuthenticationController extends AbstractController implements Authe
public function __construct(
private Authenticator $authenticator,
private RouterInterface $router,
ContainerInterface $container,
) {
$this->container = $container;
}

/**
Expand Down
5 changes: 1 addition & 4 deletions src/Controllers/BackchannelLogoutController.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@
use Auth0\SDK\Auth0;
use Auth0\Symfony\Contracts\Controllers\AuthenticationControllerInterface;
use Auth0\Symfony\Security\Authenticator;
use Psr\Container\ContainerInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\{RedirectResponse, Request, Response};
use Symfony\Component\HttpFoundation\{Request, Response};
use Throwable;

use function is_string;
Expand All @@ -18,9 +17,7 @@ final class BackchannelLogoutController extends AbstractController implements Au
{
public function __construct(
private Authenticator $authenticator,
ContainerInterface $container,
) {
$this->container = $container;
}

/**
Expand Down

0 comments on commit d3a9773

Please sign in to comment.