-
-
Notifications
You must be signed in to change notification settings - Fork 626
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
Instance methods? #15
Comments
That is understandable, and I am generally opposed to static methods myself, but in this case I thought an instance might be overkill. The class started with a single method - to load the file, and now has only two methods and will be at most 2 lines of code. Additionally, environment variables are global state, so in this case a class instance didn't really serve any real purpose. |
The instance methods could be wrapped by the static methods, thus maintaining the api but also allowing for decent mocking in a project without having to resort to an alias mock. I think that's probably the most compelling reason to reconsider the statics. |
is this fixed sufficiently in phpdotenv 2.x ? |
Yes, this is in v2.x and working well. Currently pending full release very soon. |
This is now in v2.0.0: https://github.com/vlucas/phpdotenv/releases/tag/v2.0.0 |
Another nice-to-have would be instance methods instead of, or in addition to, static methods. Some of us start twitching when we see
::
paired with$
or()
.The text was updated successfully, but these errors were encountered: