[php-nextgen]: Fix offsetGet/offsetExists/offsetSet parameter#23288
Open
coffeemakr wants to merge 1 commit intoOpenAPITools:masterfrom
Open
[php-nextgen]: Fix offsetGet/offsetExists/offsetSet parameter#23288coffeemakr wants to merge 1 commit intoOpenAPITools:masterfrom
coffeemakr wants to merge 1 commit intoOpenAPITools:masterfrom
Conversation
Contributor
There was a problem hiding this comment.
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-aiwith guidance or docs links (includingllms.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.
samples/client/echo_api/php-nextgen-streaming/src/Model/Tag.php
Outdated
Show resolved
Hide resolved
samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/User.php
Outdated
Show resolved
Hide resolved
samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/EnumArrays.php
Outdated
Show resolved
Hide resolved
samples/client/echo_api/php-nextgen/src/Model/TestFormObjectMultipartRequestMarker.php
Outdated
Show resolved
Hide resolved
samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/OuterObjectWithEnumProperty.php
Outdated
Show resolved
Hide resolved
samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/Order.php
Outdated
Show resolved
Hide resolved
modules/openapi-generator/src/main/resources/php-nextgen/model_generic.mustache
Outdated
Show resolved
Hide resolved
...re/php-nextgen/OpenAPIClient-php/src/Model/TestInlineFreeformAdditionalPropertiesRequest.php
Outdated
Show resolved
Hide resolved
samples/client/echo_api/php-nextgen-streaming/src/Model/Bird.php
Outdated
Show resolved
Hide resolved
samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/Dog.php
Outdated
Show resolved
Hide resolved
Contributor
There was a problem hiding this comment.
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-aiwith guidance or docs links (includingllms.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.
samples/client/echo_api/php-nextgen-streaming/src/Model/Tag.php
Outdated
Show resolved
Hide resolved
samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/User.php
Outdated
Show resolved
Hide resolved
samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/EnumArrays.php
Outdated
Show resolved
Hide resolved
samples/client/echo_api/php-nextgen/src/Model/TestFormObjectMultipartRequestMarker.php
Outdated
Show resolved
Hide resolved
samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/OuterObjectWithEnumProperty.php
Outdated
Show resolved
Hide resolved
samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/Order.php
Outdated
Show resolved
Hide resolved
modules/openapi-generator/src/main/resources/php-nextgen/model_generic.mustache
Outdated
Show resolved
Hide resolved
...re/php-nextgen/OpenAPIClient-php/src/Model/TestInlineFreeformAdditionalPropertiesRequest.php
Outdated
Show resolved
Hide resolved
samples/client/echo_api/php-nextgen-streaming/src/Model/Bird.php
Outdated
Show resolved
Hide resolved
samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/Dog.php
Outdated
Show resolved
Hide resolved
0695858 to
454b199
Compare
Author
|
Removed a incorrect change in the return type in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
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.
master(upcoming7.x.0minor release - breaking changes with fallbacks),8.0.x(breaking changes without fallbacks)"fixes #123"present in the PR description)Summary by cubic
Fixes ArrayAccess typing in
php-nextgenmodels so offsets accept strings andoffsetGetcan return null. Regenerates affectedphp-nextgenandphp-nextgen-streamingPHP samples.offsetExists,offsetGet,offsetSet, andoffsetUnsetto acceptinteger|stringoffsets; allownullforoffsetSet.offsetGetreturn type nullable and returnnullwhen the key is missing.Written for commit 454b199. Summary will update on new commits.