Skip to content

[php] Follow PHP8.4 update: declared nullable parameters explicitly #20243

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

Merged

Conversation

77web
Copy link
Contributor

@77web 77web commented Dec 4, 2024

close #20241

PR checklist

  • Read the contribution guidelines.
  • Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community.
  • Run the following to build the project and update samples:
    ./mvnw clean package || exit
    ./bin/generate-samples.sh ./bin/configs/*.yaml || exit
    ./bin/utils/export_docs_generators.sh || exit
    
    (For Windows users, please run the script in Git BASH)
    Commit all changed files.
    This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
    These must match the expectations made by your contribution.
    You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example ./bin/generate-samples.sh bin/configs/java*.
    IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.
  • File the PR against the correct branch: master
  • If your PR is targeting a particular programming language, mention the technical committee members, so they are more likely to review the pull request.

@jebentier @dkarlovi @mandrean @jfastnacht @ybelenko @renepardon

@wing328
Copy link
Member

wing328 commented Dec 5, 2024

@77web thanks for the PR

I ran the petstore integration tests but got errors:

/mnt/c/Users/wing3/Code/openapi-generator/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php:1389
/mnt/c/Users/wing3/Code/openapi-generator/samples/client/petstore/php/OpenAPIClient-php/tests/ResponseTypesTest.php:115
.

15) OpenAPI\Client\ServerVariablesInOperationTest::testInvalidVariableValueInOperation
Failed asserting that exception of type "ParseError" matches expected exception "InvalidArgumentException". Message was: "syntax error, unexpected variable "$httpHeaders"" at
/mnt/c/Users/wing3/Code/openapi-generator/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php:411
/mnt/c/Users/wing3/Code/openapi-generator/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php:407
/mnt/c/Users/wing3/Code/openapi-generator/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php:218
/mnt/c/Users/wing3/Code/openapi-generator/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php:183
/mnt/c/Users/wing3/Code/openapi-generator/samples/client/petstore/php/OpenAPIClient-php/tests/ServerVariablesInOperationTest.php:56
.

ERRORS!
Tests: 222, Assertions: 105, Errors: 139, Failures: 15, Skipped: 15.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  4.709 s
[INFO] Finished at: 2024-12-05T13:10:39+08:00
[INFO] ------------------------------------------------------------------------

can you please take a look when you've time?

To run the tests, execute mvn integration-test in the folder samples/client/petstore/php/OpenAPIClient-php

you will need to run a local petstore server: https://github.com/OpenAPITools/openapi-generator/wiki/Integration-Tests

@77web
Copy link
Contributor Author

77web commented Dec 5, 2024

@wing328 Thanks, I've fixed that.

@wing328
Copy link
Member

wing328 commented Dec 6, 2024

good. now all tests passed

PHPUnit 9.6.19 by Sebastian Bergmann and contributors.

...............................................................  63 / 222 ( 28%)
............................................................... 126 / 222 ( 56%)
............................................................... 189 / 222 ( 85%)
.................................                               222 / 222 (100%)

Time: 00:01.325, Memory: 12.00 MB

OK (222 tests, 384 assertions)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  7.011 s
[INFO] Finished at: 2024-12-06T14:28:11+08:00
[INFO] ------------------------------------------------------------------------

@wing328 wing328 added this to the 7.11.0 milestone Dec 6, 2024
@wing328 wing328 merged commit 4743076 into OpenAPITools:master Dec 6, 2024
16 checks passed
@77web 77web deleted the php-php84-implicitly-nullable-deprecation branch December 6, 2024 06:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[REQ][php] Implicitly nullable parameter declarations deprecated in PHP8.4
2 participants