Skip to content

Commit

Permalink
add no usage test
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba committed Jan 28, 2021
1 parent eb9d191 commit b4d3b7c
Showing 1 changed file with 53 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?php

namespace Rector\Symfony5\Tests\Rector\Class_\LogoutHandlerToLogoutEventSubscriberRector\Fixture;

use Symfony\Component\Security\Http\Logout\LogoutHandlerInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;

final class LogoutHandlerWithoutAnyUsage implements LogoutHandlerInterface
{
/**
* @var int
*/
private $value;

public function logout(Request $request, Response $response, TokenInterface $token)
{
$this->value = 1000;
}
}

?>
-----
<?php

namespace Rector\Symfony5\Tests\Rector\Class_\LogoutHandlerToLogoutEventSubscriberRector\Fixture;

use Symfony\Component\Security\Http\Logout\LogoutHandlerInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;

final class LogoutHandlerWithoutAnyUsage implements \Symfony\Component\EventDispatcher\EventSubscriberInterface
{
/**
* @var int
*/
private $value;
public function onLogout(\Symfony\Component\Security\Http\Event\LogoutEvent $logoutEvent): void
{
$this->value = 1000;
}
/**
* @return array<string, mixed>
*/
public static function getSubscribedEvents(): array
{
return [\Symfony\Component\Security\Http\Event\LogoutEvent::class => 'onLogout'];
}
}

?>

0 comments on commit b4d3b7c

Please sign in to comment.