Skip to content

[php-nextgen] Fix undefined variable $queryParams#24136

Open
wuchen90 wants to merge 1 commit into
OpenAPITools:masterfrom
wuchen90:fix-php-nextgen
Open

[php-nextgen] Fix undefined variable $queryParams#24136
wuchen90 wants to merge 1 commit into
OpenAPITools:masterfrom
wuchen90:fix-php-nextgen

Conversation

@wuchen90

@wuchen90 wuchen90 commented Jun 26, 2026

Copy link
Copy Markdown

$queryParams is used in the generated code below so this variable must exist in order to avoid undefined variable error.

PR checklist

  • Read the contribution guidelines.
  • 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 WSL)
    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.
  • If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.

Summary by cubic

Always initialize $queryParams in php-nextgen generated API methods to eliminate “undefined variable $queryParams” when endpoints have no query params. The template now sets it by default and samples are regenerated to match.

  • Bug Fixes
    • Remove the {{#hasQueryParams}} guard and unconditionally set $queryParams = []; in php-nextgen/api.mustache.
    • Regenerate samples for php-nextgen and php-nextgen-streaming (echo_api) and petstore php-nextgen so all endpoints include the $queryParams initialization.

Written for commit f1811a3. Summary will update on new commits.

Review in cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 7 files

Re-trigger cubic

@wuchen90

Copy link
Copy Markdown
Author

@jebentier @dkarlovi @mandrean @jfastnacht @ybelenko @renepardon
Friendly ping for review. Thanks.

@wing328

wing328 commented Jun 26, 2026

Copy link
Copy Markdown
Member

thanks for the PR

cc @coffeemakr @JulianVennen as well.

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.

2 participants