-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Yaml] include file and line no in deprecation message #24357
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
Conversation
IMO we should still discuss whether we want to merge #24191 to improve the situation in 3.3 applications though. |
5a10a38
to
f618e43
Compare
$message .= ' in '.$this->filename; | ||
} | ||
|
||
$message .= ' on line '.($this->getRealCurrentLineNb() + 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if it makes sense to specify the line if we don't know the filename.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess it can be helpful if someone parses a big YAML file, but reads the file contents themselves (thus using Yaml::parse()
instead of Yaml::parseFile()
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we reverted that before because it cluttered deprecation logs, so same pov as fab here to me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At the time we did that we didn't have the filenames. Now we have them because internally we use parseFile()
instead of parse()
. So having line numbers without filenames just affects users using the YAML parser in their own code (and there they probably know the filenames).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And by the way, when using the lint command you will get the line numbers too now (you wouldn't before).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, fair enough
Thank you @xabbuh. |
… (xabbuh) This PR was merged into the 3.4 branch. Discussion ---------- [Yaml] include file and line no in deprecation message | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | Now that we know the filename being parsed we can improve deprecation messages which is especially useful when trying to find the DI config file that triggers a particular deprecation. Commits ------- f618e43 include file and line no in deprecation message
Now that we know the filename being parsed we can improve deprecation messages which is especially useful when trying to find the DI config file that triggers a particular deprecation.