Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 3566e85

Browse filesBrowse files
Leverage trigger_deprecation() from symfony/deprecation-contracts
1 parent 55e2c5b commit 3566e85
Copy full SHA for 3566e85

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Dismiss banner

57 files changed

+74
-64
lines changed

‎composer.json

Copy file name to clipboardExpand all lines: composer.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"psr/event-dispatcher": "^1.0",
2727
"psr/link": "^1.0",
2828
"psr/log": "~1.0",
29-
"symfony/contracts": "^2",
29+
"symfony/contracts": "^2.1",
3030
"symfony/polyfill-ctype": "~1.8",
3131
"symfony/polyfill-intl-grapheme": "~1.0",
3232
"symfony/polyfill-intl-icu": "~1.0",

‎src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ public function load(array $configs, ContainerBuilder $container)
214214
}
215215

216216
if (!\extension_loaded('intl') && !\defined('PHPUNIT_COMPOSER_INSTALL')) {
217-
@trigger_error('Please install the "intl" PHP extension for best performance.', E_USER_DEPRECATED);
217+
trigger_deprecation('', '', 'Please install the "intl" PHP extension for best performance.');
218218
}
219219
}
220220

@@ -857,7 +857,7 @@ private function registerRouterConfiguration(array $config, ContainerBuilder $co
857857
$loader->load('routing.xml');
858858

859859
if (null === $config['utf8']) {
860-
@trigger_error('Not setting the "framework.router.utf8" configuration option is deprecated since Symfony 5.1, it will default to "true" in Symfony 6.0.', E_USER_DEPRECATED);
860+
trigger_deprecation('symfony/framework-bundle', '5.1', 'Not setting the "framework.router.utf8" configuration option is deprecated, it will default to "true" in version 6.0.');
861861
}
862862

863863
if ($config['utf8']) {

‎src/Symfony/Bundle/FrameworkBundle/Kernel/MicroKernelTrait.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Kernel/MicroKernelTrait.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ public function loadRoutes(LoaderInterface $loader)
174174
}
175175
}
176176

177-
@trigger_error(sprintf('Using type "%s" for argument 1 of method "%s:configureRoutes()" is deprecated since Symfony 5.1, use "%s" instead.', RouteCollectionBuilder::class, self::class, RoutingConfigurator::class), E_USER_DEPRECATED);
177+
trigger_deprecation('symfony/framework-bundle', '5.1', 'Using type "%s" for argument 1 of method "%s:configureRoutes()" is deprecated, use "%s" instead.', RouteCollectionBuilder::class, self::class, RoutingConfigurator::class);
178178

179179
$routes = new RouteCollectionBuilder($loader);
180180
$this->configureRoutes($routes);

‎src/Symfony/Component/Config/Definition/ArrayNode.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Config/Definition/ArrayNode.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ protected function finalizeValue($value)
227227
}
228228

229229
if ($child->isDeprecated()) {
230-
@trigger_error($child->getDeprecationMessage($name, $this->getPath()), E_USER_DEPRECATED);
230+
trigger_deprecation('', '', $child->getDeprecationMessage($name, $this->getPath()));
231231
}
232232

233233
try {

‎src/Symfony/Component/Config/composer.json

Copy file name to clipboardExpand all lines: src/Symfony/Component/Config/composer.json
+1Lines 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/filesystem": "^4.4|^5.0",
2122
"symfony/polyfill-ctype": "~1.8"
2223
},

‎src/Symfony/Component/DependencyInjection/Compiler/ResolveReferencesToAliasesPass.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Compiler/ResolveReferencesToAliasesPass.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ private function getDefinitionId(string $id, ContainerBuilder $container): strin
6262
$alias = $container->getAlias($id);
6363

