-
Notifications
You must be signed in to change notification settings - Fork 6
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
Add namespace Env
#7
Conversation
The reason for not using namespaces in this library is to bring support for PHP 5.2 (that was supported by WordPress sometime. But I'm agree that this is completely outdated and I'm ok with adding the namespace What I'm not fully convinced is about namespacing the function. The idea of having a function was precisely for convenience and to do not need to add a What do you think? |
If everything is to be namespaced, keeping the Re |
a1b34b8
to
dab7b5b
Compare
|
@tangrufus You meant |
edfc958
to
833cba0
Compare
You are correct. I need ☕ |
Thanks for this work, but I'm not fully confortable using my name as a namespace of a library. I use it as the vendor of the composer package, but I think the code should reflect the library functionality, not the author. So, I'd rather use |
Final allure, I believe using
PSR-12 uses
Laravel packages use
Let me know if you are not convinced with |
@tangrufus I agree in using a namespace but what I'm saying is that I don't like Some examples: https://github.com/oscarotero/middleland is registered in packagist as https://github.com/oscarotero/typofixer has the same approach. All these packages are independent, there's no a So I'd suggest to use And if you don't want to have a namespace different from vendor name, I can consider change the vendor name to What do you think? |
Understood. Changed namespace to |
Great, thank you! |
- Add namespace `Env` - Remove `Env::init()` - Remove `env()` - Bump minimum PHP requirement to v5.6 - Update TravisCI build matrix to build PHP 5.6~7.4 and nightly - Install phpunit via composer - Add `$ composer test`
Added |
Thanks! 👍 |
Thanks all! Any other planned feature for v2.0.0 tag? |
I think we can remove support for php5 (or even php 7.0). |
Ok, new version 2.0.0 released. |
Namespace
Env
is added tocomposer.json
since the first commit. However, theEnv
class lives under the global namespace.env/composer.json
Lines 24 to 27 in 4ab45ce
Goal: To avoid issues like roots/bedrock#515 and roots/bedrock#516
Note: This is a breaking change.
With the namespace, we can autoload
env_function.php
with composer so that we dont needEnv::init()
Using the namespace
OscarOtero\Env
might be a better choice - less chance colliding with other packages.