swaggest / php-json-schema

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

php8.1 support broken #130

Closed jkowalleck closed 2 years ago

jkowalleck commented 2 years ago

Hello everybody,

I noticed, that this library is not working with the current php8.1rc out of the box.

issues i found so far:

PHP Fatal error:  During inheritance of ArrayAccess: Uncaught Return type of Swaggest\JsonSchema\Structure\ClassStructure::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice

/home/runner/work/cyclonedx-php-composer/cyclonedx-php-composer/vendor/swaggest/json-schema/src/MagicMapTrait.php:30
/home/runner/work/cyclonedx-php-composer/cyclonedx-php-composer/vendor/swaggest/json-schema/src/Structure/ClassStructure.php:5
/home/runner/work/cyclonedx-php-composer/cyclonedx-php-composer/vendor/swaggest/json-schema/src/JsonSchema.php:24
/home/runner/work/cyclonedx-php-composer/cyclonedx-php-composer/vendor/swaggest/json-schema/src/Schema.php:34

as of https://github.com/CycloneDX/cyclonedx-php-composer/runs/3623266170?check_suite_focus=true (see the "Install dependencies" step for details which version of which library was installed)

modified the CI/CT workflows, to get php 8.1 support tested: see #129 maybe this will help to identify issues.

vearutop commented 2 years ago

Thank you for raising this issue, please try v0.12.38, hopefully the issue should be gone.

jkowalleck commented 2 years ago

tested. seams to be fixed.

thanks :)