6464
if ($alias->isDeprecated()) {
65-
@trigger_error(sprintf('%s. It is being referenced by the "%s" %s.', rtrim($alias->getDeprecationMessage($id), '. '), $this->currentId, $container->hasDefinition($this->currentId) ? 'service' : 'alias'), E_USER_DEPRECATED);
65+
trigger_deprecation('', '', '%s. It is being referenced by the "%s" %s.', rtrim($alias->getDeprecationMessage($id), '. '), $this->currentId, $container->hasDefinition($this->currentId) ? 'service' : 'alias');
6666
}
6767

6868
$seen = [];

‎src/Symfony/Component/DependencyInjection/ContainerBuilder.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/ContainerBuilder.php
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ private function doGet(string $id, int $invalidBehavior = ContainerInterface::EX
568568
$alias = $this->aliasDefinitions[$id];
569569

570570
if ($alias->isDeprecated()) {
571-
@trigger_error($alias->getDeprecationMessage($id), E_USER_DEPRECATED);
571+
trigger_deprecation('', '', $alias->getDeprecationMessage($id));
572572
}
573573

574574
return $this->doGet((string) $alias, $invalidBehavior, $inlineServices, $isConstructorArgument);
@@ -1037,7 +1037,7 @@ private function createService(Definition $definition, array &$inlineServices, b
10371037
}
10381038

10391039
if ($definition->isDeprecated()) {
1040-
@trigger_error($definition->getDeprecationMessage($id), E_USER_DEPRECATED);
1040+
trigger_deprecation('', '', $definition->getDeprecationMessage($id));
10411041
}
10421042

10431043
if ($tryProxy && $definition->isLazy() && !$tryProxy = !($proxy = $this->proxyInstantiator) || $proxy instanceof RealServiceInstantiator) {
@@ -1080,7 +1080,7 @@ private function createService(Definition $definition, array &$inlineServices, b
10801080
$r = new \ReflectionClass($factory[0]);
10811081

10821082
if (0 < strpos($r->getDocComment(), "\n * @deprecated ")) {
1083-
@trigger_error(sprintf('The "%s" service relies on the deprecated "%s" factory class. It should either be deprecated or its factory upgraded.', $id, $r->name), E_USER_DEPRECATED);
1083+
trigger_deprecation('', '', 'The "%s" service relies on the deprecated "%s" factory class. It should either be deprecated or its factory upgraded.', $id, $r->name);
10841084
}
10851085
}
10861086
} else {
@@ -1089,7 +1089,7 @@ private function createService(Definition $definition, array &$inlineServices, b
10891089
$service = null === $r->getConstructor() ? $r->newInstance() : $r->newInstanceArgs($arguments);
10901090

10911091
if (!$definition->isDeprecated() && 0 < strpos($r->getDocComment(), "\n * @deprecated ")) {
1092-
@trigger_error(sprintf('The "%s" service relies on the deprecated "%s" class. It should either be deprecated or its implementation upgraded.', $id, $r->name), E_USER_DEPRECATED);
1092+
trigger_deprecation('', '', 'The "%s" service relies on the deprecated "%s" class. It should either be deprecated or its implementation upgraded.', $id, $r->name);
10931093
}
10941094
}
10951095

‎src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -803,7 +803,7 @@ protected function {$methodName}($lazyInitialization)
803803
$this->inlinedDefinitions = $this->getDefinitionsFromArguments([$definition], null, $this->serviceCalls);
804804

805805
if ($definition->isDeprecated()) {
806-
$code .= sprintf(" @trigger_error(%s, E_USER_DEPRECATED);\n\n", $this->export($definition->getDeprecationMessage($id)));
806+
$code .= sprintf(" trigger_deprecation('', '', %s);\n\n", $this->export($definition->getDeprecationMessage($id)));
807807
}
808808

809809
if ($this->getProxyDumper()->isProxyCandidate($definition)) {
@@ -1312,7 +1312,7 @@ private function addDeprecatedAliases(): string
13121312
*/
13131313
protected function {$methodNameAlias}()
13141314
{
1315-
@trigger_error($messageExported, E_USER_DEPRECATED);
1315+
trigger_deprecation('', '', $messageExported);
13161316
13171317
return \$this->get($idExported);
13181318
}

‎src/Symfony/Component/DependencyInjection/Tests/Fixtures/DeprecatedClass.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Tests/Fixtures/DeprecatedClass.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
namespace Symfony\Component\DependencyInjection\Tests\Fixtures;
1313

14-
@trigger_error('deprecated', E_USER_DEPRECATED);
14+
trigger_deprecation('', '', 'deprecated');
1515

1616
class DeprecatedClass
1717
{

‎src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/container_alias_deprecation.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/container_alias_deprecation.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ protected function getFooService()
6666
*/
6767
protected function getAliasForFooDeprecatedService()
6868
{
69-
@trigger_error('The "alias_for_foo_deprecated" service alias is deprecated. You should stop using it, as it will be removed in the future.', E_USER_DEPRECATED);
69+
trigger_deprecation('', '', 'The "alias_for_foo_deprecated" service alias is deprecated. You should stop using it, as it will be removed in the future.');
7070

7171
return $this->get('foo');
7272
}

‎src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9_as_files.txt

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9_as_files.txt
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ use Symfony\Component\DependencyInjection\Exception\RuntimeException;
124124
// This file has been auto-generated by the Symfony Dependency Injection Component for internal use.
125125
// Returns the public 'deprecated_service' shared service.
126126

127-
@trigger_error('The "deprecated_service" service is deprecated. You should stop using it, as it will be removed in the future.', E_USER_DEPRECATED);
127+
trigger_deprecation('', '', 'The "deprecated_service" service is deprecated. You should stop using it, as it will be removed in the future.');
128128

129129
return $this->services['deprecated_service'] = new \stdClass();
130130

@@ -156,7 +156,7 @@ use Symfony\Component\DependencyInjection\Exception\RuntimeException;
156156
// This file has been auto-generated by the Symfony Dependency Injection Component for internal use.
157157
// Returns the private 'factory_simple' shared service.
158158

159-
@trigger_error('The "factory_simple" service is deprecated. You should stop using it, as it will be removed in the future.', E_USER_DEPRECATED);
159+
trigger_deprecation('', '', 'The "factory_simple" service is deprecated. You should stop using it, as it will be removed in the future.');
160160

161161
return new \SimpleFactoryClass('foo');
162162

‎src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9_compiled.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9_compiled.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ protected function getDecoratorServiceWithNameService()
210210
*/
211211
protected function getDeprecatedServiceService()
212212
{
213-
@trigger_error('The "deprecated_service" service is deprecated. You should stop using it, as it will be removed in the future.', E_USER_DEPRECATED);
213+
trigger_deprecation('', '', 'The "deprecated_service" service is deprecated. You should stop using it, as it will be removed in the future.');
214214

215215
return $this->services['deprecated_service'] = new \stdClass();
216216
}
@@ -404,7 +404,7 @@ protected function getTaggedIteratorService()
404404
*/
405405
protected function getFactorySimpleService()
406406
{
407-
@trigger_error('The "factory_simple" service is deprecated. You should stop using it, as it will be removed in the future.', E_USER_DEPRECATED);
407+
trigger_deprecation('', '', 'The "factory_simple" service is deprecated. You should stop using it, as it will be removed in the future.');
408408

409409
return new \SimpleFactoryClass('foo');
410410
}

‎src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9_inlined_factories.txt

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9_inlined_factories.txt
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ class ProjectServiceContainer extends Container
231231
*/
232232
protected function getDeprecatedServiceService()
233233
{
234-
@trigger_error('The "deprecated_service" service is deprecated. You should stop using it, as it will be removed in the future.', E_USER_DEPRECATED);
234+
trigger_deprecation('', '', 'The "deprecated_service" service is deprecated. You should stop using it, as it will be removed in the future.');
235235

236236
return $this->services['deprecated_service'] = new \stdClass();
237237
}
@@ -453,7 +453,7 @@ class ProjectServiceContainer extends Container
453453
*/
454454
protected function getFactorySimpleService()
455455
{
456-
@trigger_error('The "factory_simple" service is deprecated. You should stop using it, as it will be removed in the future.', E_USER_DEPRECATED);
456+
trigger_deprecation('', '', 'The "factory_simple" service is deprecated. You should stop using it, as it will be removed in the future.');
457457

458458
return new \SimpleFactoryClass('foo');
459459
}

‎src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_errored_definition.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_errored_definition.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ protected function getDecoratorServiceWithNameService()
210210
*/
211211
protected function getDeprecatedServiceService()
212212
{
213-
@trigger_error('The "deprecated_service" service is deprecated. You should stop using it, as it will be removed in the future.', E_USER_DEPRECATED);
213+
trigger_deprecation('', '', 'The "deprecated_service" service is deprecated. You should stop using it, as it will be removed in the future.');
214214

215215
return $this->services['deprecated_service'] = new \stdClass();
216216
}
@@ -404,7 +404,7 @@ protected function getTaggedIteratorService()
404404
*/
405405
protected function getFactorySimpleService()
406406
{
407-
@trigger_error('The "factory_simple" service is deprecated. You should stop using it, as it will be removed in the future.', E_USER_DEPRECATED);
407+
trigger_deprecation('', '', 'The "factory_simple" service is deprecated. You should stop using it, as it will be removed in the future.');
408408

409409
return new \SimpleFactoryClass('foo');
410410
}

‎src/Symfony/Component/DependencyInjection/composer.json

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/composer.json
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"require": {
1919
"php": "^7.2.5",
2020
"psr/container": "^1.0",
21+
"symfony/deprecation-contracts": "^2.1",
2122
"symfony/service-contracts": "^1.1.6|^2"
2223
},
2324
"require-dev": {

‎src/Symfony/Component/Dotenv/Dotenv.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Dotenv/Dotenv.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ final class Dotenv
4646
public function __construct($envKey = 'APP_ENV', string $debugKey = 'APP_DEBUG')
4747
{
4848
if (\in_array($envKey = (string) $envKey, ['1', ''], true)) {
49-
@trigger_error(sprintf('Passing a boolean to the constructor of "%s" is deprecated since Symfony 5.1, use "Dotenv::usePutenv()".', __CLASS__), E_USER_DEPRECATED);
49+
trigger_deprecation('symfony/dotenv', '5.1', 'Passing a boolean to the constructor of "%s" is deprecated, use "Dotenv::usePutenv()".', __CLASS__);
5050
$this->usePutenv = (bool) $envKey;
5151
$envKey = 'APP_ENV';
5252
}

‎src/Symfony/Component/Dotenv/composer.json

Copy file name to clipboardExpand all lines: src/Symfony/Component/Dotenv/composer.json
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
}
1717
],
1818
"require": {
19-
"php": "^7.2.5"
19+
"php": "^7.2.5",
20+
"symfony/deprecation-contracts": "^2.1"
2021
},
2122
"require-dev": {
2223
"symfony/process": "^4.4|^5.0"

‎src/Symfony/Component/EventDispatcher/LegacyEventDispatcherProxy.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/EventDispatcher/LegacyEventDispatcherProxy.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
1515

16-
@trigger_error(sprintf('%s is deprecated since Symfony 5.1, use the event dispatcher without the proxy.', LegacyEventDispatcherProxy::class), E_USER_DEPRECATED);
16+
trigger_deprecation('symfony/event-dispatcher', '5.1', '%s is deprecated, use the event dispatcher without the proxy.', LegacyEventDispatcherProxy::class);
1717

1818
/**
1919
* A helper class to provide BC/FC with the legacy signature of EventDispatcherInterface::dispatch().

‎src/Symfony/Component/EventDispatcher/composer.json

Copy file name to clipboardExpand all lines: src/Symfony/Component/EventDispatcher/composer.json
+1Lines 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/event-dispatcher-contracts": "^2"
2122
},
2223
"require-dev": {

‎src/Symfony/Component/Form/Extension/Core/Type/FormType.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Extension/Core/Type/FormType.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function buildForm(FormBuilderInterface $builder, array $options)
6161
}
6262

6363
if (!method_exists($builder, 'setIsEmptyCallback')) {
64-
@trigger_error(sprintf('Not implementing the "%s::setIsEmptyCallback()" method in "%s" is deprecated since Symfony 5.1.', FormConfigBuilderInterface::class, \get_class($builder)), E_USER_DEPRECATED);
64+
trigger_deprecation('symfony/form', '5.1', 'Not implementing the "%s::setIsEmptyCallback()" method in "%s" is deprecated.', FormConfigBuilderInterface::class, \get_class($builder));
6565

6666
return;
6767
}

‎src/Symfony/Component/Form/Form.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Form.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -727,7 +727,7 @@ public function isEmpty()
727727
}
728728

729729
if (!method_exists($this->config, 'getIsEmptyCallback')) {
730-
@trigger_error(sprintf('Not implementing the "%s::getIsEmptyCallback()" method in "%s" is deprecated since Symfony 5.1.', FormConfigInterface::class, \get_class($this->config)), E_USER_DEPRECATED);
730+
trigger_deprecation('symfony/form', '5.1', 'Not implementing the "%s::getIsEmptyCallback()" method in "%s" is deprecated.', FormConfigInterface::class, \get_class($this->config));
731731

732732
$isEmptyCallback = null;
733733
} else {

‎src/Symfony/Component/Form/composer.json

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/composer.json
+1Lines 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/event-dispatcher": "^4.4|^5.0",
2122
"symfony/intl": "^4.4|^5.0",
2223
"symfony/options-resolver": "^5.0",

‎src/Symfony/Component/HttpFoundation/JsonResponse.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpFoundation/JsonResponse.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public function __construct($data = null, int $status = 200, array $headers = []
6868
*/
6969
public static function create($data = null, int $status = 200, array $headers = [])
7070
{
71-
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 5.1; use __construct() instead.', __METHOD__), E_USER_DEPRECATED);
71+
trigger_deprecation('symfony/http-foundation', '5.1', 'The "%s()" method is deprecated, use "new %s()" instead.', __METHOD__, \get_called_class());
7272

7373
return new static($data, $status, $headers);
7474
}

‎src/Symfony/Component/HttpFoundation/RedirectResponse.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpFoundation/RedirectResponse.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public function __construct(string $url, int $status = 302, array $headers = [])
5858
*/
5959
public static function create($url = '', int $status = 302, array $headers = [])
6060
{
61-
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 5.1; use __construct() instead.', __METHOD__), E_USER_DEPRECATED);
61+
trigger_deprecation('symfony/http-foundation', '5.1', 'The "%s()" method is deprecated, use "new %s()" instead.', __METHOD__, \get_called_class());
6262

6363
return new static($url, $status, $headers);
6464
}

‎src/Symfony/Component/HttpFoundation/Response.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpFoundation/Response.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ public function __construct(?string $content = '', int $status = 200, array $hea
213213
*/
214214
public static function create(?string $content = '', int $status = 200, array $headers = [])
215215
{
216-
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 5.1; use __construct() instead.', __METHOD__), E_USER_DEPRECATED);
216+
trigger_deprecation('symfony/http-foundation', '5.1', 'The "%s()" method is deprecated, use "new %s()" instead.', __METHOD__, \get_called_class());
217217

218218
return new static($content, $status, $headers);
219219
}

‎src/Symfony/Component/HttpFoundation/StreamedResponse.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpFoundation/StreamedResponse.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function __construct(callable $callback = null, int $status = 200, array
5252
*/
5353
public static function create($callback = null, int $status = 200, array $headers = [])
5454
{
55-
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 5.1; use __construct() instead.', __METHOD__), E_USER_DEPRECATED);
55+
trigger_deprecation('symfony/http-foundation', '5.1', 'The "%s()" method is deprecated, use "new %s()" instead.', __METHOD__, \get_called_class());
5656

5757
return new static($callback, $status, $headers);
5858
}

‎src/Symfony/Component/HttpFoundation/composer.json

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpFoundation/composer.json
+1Lines 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/polyfill-mbstring": "~1.1"
2122
},
2223
"require-dev": {

‎src/Symfony/Component/Messenger/Bridge/Amqp/Transport/Connection.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Messenger/Bridge/Amqp/Transport/Connection.php
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ public static function fromDsn(string $dsn, array $options = [], AmqpFactory $am
220220
private static function validateOptions(array $options): void
221221
{
222222
if (0 < \count($invalidOptions = array_diff(array_keys($options), self::AVAILABLE_OPTIONS))) {
223-
@trigger_error(sprintf('Invalid option(s) "%s" passed to the AMQP Messenger transport. Passing invalid options is deprecated since Symfony 5.1.', implode('", "', $invalidOptions)), E_USER_DEPRECATED);
223+
trigger_deprecation('symfony/messenger', '5.1', 'Invalid option(s) "%s" passed to the AMQP Messenger transport. Passing invalid options is deprecated.', implode('", "', $invalidOptions));
224224
}
225225

226226
if (\is_array($options['queues'] ?? false)) {
@@ -230,14 +230,14 @@ private static function validateOptions(array $options): void
230230
}
231231

232232
if (0 < \count($invalidQueueOptions = array_diff(array_keys($queue), self::AVAILABLE_QUEUE_OPTIONS))) {
233-
@trigger_error(sprintf('Invalid queue option(s) "%s" passed to the AMQP Messenger transport. Passing invalid queue options is deprecated since Symfony 5.1.', implode('", "', $invalidQueueOptions)), E_USER_DEPRECATED);
233+
trigger_deprecation('symfony/messenger', '5.1', 'Invalid queue option(s) "%s" passed to the AMQP Messenger transport. Passing invalid queue options is deprecated.', implode('", "', $invalidQueueOptions));
234234
}
235235
}
236236
}
237237

238238
if (\is_array($options['exchange'] ?? false)
239239
&& 0 < \count($invalidExchangeOptions = array_diff(array_keys($options['exchange']), self::AVAILABLE_EXCHANGE_OPTIONS))) {
240-
@trigger_error(sprintf('Invalid exchange option(s) "%s" passed to the AMQP Messenger transport. Passing invalid exchange options is deprecated since Symfony 5.1.', implode('", "', $invalidExchangeOptions)), E_USER_DEPRECATED);
240+
trigger_deprecation('symfony/messenger', '5.1', 'Invalid exchange option(s) "%s" passed to the AMQP Messenger transport. Passing invalid exchange options is deprecated.', implode('", "', $invalidExchangeOptions));
241241
}
242242
}
243243

‎src/Symfony/Component/Messenger/Bridge/Redis/Transport/Connection.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Messenger/Bridge/Redis/Transport/Connection.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ private static function validateOptions(array $options): void
174174
$availableOptions[] = 'serializer';
175175

176176
if (0 < \count($invalidOptions = array_diff(array_keys($options), $availableOptions))) {
177-
@trigger_error(sprintf('Invalid option(s) "%s" passed to the Redis Messenger transport. Passing invalid options is deprecated since Symfony 5.1.', implode('", "', $invalidOptions)), E_USER_DEPRECATED);
177+
trigger_deprecation('symfony/messenger', '5.1', 'Invalid option(s) "%s" passed to the Redis Messenger transport. Passing invalid options is deprecated.', implode('", "', $invalidOptions));
178178
}
179179
}
180180

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.