Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[DI] Remove unreachable code#25158
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
GwendolenLynch commentedNov 26, 2017
@nicolas-grekas I am scratching my head on all the test fails here, they pass locally under the same PHP versions. Hints welcome 😄 |
nicolas-grekas commentedNov 26, 2017
What's the use case? Can't you use an iterator instead? The downside is that this would be a Symfony specific syntax, whereas I'm aiming at making this function a PSR, so that I'd prefer handling only things that might be accepted by the FIG... |
GwendolenLynch commentedNov 26, 2017
Zero stress, happy to close off. In that case, doesn't it make this dead code then: symfony/src/Symfony/Component/DependencyInjection/Compiler/RegisterServiceSubscribersPass.php Lines 77 to 80 ine83b82b
… as the regex will only allow |
nicolas-grekas commentedNov 26, 2017
correct! let's remove that :) |
GwendolenLynch commentedNov 26, 2017
No worries, I'll rebase and change direction 👍 |
| foreach ($class::getSubscribedServices()as$key =>$type) { | ||
| if (!is_string($type) || !preg_match('/^\??[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*+(?:\\\\[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*+)*+$/',$type)) { | ||
| if (!is_string($type) || !preg_match('/^[\?!]?[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*+(?:\\\\[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*+)*+$/',$type)) { |
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.
should be reverted
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.
🤦♂️
fabpot commentedNov 26, 2017
Thank you @GawainLynch. |
This PR was merged into the 3.4 branch.Discussion----------[DI] Remove unreachable code| Q | A| ------------- | ---| Branch? | 3.4| Bug fix? | yes| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets || License | MIT| Doc PR |#24033 added the ability to ignore uninitialized references, but the regex above the conditional would lead to an `InvalidArgumentException` being thrown.Commits-------ced0857 Remove unreachable code
#24033 added the ability to ignore uninitialized references, but the regex above the conditional would lead to an
InvalidArgumentExceptionbeing thrown.