Skip to content

Commit

Permalink
Update Controllers, it is not necessary to extend AbstractController …
Browse files Browse the repository at this point in the history
…anymore.
  • Loading branch information
drupol committed Jun 3, 2020
1 parent bca8c68 commit cf294d6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
10 changes: 6 additions & 4 deletions src/Controller/Login.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,29 @@
namespace EcPhp\CasBundle\Controller;

use EcPhp\CasLib\CasInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Security\Core\Security;

/**
* Class Login.
*/
final class Login extends AbstractController
final class Login
{
/**
* @param \Symfony\Component\HttpFoundation\Request $request
* @param \EcPhp\CasLib\CasInterface $cas
* @param \Symfony\Component\Security\Core\Security $security
*
* @return \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response
*/
public function __invoke(
Request $request,
CasInterface $cas
CasInterface $cas,
Security $security
) {
$parameters = $request->query->all() + [
'renew' => null !== $this->getUser(),
'renew' => null !== $security->getUser(),
];

if (null !== $response = $cas->login($parameters)) {
Expand Down
3 changes: 1 addition & 2 deletions src/Controller/Logout.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@
namespace EcPhp\CasBundle\Controller;

use EcPhp\CasLib\CasInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;

/**
* Class Logout.
*/
final class Logout extends AbstractController
final class Logout
{
/**
* @param \EcPhp\CasLib\CasInterface $cas
Expand Down
3 changes: 1 addition & 2 deletions src/Controller/ProxyCallback.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@

use EcPhp\CasLib\CasInterface;
use Symfony\Bridge\PsrHttpMessage\HttpFoundationFactoryInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;

/**
* Class ProxyCallback.
*/
final class ProxyCallback extends AbstractController
final class ProxyCallback
{
/**
* @param \EcPhp\CasLib\CasInterface $casProtocol
Expand Down

0 comments on commit cf294d6

Please sign in to comment.