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

[php-mezzio-ph] PHP 8 support #9445

Merged
merged 5 commits into from
May 21, 2021

Conversation

Articus
Copy link
Contributor

@Articus Articus commented May 10, 2021

Huge update for php-mezzio-ph generator:

  • minimal PHP version bump to 7,3 - PHP 7.2 end of life #9200
  • proper support for container data type - multidimensional arrays and maps are handled correctly now
  • custom CLI option "modern" to generate code using modern language syntax for PHP 8 projects
  • support for referenced query parameters and referenced query parameter schemas
  • removal of obsolete samples folder samples/openapi3/server/petstore/php-mezzio-ph

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 
    ./bin/generate-samples.sh
    ./bin/utils/export_docs_generators.sh
    
    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*.
    For Windows users, please run the script in Git BASH.
  • File the PR against the correct branch: master, 5.1.x, 6.0.x
  • If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.

cc @jebentier @dkarlovi @mandrean @jfastnacht @ackintosh @ybelenko @renepardon

Arthur Mogliev added 5 commits May 11, 2021 00:53
- proper container support for data types
- support for query parameter references and query parameter schema references
- dependency update (PHP 7.3+, PathHandler 0.7+, DataTransfer 0.5+)
…dern PHP syntax

- removed obsolete php-mezzio-ph samples in samples/openapi3/server/petstore/php-mezzio-ph
@wing328
Copy link
Member

wing328 commented May 21, 2021

Tested locally and can start a server without issues

$ php -S 0.0.0.0:8080 -t ./public
[Fri May 21 14:38:31 2021] PHP 7.4.3 Development Server (http://0.0.0.0:8080) started

@wing328
Copy link
Member

wing328 commented May 21, 2021

Some users may consider this as a breaking change and we may add a php-mezzio-ph-deprecated generator to keep them happy.

@wing328 wing328 merged commit ab6d661 into OpenAPITools:master May 21, 2021
@wing328 wing328 added this to the 5.2.0 milestone May 21, 2021
@Articus
Copy link
Contributor Author

Articus commented May 21, 2021

Thought about that :) But I believe it should be done next year after PHP 8.1 release. Currently there are three supported versions of PHP - 7.3 , 7.4 , 8.0 . By default (without modern option) php-mezzio-ph generates code that is compatible with them all (and even with 7.1 and 7.2 that are no longer supported). With modern option generated code heavily uses new features introduced in 8.0 and can no longer run on 7.* . So right now full PHP 8 support is an optional feature, not a breaking change.

@ybelenko
Copy link
Contributor

Some users may consider this as a breaking change and we may add a php-mezzio-ph-deprecated generator to keep them happy.

It's hard to say what we can consider breaking changes in server codegens. If I remember correct @jimschubert thinks that server generators cannot cause breaking changes at all because users generate fresh stubs during migration anyway.

.gitignore Show resolved Hide resolved
@ybelenko
Copy link
Contributor

@Articus thanks for clarifications I wasn't focused enough, didn't notice you've added two generators. That's not common codegen flow.

premiumitsolution pushed a commit to premiumitsolution/openapi-generator that referenced this pull request May 26, 2021
* Huge update for php-mezzio-ph generator:
- proper container support for data types
- support for query parameter references and query parameter schema references
- dependency update (PHP 7.3+, PathHandler 0.7+, DataTransfer 0.5+)

* Sample regeneration after rebasing for php-mezzio-ph

* - added custom CLI option for php-mezzio-ph to generate code using modern PHP syntax
- removed obsolete php-mezzio-ph samples in samples/openapi3/server/petstore/php-mezzio-ph

* - fixes for JavaDoc declarations that seems to break CI

* - fix for outdated sample file
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.

None yet

3 participants