-
Notifications
You must be signed in to change notification settings - Fork 30
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
[Help/Contributor needed] Major release & refactoring for PHP8 support #41
base: master
Are you sure you want to change the base?
Conversation
be25d13
to
7f91825
Compare
536a9a6
to
8051011
Compare
e7dadae
to
a3d9c65
Compare
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 all the hard work. Great work! :)
* dropped support for PHP ^5.2 | ||
* dropped support for PHP 7.0 | ||
* dropped support for PHP 7.1 | ||
* dropped support for PHP 7.2 |
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.
I don't think breaking backward-compatibility in that regard is something reasonable.
The latest release is 1.2.2 in 2016, supporting the minimum PHP version 5.3. This means at least 8 years of BC. Your PR is trying to cut it down into 3 years, which IMO is not good.
Don't get me wrong, I don't say having 3-year compatibility is a bad idea. I mean, if we have something with 8-year compatibility and you want to make it 3, we should do it in many small steps, instead of one big step.
I think upgrading the minimum PHP version to 5.6 is a good idea. Or at the very least, we can make it 7.1.
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.
Why support a version of PHP not supported by PHP itself? The minimum supported version should be PHP 7.4. Otherwise you're talking about supporting PHP versions that have been EOL for years, and this is going to cause dependency hell as other packages drop support.
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.
Huge jumps could lag users behind. So instead of jumping to 7.4 in a sudden, we could move to 5.6, 7.2 and then 7.4, for example.
use Webmozart\Json\JsonDecoder; | ||
use Webmozart\Json\ValidationFailedException; |
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.
Loving the import statements being ordered. :)
/** | ||
* @expectedException \Webmozart\Json\ValidationFailedException | ||
*/ | ||
public function testEncodeFailsIfValidationFailsWithSchemaFile() |
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.
Smart merging of these kinds of tests.
Personally, on the |
^9.3
supports PHP 7.3, 7.4 and 8.0^8.5.12
supports PHP>=7.2
I can't figure how to add PHP 8 support alongside PHP 5 | 7.(0-2)
The idea is to make a new major release only for people using PHP >=7.3 by using PHPUnit
^9.3
But I imagine we can also use PHPUnit
8.5.12
for 7.2, 7.3, 7.4 and 8.0People still using PHP 5.x should stay on the v1.x release
Changes
src/InvalidSchemaException.php
src/JsonValidator.php
JsonValidator
withJsonSchema\Validator
Need check
InvalidSchemaException
InvalidSchemaException
seems not to be raised by default withJsonSchema\Validator
. I think we must explicitly use theConstraint::CHECK_MODE_EXCEPTIONS
for that (https://github.com/justinrainbow/json-schema#configuration-options)JsonSchema\Validator
? I've dropped that responsibility in the package for now. You can check the example bellow from the JsonSchema READMEhttps://github.com/justinrainbow/json-schema#basic-usage
Note
I stop working on this pull request.
I wanted to add support for PHP 8 as I've created an issue which has remained unanswered.
The thing is that this library is using a very old release of JsonSchema and it has not been upgraded since 2016. JsonSchema is now at its fifth major release.
Feel free to progress this work. I'm done for now and I'll stop be using this library in my projects.