Suggest switching from getShortName to getName for reflection class to gain compatibility #292
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Firstly, thank you for this great library. Since this month is themed by the Hacktoberfest a few months ago, I found a little bug working with this library, that I would like to fix.
We used a Symfony application with a lot of custom business logic and had the need to create a custom holiday provider to handle some application specific edge cases. Since this custom provider was located in our code, our namespace was obviously different from the one used in this library.
With this PR, I suggest switching to from
getShortName()
togetName()
for the ReflectionClass created by the private methodanotherTime()
in theAbstractProvider
.We noticed that using
getShortName()
could result in aProviderNotFoundException
for some custom holiday providers, since the namespace is not fully qualified.You can reproduce this bug by creating a custom holiday provider in a test project, where the namespace of the custom holiday provider differs in any way from the one used by this library. Next implement the
next()
orprevious()
methods from theAbstractProvider
in your custom provider and see the application crash.Greetings from Germany and keep contributing!