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

Skip to content

[DependencyInjection] Deprecate unsupported attributes/elements for alias#17323

Closed
GuilhemN wants to merge 2 commits into
symfony:masterfrom
GuilhemN:ALIAS
Closed

[DependencyInjection] Deprecate unsupported attributes/elements for alias#17323
GuilhemN wants to merge 2 commits into
symfony:masterfrom
GuilhemN:ALIAS

Conversation

@GuilhemN
Copy link
Copy Markdown
Contributor

@GuilhemN GuilhemN commented Jan 9, 2016

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? yes
Tests pass? yes
Fixed tickets #17256
License MIT

Following #17133, this PR deprecates using unsupported keywords on alias definition.

For example the following examples will trigger deprecations:

<?xml version="1.0" encoding="utf-8"?>
<container>
  <services>
    <service id="bar" alias="foo" class="Foo">
        <tag name="foo.bar" />
    </service>
  </services>
</container>
services:
    bar:
        alias: foo
        parent: quz

@Taluu
Copy link
Copy Markdown
Contributor

Taluu commented Jan 10, 2016

The yaml test is not in the scope of this PR...

Anyway, I'm not sure we should cry if these attributees are set, they will be ignored anyway..

@GuilhemN
Copy link
Copy Markdown
Contributor Author

@Taluu the goal is the same as described in #17133: avoid mistakes and simplify debugging.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Any reason getAttribute() is used here instead of hasAttribute()?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No I didn't know this function

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'd improve the second sentence slightly in all these deprecation messages and say "The XmlFileLoader object will raise an exception in Symfony 4.0, instead of silently ignoring unsupported attributes.".

Currently the message says "will raise an exception instead" but it doesn't say instead of what.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

👍 updated.

@nicolas-grekas
Copy link
Copy Markdown
Member

👍
Status: reviewed

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

missing documentation for the $file parameter

@xabbuh
Copy link
Copy Markdown
Member

xabbuh commented Jan 14, 2016

I would remove "object" from "The YamlFileLoader object will [...]" (same for the XmlFileLoader messages).

Status: Needs work

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

There seem to be trailing witespaces.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Oops you're right

@xabbuh
Copy link
Copy Markdown
Member

xabbuh commented Jan 14, 2016

👍

Status: Reviewed

@GuilhemN
Copy link
Copy Markdown
Contributor Author

ping

@fabpot
Copy link
Copy Markdown
Member

fabpot commented Jan 16, 2016

Thank you @Ener-Getick.

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.

9 participants