-
-
Notifications
You must be signed in to change notification settings - Fork 679
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
eb9d191
commit b4d3b7c
Showing
1 changed file
with
53 additions
and
0 deletions.
There are no files selected for viewing
53 changes: 53 additions & 0 deletions
53
...ogoutHandlerToLogoutEventSubscriberRector/Fixture/logout_handle_without_any_usage.php.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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']; | ||
} | ||
} | ||
|
||
?> |