Skip to content
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

Suggest switching from getShortName to getName for reflection class to gain compatibility #292

Merged
merged 2 commits into from
Dec 27, 2022

Conversation

SupraSmooth
Copy link
Contributor

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() to getName() for the ReflectionClass created by the private method anotherTime() in the AbstractProvider.

We noticed that using getShortName() could result in a ProviderNotFoundException 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() or previous() methods from the AbstractProvider in your custom provider and see the application crash.

Greetings from Germany and keep contributing!

@stelgenhof
Copy link
Member

@SupraSmooth Thanks for spotting this! I added a review to your PR.

@stelgenhof stelgenhof added this to the 2.6 milestone Dec 27, 2022
@stelgenhof stelgenhof merged commit 0d8d061 into azuyalabs:develop Dec 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants