Skip to content

[php-nextgen]: Fix offsetGet/offsetExists/offsetSet parameter#23288

Open
coffeemakr wants to merge 1 commit intoOpenAPITools:masterfrom
coffeemakr:features/fix-set-offset-param-type
Open

[php-nextgen]: Fix offsetGet/offsetExists/offsetSet parameter#23288
coffeemakr wants to merge 1 commit intoOpenAPITools:masterfrom
coffeemakr:features/fix-set-offset-param-type

Conversation

@coffeemakr
Copy link

@coffeemakr coffeemakr commented Mar 19, 2026

The parameter is defined as integer. However the offset on the container is probably a string in most of the time. This fix is very similar to #21583 for php.

@jebentier @dkarlovi @mandrean @jfastnacht (2017/09) @ybelenko @renepardon

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 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.
  • File the PR against the correct branch: master (upcoming 7.x.0 minor release - breaking changes with fallbacks), 8.0.x (breaking changes without fallbacks)
  • If your PR solves a reported issue, reference it using GitHub's linking syntax (e.g., having "fixes #123" present in the PR description)
  • 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

Fixes ArrayAccess typing in php-nextgen models so offsets accept strings and offsetGet can return null. Regenerates affected php-nextgen and php-nextgen-streaming PHP samples.

  • Bug Fixes
    • Update phpdoc for offsetExists, offsetGet, offsetSet, and offsetUnset to accept integer|string offsets; allow null for offsetSet.
    • Make offsetGet return type nullable and return null when the key is missing.

Written for commit 454b199. Summary will update on new commits.

Copy link
Contributor

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

Choose a reason for hiding this comment

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

40 issues found across 69 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="samples/client/echo_api/php-nextgen-streaming/src/Model/Tag.php">

<violation number="1" location="samples/client/echo_api/php-nextgen-streaming/src/Model/Tag.php:371">
P0: `offsetGet` declares invalid return type `?mixed`; PHP forbids nullable `mixed`, causing fatal compile/load failure.</violation>
</file>

<file name="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/User.php">

<violation number="1" location="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/User.php:574">
P0: Invalid return type `?mixed` causes a PHP fatal parse error; `mixed` cannot be nullable.</violation>
</file>

<file name="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/EnumArrays.php">

<violation number="1" location="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/EnumArrays.php:428">
P1: Invalid PHP return type `?mixed` in `offsetGet`; `mixed` cannot be nullable-prefixed and can break class loading with a fatal error.</violation>
</file>

<file name="samples/client/echo_api/php-nextgen/src/Model/TestFormObjectMultipartRequestMarker.php">

<violation number="1" location="samples/client/echo_api/php-nextgen/src/Model/TestFormObjectMultipartRequestMarker.php:337">
P1: `offsetGet` declares invalid return type `?mixed`; in PHP `mixed` already includes `null`, so this causes a compile-time fatal error.</violation>
</file>

<file name="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/OuterObjectWithEnumProperty.php">

<violation number="1" location="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/OuterObjectWithEnumProperty.php:339">
P1: `offsetGet` uses invalid return type `?mixed`; in PHP this is a fatal type declaration error because `mixed` already includes `null`.</violation>
</file>

<file name="samples/client/echo_api/php-nextgen-streaming/src/Model/Pet.php">

<violation number="1" location="samples/client/echo_api/php-nextgen-streaming/src/Model/Pet.php:549">
P1: `offsetGet` declares invalid PHP return type `?mixed`; nullable `mixed` is forbidden and can cause fatal class-load errors.</violation>
</file>

<file name="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/MixedPropertiesAndAdditionalPropertiesClass.php">

<violation number="1" location="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/MixedPropertiesAndAdditionalPropertiesClass.php:404">
P1: `offsetGet` uses invalid return type `?mixed`; `mixed` cannot be nullable in PHP and can cause class load/compile failure.</violation>
</file>

<file name="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/Capitalization.php">

<violation number="1" location="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/Capitalization.php:506">
P1: Invalid PHP type declaration `?mixed` causes fatal error because `mixed` already includes `null`.</violation>
</file>

<file name="samples/client/echo_api/php-nextgen/src/Model/DefaultValue.php">

<violation number="1" location="samples/client/echo_api/php-nextgen/src/Model/DefaultValue.php:623">
P1: Invalid PHP return type `?mixed` is used in `offsetGet`; `mixed` already includes `null`, so this can cause a fatal type declaration error.</violation>
</file>

