8000 [Routing] Fix XmlFileLoader exception message by voronkovich · Pull Request #23222 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Routing] Fix XmlFileLoader exception message #23222

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 19, 2017
Merged

[Routing] Fix XmlFileLoader exception message #23222

merged 1 commit into from
Jun 19, 2017

Conversation

voronkovich
Copy link
Contributor
Q A
Branch? 2.7
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
License MIT

When an XmlFileLoader encounters an unknown tag it throws an exception with message like Unknown tag "foo" used in file "bar". Expected "default", "requirement" or "option".. A proper message should be Unknown tag "foo" used in file "bar". Expected "default", "requirement", "option" or "condition".

@Nek-
Copy link
Contributor
Nek- commented Jun 19, 2017

Hello,

Thanks for your contribution!

Please fix your code using the fabbot fix:

$ curl http://fabbot.io/patch/symfony/symfony/23222/f6a94cb56fc544f66e39e0658143976c852a14bb/cs.diff | patch -p0

Then squash your commits so there is still only one commit.

@javiereguiluz
Copy link
Member

@Nek- your comment is correct ... but for Symfony repos we use a tool to merge PRs that squashes everything automatically. So there's no need to do that. Thanks!

@voronkovich
Copy link
Contributor Author

@Nek-, fabbot suggests to fix docblocks that I didn’t change:

--- src/Symfony/Component/Routing/Loader/XmlFileLoader.php	2017-06-18 19:04:58.715402348 +0000
+++ src/Symfony/Component/Routing/Loader/XmlFileLoader.php	2017-06-18 19:05:00.419350700 +0000
@@ -36,8 +36,8 @@
      *
      * @return RouteCollection A RouteCollection instance
      *
-     * @throws \InvalidArgumentException When the file cannot be loaded or when the XML cannot be
-     *                                   parsed because it does not validate against the scheme.
+     * @throws \InvalidArgumentException when the file cannot be loaded or when the XML cannot be
+     *                                   parsed because it does not validate against the scheme
      */
     public function load($file, $type = null)
     {
@@ -219,7 +219,7 @@
      * @param \DOMElement $node Element to parse that contains the configs
      * @param string      $path Full path of the XML file being processed
      *
-     * @return array An array with the defaults as first item, requirements as second and options as third.
+     * @return array an array with the defaults as first item, requirements as second and options as third
      *
      * @throws \InvalidArgumentException When the XML is invalid
      */

@fabpot
Copy link
Member
fabpot commented Jun 19, 2017

Thank you @voronkovich.

@fabpot fabpot merged commit f6a94cb into symfony:2.7 Jun 19, 2017
fabpot added a commit that referenced this pull request Jun 19, 2017
This PR was merged into the 2.7 branch.

Discussion
----------

[Routing] Fix XmlFileLoader exception message

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| License       | MIT

When an `XmlFileLoader` encounters an unknown tag it throws an exception with message like `Unknown tag "foo" used in file "bar". Expected "default", "requirement" or "option".`. A proper message should be `Unknown tag "foo" used in file "bar". Expected "default", "requirement", "option"  or "condition".`

Commits
-------

f6a94cb [Routing] Fix XmlFileLoader exception message
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.

5 participants
0