Skip to content

[PHP] map AnyType to mixed#6710

Merged
wing328 merged 1 commit intomasterfrom
php-any-type
Jun 21, 2020
Merged

[PHP] map AnyType to mixed#6710
wing328 merged 1 commit intomasterfrom
php-any-type

Conversation

@wing328
Copy link
Member

@wing328 wing328 commented Jun 18, 2020

To fix #6668

PR checklist

  • Read the contribution guidelines.
  • If contributing template-only or documentation-only changes which will change sample output, build the project beforehand.
  • Run the shell script ./bin/generate-samples.shto update all Petstore samples related to your fix. 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/config/java*. For Windows users, please run the script in Git BASH.
  • File the PR against the correct branch: master
  • Copy the technical committee to review the pull request if your PR is targeting a particular programming language.

cc @jebentier (2017/07), @dkarlovi (2017/07), @mandrean (2017/08), @jfastnacht (2017/09), @ackintosh (2017/09) ❤️, @ybelenko (2018/07), @renepardon (2018/12)

@ybelenko
Copy link
Contributor

ybelenko commented Jun 18, 2020

Are you sure it won't break anything? mixed is pseudotype which works only in doc block comments.

function foobar(mixed $var) {}
// crashes cause unknown mixed class
function foobar(): mixed {}
// crashes too

@wing328
Copy link
Member Author

wing328 commented Jun 18, 2020

    public function deletePetWithHttpInfo($pet_id, $api_key = null)

That's an example of the method signature in the PHP client. I don't see the type (mixed in the example you provided above) included in the method signature. I've not reviewed all auto-generated PHP code (e.g. from PHP Symfony server generator) though.

To answer your question, I'm aware mixed is used in the documentation only and I'm not sure if it will cause issues in our case. That's why I tagged the PHP technical committee for review.

If you've better suggestions on what AnyType should be mapped to, please feel free to suggest.

Copy link
Contributor

@ybelenko ybelenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't checked it locally with PHP generators, but I think there will be no syntax errors. I hope so 😄

@wing328 wing328 merged commit 177bd52 into master Jun 21, 2020
@wing328 wing328 deleted the php-any-type branch June 21, 2020 06:56
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.

[BUG] PHP unknown symbols

2 participants