<file name="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/ChildWithNullable.php">

<violation number="1" location="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/ChildWithNullable.php:326">
P1: `offsetGet` uses invalid PHP return type `?mixed`; this can cause a fatal type declaration error when loading the class.</violation>
</file>

<file name="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/Foo.php">

<violation number="1" location="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/Foo.php:336">
P1: `offsetGet` uses invalid return type `?mixed`; this breaks PHP type declarations and can fatally fail class loading.</violation>
</file>

<file name="samples/client/echo_api/php-nextgen-streaming/src/Model/NumberPropertiesOnly.php">

<violation number="1" location="samples/client/echo_api/php-nextgen-streaming/src/Model/NumberPropertiesOnly.php:421">
P1: `offsetGet` declares an invalid PHP return type `?mixed`; `mixed` is already nullable and this can trigger a fatal error when the class is loaded.</violation>
</file>

<file name="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/FooGetDefaultResponse.php">

<violation number="1" location="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/FooGetDefaultResponse.php:336">
P1: `?mixed` is an invalid PHP type declaration; `mixed` already includes `null`, so this method signature can break class loading.</violation>
</file>

<file name="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/HealthCheckResult.php">

<violation number="1" location="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/HealthCheckResult.php:344">
P1: `offsetGet` uses invalid return type `?mixed`; PHP forbids nullable `mixed`, causing fatal class load failure.</violation>
</file>

<file name="samples/client/echo_api/php-nextgen/src/Model/NumberPropertiesOnly.php">

<violation number="1" location="samples/client/echo_api/php-nextgen/src/Model/NumberPropertiesOnly.php:421">
P1: `?mixed` is an invalid PHP type declaration; `mixed` already includes `null`, so this method signature can cause a fatal error when the class is loaded.</violation>
</file>

<file name="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/Category.php">

<violation number="1" location="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/Category.php:373">
P1: `offsetGet` uses invalid PHP type `?mixed`; this can trigger a fatal error when the class is loaded.</violation>
</file>

<file name="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/FakeBigDecimalMap200Response.php">

<violation number="1" location="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/FakeBigDecimalMap200Response.php:370">
P1: `offsetGet` uses invalid return type `?mixed`; nullable `mixed` is not allowed in PHP and can cause fatal compile/load errors.</violation>
</file>

<file name="samples/client/echo_api/php-nextgen/src/Model/Category.php">

<violation number="1" location="samples/client/echo_api/php-nextgen/src/Model/Category.php:371">
P1: `offsetGet` uses invalid return type `?mixed`; `mixed` already includes `null`, so this declaration causes a fatal type error.</violation>
</file>

<file name="samples/client/echo_api/php-nextgen-streaming/src/Model/TestFormObjectMultipartRequestMarker.php">

<violation number="1" location="samples/client/echo_api/php-nextgen-streaming/src/Model/TestFormObjectMultipartRequestMarker.php:337">
P1: Invalid PHP return type `?mixed` causes fatal type declaration error; use `mixed` instead.</violation>
</file>

<file name="samples/client/echo_api/php-nextgen-streaming/src/Model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.php">

<violation number="1" location="samples/client/echo_api/php-nextgen-streaming/src/Model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.php:439">
P1: Invalid return type `?mixed` is used for `offsetGet`; `mixed` already includes `null`, so this can trigger a PHP type declaration/fatal error.</violation>
</file>

<file name="samples/client/echo_api/php-nextgen/src/Model/Query.php">

<violation number="1" location="samples/client/echo_api/php-nextgen/src/Model/Query.php:397">
P1: Invalid PHP return type `?mixed` will cause a fatal error; `mixed` must be used standalone.</violation>
</file>

<file name="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/MapTest.php">

<violation number="1" location="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/MapTest.php:462">
P1: Invalid PHP type declaration `?mixed` is used; nullable `mixed` is forbidden and can cause a fatal compile-time error.</violation>
</file>

<file name="samples/client/echo_api/php-nextgen-streaming/src/Model/Query.php">

<violation number="1" location="samples/client/echo_api/php-nextgen-streaming/src/Model/Query.php:397">
P1: Invalid PHP return type `?mixed` is used; `mixed` cannot be nullable and this can cause class load/compile failure.</violation>
</file>

<file name="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/Cat.php">

<violation number="1" location="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/Cat.php:326">
P1: `offsetGet` uses invalid `?mixed` return type; `mixed` is already nullable in PHP, so this can cause fatal class loading errors.</violation>
</file>

<file name="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/Pet.php">

<violation number="1" location="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/Pet.php:550">
P1: The new `offsetGet` signature uses invalid PHP type `?mixed`; `mixed` already includes `null`, so this can trigger a fatal compile/parse error.</violation>
</file>

<file name="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/HasOnlyReadOnly.php">

<violation number="1" location="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/HasOnlyReadOnly.php:370">
P1: Invalid PHP return type `?mixed` causes fatal error when loading the class; use `mixed` instead.</violation>
</file>

<file name="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/ApiResponse.php">

<violation number="1" location="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/ApiResponse.php:404">
P1: `offsetGet` declares invalid return type `?mixed`; this causes a fatal type error when loading the class.</violation>
</file>

<file name="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/OuterComposite.php">

<violation number="1" location="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/OuterComposite.php:404">
P1: Invalid PHP type declaration: `?mixed` is not allowed; use `mixed` instead.</violation>
</file>

<file name="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/Animal.php">

<violation number="1" location="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/Animal.php:378">
P1: `offsetGet` declares invalid return type `?mixed`; nullable `mixed` is not allowed in PHP and can cause fatal class loading errors.</violation>
</file>

<file name="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/ReadOnlyFirst.php">

<violation number="1" location="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/ReadOnlyFirst.php:370">
P1: Invalid PHP type declaration `?mixed` on `offsetGet` can cause fatal compile/load errors.</violation>
</file>

<file name="samples/client/echo_api/php-nextgen-streaming/src/Model/DefaultValue.php">

<violation number="1" location="samples/client/echo_api/php-nextgen-streaming/src/Model/DefaultValue.php:623">
P1: `offsetGet` uses invalid return type `?mixed`; `mixed` cannot be nullable in PHP, causing a fatal type declaration error.</violation>
</file>

<file name="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/ParentWithNullable.php">

<violation number="1" location="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/ParentWithNullable.php:412">
P1: `offsetGet` is declared with invalid return type `?mixed`; `mixed` already includes `null` in PHP, so this can cause a fatal type declaration error.</violation>
</file>

<file name="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/ObjectWithDeprecatedFields.php">

<violation number="1" location="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/ObjectWithDeprecatedFields.php:444">
P1: Invalid PHP return type `?mixed` causes fatal class-loading failure; `mixed` cannot be nullable.</violation>
</file>

<file name="samples/client/echo_api/php-nextgen-streaming/src/Model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.php">

<violation number="1" location="samples/client/echo_api/php-nextgen-streaming/src/Model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.php:337">
P1: Invalid PHP return type `?mixed` is used; `mixed` cannot be nullable and can trigger fatal class loading/type declaration errors.</violation>
</file>

<file name="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/ErrorResponse.php">

<violation number="1" location="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/ErrorResponse.php:370">
P1: `offsetGet` uses invalid nullable `mixed` return type (`?mixed`), which is disallowed in PHP and can break class loading.</violation>
</file>

<file name="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/Order.php">

<violation number="1" location="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/Order.php:542">
P1: Invalid PHP return type `?mixed` is used; `mixed` already includes `null`, so this declaration can cause a fatal class-loading error.</violation>
</file>

<file name="modules/openapi-generator/src/main/resources/php-nextgen/model_generic.mustache">

<violation number="1" location="modules/openapi-generator/src/main/resources/php-nextgen/model_generic.mustache:507">
P1: `offsetGet` uses invalid return type `?mixed`; generated PHP code may fail with a fatal compile error.</violation>
</file>

<file name="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/TestInlineFreeformAdditionalPropertiesRequest.php">

<violation number="1" location="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/TestInlineFreeformAdditionalPropertiesRequest.php:336">
P1: Invalid PHP type declaration `?mixed` in `offsetGet` can cause fatal parse/load failure.</violation>
</file>

<file name="samples/client/echo_api/php-nextgen-streaming/src/Model/Bird.php">

<violation number="1" location="samples/client/echo_api/php-nextgen-streaming/src/Model/Bird.php:371">
P1: `offsetGet` uses invalid PHP return type `?mixed`; nullable `mixed` is forbidden and can trigger a fatal error when loading the class.</violation>
</file>

<file name="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/Dog.php">

<violation number="1" location="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/Dog.php:326">
P1: Invalid `?mixed` return type in `offsetGet`; `mixed` cannot be nullable and may cause fatal load-time errors.</violation>
</file>

Since this is your first cubic review, here's how it works:

  • cubic automatically reviews your code and comments on bugs and improvements
  • Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
  • Add one-off context when rerunning by tagging @cubic-dev-ai with guidance or docs links (including llms.txt)
  • Ask questions if you need clarification on any suggestion

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Copy link
Contributor

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

Choose a reason for hiding this comment

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

40 issues found across 69 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="samples/client/echo_api/php-nextgen-streaming/src/Model/Tag.php">

<violation number="1" location="samples/client/echo_api/php-nextgen-streaming/src/Model/Tag.php:371">
P0: `offsetGet` declares invalid return type `?mixed`; PHP forbids nullable `mixed`, causing fatal compile/load failure.</violation>
</file>

<file name="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/User.php">

<violation number="1" location="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/User.php:574">
P0: Invalid return type `?mixed` causes a PHP fatal parse error; `mixed` cannot be nullable.</violation>
</file>

<file name="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/EnumArrays.php">

<violation number="1" location="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/EnumArrays.php:428">
P1: Invalid PHP return type `?mixed` in `offsetGet`; `mixed` cannot be nullable-prefixed and can break class loading with a fatal error.</violation>
</file>

<file name="samples/client/echo_api/php-nextgen/src/Model/TestFormObjectMultipartRequestMarker.php">

<violation number="1" location="samples/client/echo_api/php-nextgen/src/Model/TestFormObjectMultipartRequestMarker.php:337">
P1: `offsetGet` declares invalid return type `?mixed`; in PHP `mixed` already includes `null`, so this causes a compile-time fatal error.</violation>
</file>

<file name="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/OuterObjectWithEnumProperty.php">

<violation number="1" location="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/OuterObjectWithEnumProperty.php:339">
P1: `offsetGet` uses invalid return type `?mixed`; in PHP this is a fatal type declaration error because `mixed` already includes `null`.</violation>
</file>

<file name="samples/client/echo_api/php-nextgen-streaming/src/Model/Pet.php">

<violation number="1" location="samples/client/echo_api/php-nextgen-streaming/src/Model/Pet.php:549">
P1: `offsetGet` declares invalid PHP return type `?mixed`; nullable `mixed` is forbidden and can cause fatal class-load errors.</violation>
</file>

<file name="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/MixedPropertiesAndAdditionalPropertiesClass.php">

<violation number="1" location="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/MixedPropertiesAndAdditionalPropertiesClass.php:404">
P1: `offsetGet` uses invalid return type `?mixed`; `mixed` cannot be nullable in PHP and can cause class load/compile failure.</violation>
</file>

<file name="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/Capitalization.php">

<violation number="1" location="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/Capitalization.php:506">
P1: Invalid PHP type declaration `?mixed` causes fatal error because `mixed` already includes `null`.</violation>
</file>

<file name="samples/client/echo_api/php-nextgen/src/Model/DefaultValue.php">

<violation number="1" location="samples/client/echo_api/php-nextgen/src/Model/DefaultValue.php:623">
P1: Invalid PHP return type `?mixed` is used in `offsetGet`; `mixed` already includes `null`, so this can cause a fatal type declaration error.</violation>
</file>

<file name="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/ChildWithNullable.php">

<violation number="1" location="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/ChildWithNullable.php:326">
P1: `offsetGet` uses invalid PHP return type `?mixed`; this can cause a fatal type declaration error when loading the class.</violation>
</file>

<file name="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/Foo.php">

<violation number="1" location="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/Foo.php:336">
P1: `offsetGet` uses invalid return type `?mixed`; this breaks PHP type declarations and can fatally fail class loading.</violation>
</file>

<file name="samples/client/echo_api/php-nextgen-streaming/src/Model/NumberPropertiesOnly.php">

<violation number="1" location="samples/client/echo_api/php-nextgen-streaming/src/Model/NumberPropertiesOnly.php:421">
P1: `offsetGet` declares an invalid PHP return type `?mixed`; `mixed` is already nullable and this can trigger a fatal error when the class is loaded.</violation>
</file>

<file name="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/FooGetDefaultResponse.php">

<violation number="1" location="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/FooGetDefaultResponse.php:336">
P1: `?mixed` is an invalid PHP type declaration; `mixed` already includes `null`, so this method signature can break class loading.</violation>
</file>

<file name="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/HealthCheckResult.php">

<violation number="1" location="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/HealthCheckResult.php:344">
P1: `offsetGet` uses invalid return type `?mixed`; PHP forbids nullable `mixed`, causing fatal class load failure.</violation>
</file>

<file name="samples/client/echo_api/php-nextgen/src/Model/NumberPropertiesOnly.php">

<violation number="1" location="samples/client/echo_api/php-nextgen/src/Model/NumberPropertiesOnly.php:421">
P1: `?mixed` is an invalid PHP type declaration; `mixed` already includes `null`, so this method signature can cause a fatal error when the class is loaded.</violation>
</file>

<file name="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/Category.php">

<violation number="1" location="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/Category.php:373">
P1: `offsetGet` uses invalid PHP type `?mixed`; this can trigger a fatal error when the class is loaded.</violation>
</file>

<file name="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/FakeBigDecimalMap200Response.php">

<violation number="1" location="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/FakeBigDecimalMap200Response.php:370">
P1: `offsetGet` uses invalid return type `?mixed`; nullable `mixed` is not allowed in PHP and can cause fatal compile/load errors.</violation>
</file>

<file name="samples/client/echo_api/php-nextgen/src/Model/Category.php">

<violation number="1" location="samples/client/echo_api/php-nextgen/src/Model/Category.php:371">
P1: `offsetGet` uses invalid return type `?mixed`; `mixed` already includes `null`, so this declaration causes a fatal type error.</violation>
</file>

<file name="samples/client/echo_api/php-nextgen-streaming/src/Model/TestFormObjectMultipartRequestMarker.php">

<violation number="1" location="samples/client/echo_api/php-nextgen-streaming/src/Model/TestFormObjectMultipartRequestMarker.php:337">
P1: Invalid PHP return type `?mixed` causes fatal type declaration error; use `mixed` instead.</violation>
</file>

<file name="samples/client/echo_api/php-nextgen-streaming/src/Model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.php">

<violation number="1" location="samples/client/echo_api/php-nextgen-streaming/src/Model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.php:439">
P1: Invalid return type `?mixed` is used for `offsetGet`; `mixed` already includes `null`, so this can trigger a PHP type declaration/fatal error.</violation>
</file>

<file name="samples/client/echo_api/php-nextgen/src/Model/Query.php">

<violation number="1" location="samples/client/echo_api/php-nextgen/src/Model/Query.php:397">
P1: Invalid PHP return type `?mixed` will cause a fatal error; `mixed` must be used standalone.</violation>
</file>

<file name="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/MapTest.php">

<violation number="1" location="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/MapTest.php:462">
P1: Invalid PHP type declaration `?mixed` is used; nullable `mixed` is forbidden and can cause a fatal compile-time error.</violation>
</file>

<file name="samples/client/echo_api/php-nextgen-streaming/src/Model/Query.php">

<violation number="1" location="samples/client/echo_api/php-nextgen-streaming/src/Model/Query.php:397">
P1: Invalid PHP return type `?mixed` is used; `mixed` cannot be nullable and this can cause class load/compile failure.</violation>
</file>

<file name="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/Cat.php">

<violation number="1" location="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/Cat.php:326">
P1: `offsetGet` uses invalid `?mixed` return type; `mixed` is already nullable in PHP, so this can cause fatal class loading errors.</violation>
</file>

<file name="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/Pet.php">

<violation number="1" location="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/Pet.php:550">
P1: The new `offsetGet` signature uses invalid PHP type `?mixed`; `mixed` already includes `null`, so this can trigger a fatal compile/parse error.</violation>
</file>

<file name="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/HasOnlyReadOnly.php">

<violation number="1" location="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/HasOnlyReadOnly.php:370">
P1: Invalid PHP return type `?mixed` causes fatal error when loading the class; use `mixed` instead.</violation>
</file>

<file name="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/ApiResponse.php">

<violation number="1" location="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/ApiResponse.php:404">
P1: `offsetGet` declares invalid return type `?mixed`; this causes a fatal type error when loading the class.</violation>
</file>

<file name="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/OuterComposite.php">

<violation number="1" location="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/OuterComposite.php:404">
P1: Invalid PHP type declaration: `?mixed` is not allowed; use `mixed` instead.</violation>
</file>

<file name="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/Animal.php">

<violation number="1" location="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/Animal.php:378">
P1: `offsetGet` declares invalid return type `?mixed`; nullable `mixed` is not allowed in PHP and can cause fatal class loading errors.</violation>
</file>

<file name="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/ReadOnlyFirst.php">

<violation number="1" location="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/ReadOnlyFirst.php:370">
P1: Invalid PHP type declaration `?mixed` on `offsetGet` can cause fatal compile/load errors.</violation>
</file>

<file name="samples/client/echo_api/php-nextgen-streaming/src/Model/DefaultValue.php">

<violation number="1" location="samples/client/echo_api/php-nextgen-streaming/src/Model/DefaultValue.php:623">
P1: `offsetGet` uses invalid return type `?mixed`; `mixed` cannot be nullable in PHP, causing a fatal type declaration error.</violation>
</file>

<file name="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/ParentWithNullable.php">

<violation number="1" location="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/ParentWithNullable.php:412">
P1: `offsetGet` is declared with invalid return type `?mixed`; `mixed` already includes `null` in PHP, so this can cause a fatal type declaration error.</violation>
</file>

<file name="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/ObjectWithDeprecatedFields.php">

<violation number="1" location="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/ObjectWithDeprecatedFields.php:444">
P1: Invalid PHP return type `?mixed` causes fatal class-loading failure; `mixed` cannot be nullable.</violation>
</file>

<file name="samples/client/echo_api/php-nextgen-streaming/src/Model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.php">

<violation number="1" location="samples/client/echo_api/php-nextgen-streaming/src/Model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.php:337">
P1: Invalid PHP return type `?mixed` is used; `mixed` cannot be nullable and can trigger fatal class loading/type declaration errors.</violation>
</file>

<file name="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/ErrorResponse.php">

<violation number="1" location="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/ErrorResponse.php:370">
P1: `offsetGet` uses invalid nullable `mixed` return type (`?mixed`), which is disallowed in PHP and can break class loading.</violation>
</file>

<file name="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/Order.php">

<violation number="1" location="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/Order.php:542">
P1: Invalid PHP return type `?mixed` is used; `mixed` already includes `null`, so this declaration can cause a fatal class-loading error.</violation>
</file>

<file name="modules/openapi-generator/src/main/resources/php-nextgen/model_generic.mustache">

<violation number="1" location="modules/openapi-generator/src/main/resources/php-nextgen/model_generic.mustache:507">
P1: `offsetGet` uses invalid return type `?mixed`; generated PHP code may fail with a fatal compile error.</violation>
</file>

<file name="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/TestInlineFreeformAdditionalPropertiesRequest.php">

<violation number="1" location="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/TestInlineFreeformAdditionalPropertiesRequest.php:336">
P1: Invalid PHP type declaration `?mixed` in `offsetGet` can cause fatal parse/load failure.</violation>
</file>

<file name="samples/client/echo_api/php-nextgen-streaming/src/Model/Bird.php">

<violation number="1" location="samples/client/echo_api/php-nextgen-streaming/src/Model/Bird.php:371">
P1: `offsetGet` uses invalid PHP return type `?mixed`; nullable `mixed` is forbidden and can trigger a fatal error when loading the class.</violation>
</file>

<file name="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/Dog.php">

<violation number="1" location="samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/Dog.php:326">
P1: Invalid `?mixed` return type in `offsetGet`; `mixed` cannot be nullable and may cause fatal load-time errors.</violation>
</file>

Since this is your first cubic review, here's how it works:

  • cubic automatically reviews your code and comments on bugs and improvements
  • Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
  • Add one-off context when rerunning by tagging @cubic-dev-ai with guidance or docs links (including llms.txt)
  • Ask questions if you need clarification on any suggestion

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

@coffeemakr coffeemakr force-pushed the features/fix-set-offset-param-type branch from 0695858 to 454b199 Compare March 19, 2026 11:20
@coffeemakr
Copy link
Author

Removed a incorrect change in the return type in offsetGet from the commit by force-pushing.

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

Successfully merging this pull request may close these issues.

1 participant