Skip to content

[2.8][DependencyInjection] improve deprecation messages #15113

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 27, 2015

Conversation

xabbuh
Copy link
Member

@xabbuh xabbuh commented Jun 26, 2015

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.

Also include the service id in the deprecation message.
@xabbuh xabbuh changed the title [DependencyInjection] improve deprecation messages [2.8][DependencyInjection] improve deprecation messages Jun 26, 2015
@dosten
Copy link
Contributor

dosten commented Jun 26, 2015

IMO we should do the same with the synchronized tag. What do you think?

Edit: Sorry, #15112 do this.

@dosten
Copy link
Contributor

dosten commented Jun 26, 2015

👍

@nicolas-grekas
Copy link
Member

👍

@@ -162,7 +162,7 @@ private function parseDefinition(\DOMElement $service, $file)
$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);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why casting to string?

@fabpot
Copy link
Member

fabpot commented Jun 27, 2015

Thank you @xabbuh.

@fabpot fabpot merged commit d144dbb into symfony:2.8 Jun 27, 2015
fabpot added a commit that referenced this pull request Jun 27, 2015
…(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
@xabbuh xabbuh deleted the improve-deprecation-message-2.8 branch June 27, 2015 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants