-
Notifications
You must be signed in to change notification settings - Fork 47
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
Apply language level migrations and clean-ups #33
Conversation
Speaking of release 1.1 vs 2.0 - I stumbled upon this sentence in the RFC (https://www.rfc-editor.org/rfc/rfc7946#appendix-B.1):
The according classes could be removed for a 2.0 release, but 1.1 would have to keep them. What are your thoughts? |
3a68197
to
15a53cc
Compare
Ugh, I realize that this is quite much. If you prefer another way of me submitting these changes or if you think that's all not needed, please let me know 🙈 |
b51ebe7
to
0e0a1ec
Compare
@jeromegamez: Just wanted to let you know that I haven't forgotten about this PR. I just haven't had the time to take a look at it. There's definitely no need to split this up, as I realize that'd be a pretty tedious process given the commits all touching the same files. |
src/GeoJson/CoordinateReferenceSystem/CoordinateReferenceSystem.php
Outdated
Show resolved
Hide resolved
@jeromegamez: Thanks for all of the work on this PR, and apologies again for the delay in setting time aside to review this. I'll give you some time to address my feedback but if you don't get a chance (understandable) I will try to circle back next week, apply my own suggestions, and merge directly. |
I'll aim to take another look at this before the weekend and merge it down. Thanks very much for the quick follow-up on my late review! |
Thank you for wading through all the changes! When you merge the PR, will you do it as a single , squashed commit or as a rebase with all commits? If it's the latter, I would like to clean them up first by squashing some of them (if you don't mind the force push). |
I typically do squashing but I see that I did a rebase for your previous PR. I think that was because I manually added some of my own and ended up merging via the command line. Anyway, I'm happy to do a rebase here. That may prove more helpful down the line if we ever need to refer back to a logical change. Feel free to squash and force push as you like. |
… and change http schemas with https, while we're at it
f931387
to
8ed3b70
Compare
It should be clear that composer dependencies need to be installed in order to work on and test the library, so the `bootstrap.php` file can be deleted. Since USAGE.md has been merged into README.md, the `site` directory is not needed anymore.
8ed3b70
to
edfa221
Compare
Alright, I think I'm done with cleaning up the commits (it was mostly integrating your suggested changes in the respective commits), and this brought us from 21 commits down to 12, including the deprecation of the |
The phpcs.xml.dist and GitHub workflow files were copied and slightly adapted.
2cc1c1f
to
a2915ec
Compare
The composer docs have more information about the I think the Slevomat is considered a plugin because it's type is |
* Constructor. | ||
* | ||
* @param float[] $bounds | ||
* @param array<float|int> $bounds |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for catching this. I see it agrees with "BoundingBox values must be integers or floats" below.
"config": { | ||
"allow-plugins": { | ||
"dealerdirect/phpcodesniffer-composer-installer": true | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just noticed this. Is this actually required for anything? I haven't come across this before and we don't use in mongo-php-library.
Looking at phpcs.xml.dist
, I only see references to the standard rules that ship with phpcs and Slevomat, which we explicitly require above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The composer docs have more information about the allow-plugins
directive at https://getcomposer.org/doc/06-config.md#allow-plugins
I think the Slevomat is considered a plugin because it's type is phpcodesniffer-standard
instead of library
, but I'm not 100% sure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. I'll clone this later tonight and try to run phpcs
without this plugin. If all goes well (and Slevomat rules are checked), I'll see if this can be removed. Otherwise, I'll keep it in.
Either way, I'll expect to have this PR merged Thursday. Thanks again!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Testing out the PR locally, I noticed this wasn't required to run phpcs
; however, I read up further on the Composer 2.2 changes and the PHPCSStandards/composer-installer README and now understand this is a forward-thinking change to ensure Slevomat is properly installed after the new security rules take effect in July.
LGTM.
Hey there 👋,
as promised (threatened 😅), here's my follow-up PR. Since we can now expect to be on at least PHP 7.4 and PHPUnit 9.5, there are some improvements that can be applied.
I tried to be as atomic as possible, with each commit message describing what it is about, but I think some of the changes warrant a little more context:
func_get_args()
anymore \o/Feature
is expected to be a JSON string or a number (https://www.rfc-editor.org/rfc/rfc7946#section-3.2), so I added a check for this. This would be a breaking change, so if you're targeting a 1.1 release instead of a 2.0 release, I can remove the check again.GeoJson::unserialize()
method is not strictly part of the language level migration, but it was the only method that prevented a 100% code coverage and even if its importance can be disputed, I still think that it's a nice metric 😅array<...>
notation in DocBlocks is used to avoid consecutive[][][]
s and to make it a little bit easier to make out the supported types - especially for the nested ones. The changes should enable IDEs like PHPStorm to provide autocompletion and Static Code Analysis Tools like PHPStan to parse them.Closes #21
Closes #22
Closes #30