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

StaticInstance class is probably defect #1

Open
schlessera opened this issue Oct 31, 2016 · 1 comment
Open

StaticInstance class is probably defect #1

schlessera opened this issue Oct 31, 2016 · 1 comment
Assignees
Labels

Comments

@schlessera
Copy link

The class StaticInstance does not do anything meaningful (and thus is misleading).

It has a static property $instance that is probably meant to store the instance so that it can be retrieved later on and that one instance is shared across all requests.

However, in the getInstance() method, that property is always overwritten by a new instance of the extending class, rendering it useless. So, each call to getInstance() will create a new instance instead of sharing the previous one.

The getInstance() is probably missing a check to only create a new instance when the $instance property has not been set yet.

@lucprincen lucprincen self-assigned this Nov 1, 2016
@lucprincen lucprincen added the bug label Nov 1, 2016
@lucprincen
Copy link
Member

Thanks for bringing this to my attention. IT is indeed missing that check. I'll look into it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants