-
Notifications
You must be signed in to change notification settings - Fork 45
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
Update this library to a supported PHP version #32
Conversation
Also did some best-practice refactorings
Man this is amazing, thank you so much for this PR To be honest I haven't even looked at PHP code for a while, so I am not aware what the state of the art is, and which version should be supported or not. In general I think it's quite convenient to have back support for older versions, and if not possible, maybe include two versions with a tag for "legacy support". Because you may know how people just can't upgrade the PHP engine sometimes. Is there a way we can offer that? Or is PHP 7.4 a given for 99% of the projects that may use/need that lib? The code linting is also a nice touch, I am guessing you are using standard lint settings? If so, could you specify them either by including a settings file such as an editorfile, or in the README? Thanks again, I am looking forward to merge that :) If you want to become a maintainer there is also a spot for you as you may have guessed I am quite out of the loop on the PHP front (I am more of a JS guy now) |
Hi! Personally, I'd rather not support anything below PHP 7.1. PHP 7.4 was my choice for minimum version, since it introduced property type hints and if you're able to update to PHP 7.1, you might as well go to 7.4. A quick look at the usage statistics shows that 20% of installs use anything less PHP 7.4. And that's okay. Here's why: I just wanted to fix those. About the code linting: I use PhpStorm as an IDE to develop in PHP. It has great built-in tools and analyzers. For distributed linting, I'd recommend PHP-CS-Fixer and a Maintaining a project can be a lot of work. However, I'd be happy to review pull requests and respond to issues from time to time. |
Awesome thanks Then I'll branch out to Yes well there isn't so much usage for this lib actually (otherwise I would have run away / given it away a long time ago) Responding from time to time is basically what I do, so I'll add you as maintainer, it won't take you much time and it's always a nice touch on your github page should you ever look for a job ;) (not that we developers look for jobs too much...) If you can include the editorconfig file that'd be neat yes please, just in case someone is using a different IDE that usually helps keep PRs nicely formatted |
Good Job @ricardoboss! |
@kartsims you can add me as contributor on GitHub and packagist. I would be happy to tag a new version. |
@kartsims in case you want to release a new version, please tag it as |
Hi @ricardoboss thank you for the messages and sorry about the delay in my response, I'll include you as contributor |
Regarding Packagist, I signed in there (I had credentials) but no package on my profile. It seems that this person "owns" the package. |
Thanks @kartsims! It may be a wild guess, but could @nvashenko be their username on GitHub as well? |
hi @kartsims , @ricardoboss |
Hi @nvashenko! Thanks for replying so fast. Your approach seems to be right (composer/packagist#961). My packagist username is also |
@ricardoboss added you. |
@kartsims I recommend you set up auto-updating on packagist. That way I don't even need to be maintainer over there. |
Thanks @nvashenko my username is Regarding auto updating I am not sure how it works... is it something like that? |
I think you can follow this guide: https://packagist.org/about#how-to-update-packages |
OK it seems that it is now automagically auto updated... Since you added me there, and I connected my Github account, it is now working. Thanks guys 🙌 @ricardoboss I'll let you follow up on the PRs and issues, you should be able to do them now otherwise lmk |
Great lib!
In this PR, I added a lot of type-hints and updated the minimum PHP version to 7.4.
I also removed all deprecated usages of old PHP versions and implemented some best-practices. Most changes are return type-hints, parameter type-hints and casts.
One heads up: the
addPath
method can now returnnull
. In previous versions it would have thrown an exception, since it tried to call a method onnull
.Let me know what you think! If these changes are too much at once, I am happy to re-submit finer-grained PRs.