Skip to content

Commit

Permalink
improve GetBySymfonyStringToConstructorInjectionRector with session, …
Browse files Browse the repository at this point in the history
…translator and security.token_storage
  • Loading branch information
TomasVotruba committed Jan 6, 2025
1 parent f7e0a14 commit 4d9e547
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ final class GetBySymfonyStringToConstructorInjectionRector extends AbstractRecto
'event_dispatcher' => SymfonyClass::EVENT_DISPATCHER_INTERFACE,
'logger' => SymfonyClass::LOGGER_INTERFACE,
'jms_serializer' => SymfonyClass::SERIALIZER_INTERFACE,
'translator' => SymfonyClass::TRANSLATOR_INTERFACE,
'session' => SymfonyClass::SESSION,
'security.token_storage' => SymfonyClass::TOKEN_STORAGE_INTERFACE,
];

public function __construct(
Expand Down
15 changes: 15 additions & 0 deletions src/Enum/SymfonyClass.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,19 @@ final class SymfonyClass
* @var string
*/
public const EVENT_SUBSCRIBER_INTERFACE = 'Symfony\Component\EventDispatcher\EventSubscriberInterface';

/**
* @var string
*/
public const TRANSLATOR_INTERFACE = 'Symfony\Contracts\Translation\TranslatorInterface';

/**
* @var string
*/
public const SESSION = 'Symfony\Component\HttpFoundation\Session\Session';

/**
* @var string
*/
public const TOKEN_STORAGE_INTERFACE = 'Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface';
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@

interface TranslatorInterface
{

}

0 comments on commit 4d9e547

Please sign in to comment.