swaggest / php-json-schema

High definition PHP structures with JSON-schema based validation
MIT License
438 stars 50 forks source link

Drop unsupported PHP versions #155

Open simivar opened 1 year ago

simivar commented 1 year ago

Currently, the library supports PHP version >=5.4 which was released in 2012 and is no longer supported since 1st of March 2015, which is 8 years. Looking at the PHP: Supported Versions table the only actively supported one is PHP 8.1, which brings a lot of optimizations and new features. What do you think about changing the dependency to PHP 8.1? Would that be a viable contribution?

massadm commented 1 year ago

My vote for 7.4.33 support. PHP 8 is a major update and thus there breaking changes. Most of current projects cannot be able to use PHP 8 for years.

IMHO the project missed a method to get all the errors when validation fails. It would be great to have such an update in PHP 7.4 projects. Further migration to PHP 8 may be associated with improved performance and stability.

vearutop commented 1 year ago

Bumping the minimal supported PHP version makes sense if it brings benefits. For example, if it allows for a more performant syntax or is strictly necessary to work properly in the latest version of PHP or to improve maintenance costs.

Otherwise, it seems that would be a net negative change (potentially some ancient servers would stop working, and modern instances would continue working exactly the same, without a noticeable improvement).

Do you anticipate any practical benefits from the migration to modern syntax (and min version bump)?

robertbakker commented 5 months ago

I am also receiving a lot of notices, it could help resolve it:

Remaining indirect deprecation notices (16)

  1x: Method "ArrayAccess::offsetExists()" might add "bool" as a native return type declaration in the future. Do the same in implementation "Swaggest\JsonSchema\MagicMap" now to avoid errors or add an explicit @return annotation to suppress this message.
    1x in ClientTest::test from App\Tests\Unit\XXX

  1x: Method "ArrayAccess::offsetGet()" might add "mixed" as a native return type declaration in the future. Do the same in implementation "Swaggest\JsonSchema\MagicMap" now to avoid errors or add an explicit @return annotation to suppress this message.
    1x in ClientTest::test from App\Tests\Unit\XXX

  1x: Method "ArrayAccess::offsetSet()" might add "void" as a native return type declaration in the future. Do the same in implementation "Swaggest\JsonSchema\MagicMap" now to avoid errors or add an explicit @return annotation to suppress this message.
    1x in ClientTest::test from App\Tests\Unit\XXX

  1x: Method "ArrayAccess::offsetUnset()" might add "void" as a native return type declaration in the future. Do the same in implementation "Swaggest\JsonSchema\MagicMap" now to avoid errors or add an explicit @return annotation to suppress this message.
    1x in ClientTest::test from App\Tests\Unit\XXX

  1x: Method "JsonSerializable::jsonSerialize()" might add "mixed" as a native return type declaration in the future. Do the same in implementation "Swaggest\JsonSchema\MagicMap" now to avoid errors or add an explicit @return annotation to suppress this message.
    1x in ClientTest::test from App\Tests\Unit\XXX

  1x: Method "ArrayAccess::offsetExists()" might add "bool" as a native return type declaration in the future. Do the same in implementation "Swaggest\JsonSchema\Structure\ClassStructure" now to avoid errors or add an explicit @return annotation to suppress this message.
    1x in ClientTest::test from App\Tests\Unit\XXX

  1x: Method "ArrayAccess::offsetGet()" might add "mixed" as a native return type declaration in the future. Do the same in implementation "Swaggest\JsonSchema\Structure\ClassStructure" now to avoid errors or add an explicit @return annotation to suppress this message.
    1x in ClientTest::testExport from App\Tests\Unit\XXX

  1x: Method "ArrayAccess::offsetSet()" might add "void" as a native return type declaration in the future. Do the same in implementation "Swaggest\JsonSchema\Structure\ClassStructure" now to avoid errors or add an explicit @return annotation to suppress this message.
    1x in ClientTest::test from App\Tests\Unit\XXX

  1x: Method "ArrayAccess::offsetUnset()" might add "void" as a native return type declaration in the future. Do the same in implementation "Swaggest\JsonSchema\Structure\ClassStructure" now to avoid errors or add an explicit @return annotation to suppress this message.
    1x in ClientTest::test from App\Tests\Unit\XXX

  1x: Method "JsonSerializable::jsonSerialize()" might add "mixed" as a native return type declaration in the future. Do the same in implementation "Swaggest\JsonSchema\Structure\ObjectItem" now to avoid errors or add an explicit @return annotation to suppress this message.
    1x in ClientTest::test from App\Tests\Unit\XXX

  1x: Method "ArrayAccess::offsetExists()" might add "bool" as a native return type declaration in the future. Do the same in implementation "Swaggest\JsonSchema\Structure\ObjectItem" now to avoid errors or add an explicit @return annotation to suppress this message.
    1x in ClientTest::test from App\Tests\Unit\XXX

  1x: Method "ArrayAccess::offsetGet()" might add "mixed" as a native return type declaration in the future. Do the same in implementation "Swaggest\JsonSchema\Structure\ObjectItem" now to avoid errors or add an explicit @return annotation to suppress this message.
    1x in ClientTest::test from App\Tests\Unit\XXX

  1x: Method "ArrayAccess::offsetSet()" might add "void" as a native return type declaration in the future. Do the same in implementation "Swaggest\JsonSchema\Structure\ObjectItem" now to avoid errors or add an explicit @return annotation to suppress this message.
    1x in ClientTest::test from App\Tests\Unit\XXX

  1x: Method "ArrayAccess::offsetUnset()" might add "void" as a native return type declaration in the future. Do the same in implementation "Swaggest\JsonSchema\Structure\ObjectItem" now to avoid errors or add an explicit @return annotation to suppress this message.
    1x in ClientTest::test from App\Tests\Unit\XXX

  1x: Method "JsonSerializable::jsonSerialize()" might add "mixed" as a native return type declaration in the future. Do the same in implementation "Swaggest\JsonSchema\Constraint\Properties" now to avoid errors or add an explicit @return annotation to suppress this message.
    1x in ClientTest::test from App\Tests\Unit\XXX

  1x: Method "JsonSerializable::jsonSerialize()" might add "mixed" as a native return type declaration in the future. Do the same in implementation "Swaggest\JsonSchema\Wrapper" now to avoid errors or add an explicit @return annotation to suppress this message.
    1x in ClientTest::test from App\Tests\Unit\XXX