Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 03e96d2

Browse files
committed
minor #15113 [2.8][DependencyInjection] improve deprecation messages (xabbuh)
This PR was merged into the 2.8 branch. Discussion ---------- [2.8][DependencyInjection] improve deprecation messages | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | Also include the service id in the deprecation message. Commits ------- d144dbb [DependencyInjection] improve deprecation messages
2 parents 93e69e4 + d144dbb commit 03e96d2

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ private function parseDefinition(\DOMElement $service, $file)
162162
$triggerDeprecation = 'request' !== (string) $service->getAttribute('id');
163163

164164
if ($triggerDeprecation) {
165-
@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);
165+
@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);
166166
}
167167

168168
$definition->setScope(XmlUtils::phpize($value), false);

src/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ private function parseDefinition($id, $service, $file)
169169

170170
if (isset($service['scope'])) {
171171
if ('request' !== $id) {
172-
@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);
172+
@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);
173173
}
174174
$definition->setScope($service['scope'], false);
175175
}

0 commit comments

Comments
 (0)