[Symfony 5.2] Change Param type declaration for Chat/Email/Sms NotificationInterface (#5420)

This commit is contained in:
Abdul Malik Ikhsan 2021-02-05 05:46:27 +07:00 committed by GitHub
parent 3784552b70
commit 760facb75b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -154,4 +154,29 @@ return static function (ContainerConfigurator $containerConfigurator): void {
),
]),
]]);
# https://github.com/symfony/symfony/blob/5.x/UPGRADE-5.2.md#notifier
$services->set(AddParamTypeDeclarationRector::class)
->call('configure', [[
AddParamTypeDeclarationRector::PARAMETER_TYPEHINTS => ValueObjectInliner::inline([
new AddParamTypeDeclaration(
'Symfony\Component\Notifier\Notification\ChatNotificationInterface',
'asChatMessage',
0,
new ObjectType('Symfony\Component\Notifier\Recipient\RecipientInterface'),
),
new AddParamTypeDeclaration(
'Symfony\Component\Notifier\Notification\EmailNotificationInterface',
'asEmailMessage',
0,
new ObjectType('Symfony\Component\Notifier\Recipient\EmailRecipientInterface'),
),
new AddParamTypeDeclaration(
'Symfony\Component\Notifier\Notification\SmsNotificationInterface',
'asSmsMessage',
0,
new ObjectType('Symfony\Component\Notifier\Recipient\SmsRecipientInterface'),
),
]),
]]);
};