[DependencyInjection] improve deprecation messages

Also include the service id in the deprecation message.
This commit is contained in:
Christian Flothmann 2015-06-26 16:37:18 +02:00
parent 93e69e4735
commit d144dbb733
2 changed files with 2 additions and 2 deletions

View File

@ -162,7 +162,7 @@ class XmlFileLoader extends FileLoader
$triggerDeprecation = 'request' !== (string) $service->getAttribute('id');
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);

View File

@ -169,7 +169,7 @@ class YamlFileLoader extends FileLoader
if (isset($service['scope'])) {
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);
}