[DependencyInjection] improve deprecation messages
Also include the service id in the deprecation message.
This commit is contained in:
parent
93e69e4735
commit
d144dbb733
@ -162,7 +162,7 @@ class XmlFileLoader extends FileLoader
|
|||||||
$triggerDeprecation = 'request' !== (string) $service->getAttribute('id');
|
$triggerDeprecation = 'request' !== (string) $service->getAttribute('id');
|
||||||
|
|
||||||
if ($triggerDeprecation) {
|
if ($triggerDeprecation) {
|
||||||
@trigger_error(sprintf('The "scope" attribute in file "%s" is deprecated since version 2.8 and will be removed in 3.0.', $file), E_USER_DEPRECATED);
|
@trigger_error(sprintf('The "scope" attribute of service "%s" in file "%s" is deprecated since version 2.8 and will be removed in 3.0.', (string) $service->getAttribute('id'), $file), E_USER_DEPRECATED);
|
||||||
}
|
}
|
||||||
|
|
||||||
$definition->setScope(XmlUtils::phpize($value), false);
|
$definition->setScope(XmlUtils::phpize($value), false);
|
||||||
|
@ -169,7 +169,7 @@ class YamlFileLoader extends FileLoader
|
|||||||
|
|
||||||
if (isset($service['scope'])) {
|
if (isset($service['scope'])) {
|
||||||
if ('request' !== $id) {
|
if ('request' !== $id) {
|
||||||
@trigger_error(sprintf('The "scope" key in file "%s" is deprecated since version 2.8 and will be removed in 3.0.', $file), E_USER_DEPRECATED);
|
@trigger_error(sprintf('The "scope" key of service "%s" in file "%s" is deprecated since version 2.8 and will be removed in 3.0.', $id, $file), E_USER_DEPRECATED);
|
||||||
}
|
}
|
||||||
$definition->setScope($service['scope'], false);
|
$definition->setScope($service['scope'], false);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user