Skip to content
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

Incompatible with PHP 8.1 due to "justinrainbow/json-schema" #65

Open
MasonM opened this issue Nov 3, 2023 · 0 comments
Open

Incompatible with PHP 8.1 due to "justinrainbow/json-schema" #65

MasonM opened this issue Nov 3, 2023 · 0 comments

Comments

@MasonM
Copy link
Contributor

MasonM commented Nov 3, 2023

Running this under PHP 8.1 will give deprecation warnings, since 8.1 is now enforcing return type compatibility for internal classes (source):

[03-Nov-2023 20:09:50 UTC] PHP Fatal error:  During inheritance of Iterator: Uncaught Behat\Testwork\Call\Exception\CallErrorException: 8192: Return type of JsonSchema\Iterator\ObjectIterator::current() should either be compatible with Iterator::current(): mixed, or the
 #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /app/vendor/justinrainbow/json-schema/src/JsonSchema/Iterator/ObjectIterator.php line 42 in /app/vendor/behat/behat/src/Behat/Testwork/Call/Handler/RuntimeCallHandler.php:90
Stack trace:
#0 /app/vendor/justinrainbow/json-schema/src/JsonSchema/Iterator/ObjectIterator.php(17): Behat\Testwork\Call\Handler\RuntimeCallHandler->handleError(8192, 'Return type of ...', '/app/ven...', 42)
#1 /app/vendor/composer/ClassLoader.php(571): include('/app/ven...')
#2 /app/vendor/composer/ClassLoader.php(428): Composer\Autoload\includeFile('/app/ven...')
#3 /app/vendor/fr3d/swagger-assertions/src/JsonSchema/RefResolver.php(86): Composer\Autoload\ClassLoader->loadClass('JsonSchema\\Iter...')                                                                                                                             #4 /app/vendor/fr3d/swagger-assertions/src/JsonSchema/RefResolver.php(70): FR3D\SwaggerAssertions\JsonSchema\RefResolver->resolveSchemas(Object(stdClass), 'https://adobest...', Array)
#5 /app/vendor/fr3d/swagger-assertions/src/JsonSchema/RefResolver.php(54): FR3D\SwaggerAssertions\JsonSchema\RefResolver->resolveCached('https://adobest...', Array)
#6 /app/include/app/Swagger.php(110): FR3D\SwaggerAssertions\JsonSchema\RefResolver->resolve('https://adobest...')
#7 /app/tests/behat/context/ApiContext.php(858): app\Swagger::getSchemaManager()

There's a PR to fix this: jsonrainbow/json-schema#682

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant