8000 Use symfony/deprecation-contracts instead of trigger_error · symfony/symfony@74faf7c · GitHub
[go: up one dir, main page]

Skip to content

Commit 74faf7c

Browse files
committed
Use symfony/deprecation-contracts instead of trigger_error
1 parent 3154509 commit 74faf7c

File tree

5 files changed

+7
-6
lines changed

5 files changed

+7
-6
lines changed

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ private function addFormSection(ArrayNodeDefinition $rootNode, callable $enableI
214214
->validate()
215215
->ifTrue()
216216
->then(function ($v) {
217-
@trigger_error('Since symfony/framework-bundle 5.2: Setting the "framework.form.legacy_error_messages" option to "true" is deprecated. It will have no effect as of Symfony 6.0.', \E_USER_DEPRECATED);
217+
trigger_deprecation('symfony/framework-bundle', '5.2', 'Setting the "framework.form.legacy_error_messages" option to "true" is deprecated. It will have no effect as of Symfony 6.0.');
218218

219219
return $v;
220220
})
@@ -234,7 +234,7 @@ private function addHttpCacheSection(ArrayNodeDefinition $rootNode)
234234
->info('HTTP cache configuration')
235235
->canBeEnabled()
236236
->fixXmlConfig('private_header')
237-
->children()
237+
->children()/
238238
->booleanNode('debug')->defaultValue('%kernel.debug%')->end()
239239
->enumNode('trace_level')
240240
->values(['none', 'short', 'full'])

src/Symfony/Component/Mailer/Bridge/Mailgun/Transport/MailgunApiTransport.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ private function getPayload(Email $email, Envelope $envelope): array
137137
} else {
138138
// fallback to prefix with "h:" to not break BC
139139
$headerName = 'h:'.$name;
140-
@trigger_error(sprintf('Not prefixing the Mailgun header name with "h:" is deprecated since Symfony 5.1. Use header name "%s" instead.', $headerName), \E_USER_DEPRECATED);
140+
trigger_deprecation('symfony/mailer', '5.1', 'Not prefixing the Mailgun header name with "h:" is deprecated. Use header name "%s" instead.', $headerName);
141141
}
142142

143143
$payload[$headerName] = $header->getBodyAsString();

src/Symfony/Component/Mailer/Bridge/Mailgun/composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
],
1818
"require": {
1919
"php": ">=7.2.5",
20+
"symfony/deprecation-contracts": "^2.1",
2021
"symfony/mailer": "^5.2.6"
2122
},
2223
"require-dev": {

src/Symfony/Component/Messenger/Command/AbstractFailedMessagesCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ protected function printPendingMessagesMessage(ReceiverInterface $receiver, Symf
175175
protected function getReceiver(/* string $name */): ReceiverInterface
176176
{
177177
if (1 > \func_num_args() && __CLASS__ !== static::class && __CLASS__ !== (new \ReflectionMethod($this, __FUNCTION__))->getDeclaringClass()->getName() && !$this instanceof \PHPUnit\Framework\MockObject\MockObject && !$this instanceof \Prophecy\Prophecy\ProphecySubjectInterface) {
178-
@trigger_error(sprintf('The "%s()" method will have a new "string $name" argument in version 5.3, not defining it is deprecated since Symfony 5.2.', __METHOD__), \E_USER_DEPRECATED);
178+
trigger_deprecation('symfony/messenger', '5.2', sprintf('The "%s()" method will have a new "string $name" argument in version 5.3, not defining it is deprecated.', __METHOD__));
179179
}
180180

181181
$name = \func_num_args() > 0 ? func_get_arg(0) : $this->globalFailureReceiverName;

src/Symfony/Component/Translation/PluralizationRules.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public static function get($number, $locale/*, bool $triggerDeprecation = true*/
3535
$number = abs($number);
3636

3737
if (3 > \func_num_args() || func_get_arg(2)) {
38-
@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.2.', __CLASS__), \E_USER_DEPRECATED);
38+
trigger_deprecation('symfony/translation', '4.2', 'The "%s" class is deprecated.', __CLASS__);
3939
}
4040

4141
if ('pt_BR' === $locale) {
@@ -204,7 +204,7 @@ public static function get($number, $locale/*, bool $triggerDeprecation = true*/
204204
*/
205205
public static function set(callable $rule, $locale)
206206
{
207-
@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.2.', __CLASS__), \E_USER_DEPRECATED);
207+
trigger_deprecation('symfony/translation', '4.2', 'The "%s" class is deprecated.', __CLASS__);
208208

209209
if ('pt_BR' === $locale) {
210210
// temporary set a locale for brazilian

0 commit comments

Comments
 (0)
0