Skip to content

Update php-laravel to newer versions#24196

Merged
wing328 merged 10 commits into
masterfrom
php-lav
Jul 15, 2026
Merged

Update php-laravel to newer versions#24196
wing328 merged 10 commits into
masterfrom
php-lav

Conversation

@wing328

@wing328 wing328 commented Jul 3, 2026

Copy link
Copy Markdown
Member

FYI @jebentier (2017/07), @dkarlovi (2017/07), @mandrean (2017/08), @jfastnacht (2017/09), @ybelenko (2018/07), @renepardon (2018/12)

cc @gijs-blanken as well

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

Upgrade the Laravel server generator and samples to Laravel 13 on PHP 8.3+. Switch the main sample to a custom spec, add a php-laravel-petstore sample, and add a dedicated PHPStan CI on PHP 8.3/8.4.

  • Dependencies

    • php: ^8.3 (was ^8.1)
    • laravel/framework: ^13.0 (was ^10.0)
    • phpunit/phpunit: ^12.0 (was ^9.5)
  • Refactors

    • Update generator composer.mustache; move the Laravel test spec to modules/openapi-generator/src/test/resources/3_0/php-laravel/... and adjust bin/configs/php-laravel.yaml; regenerate samples using the custom spec; remove the enum-parameter endpoint/models/routes; rename the enum to EnumTestEnumNumber and update EnumTest; add a new php-laravel-petstore sample.
    • Add a standalone PHPStan workflow for Laravel samples on PHP 8.3/8.4 and remove Laravel from the samples-php8 workflow; currently runs for php-laravel-issue-21334 (main sample temporarily disabled).

Written for commit 2d4496f. Summary will update on new commits.

Review in cubic

@wing328 wing328 changed the title update php laravel to newer versions Update php laravel to newer versions Jul 15, 2026
@wing328 wing328 added this to the 7.24.0 milestone Jul 15, 2026
@wing328
wing328 marked this pull request as ready for review July 15, 2026 16:55
@wing328 wing328 changed the title Update php laravel to newer versions Update php-laravel to newer versions Jul 15, 2026

@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.

4 issues found across 17 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="modules/openapi-generator/src/test/resources/3_0/php-laravel/petstore-with-fake-endpoints-models-for-testing.yaml">

<violation number="1" location="modules/openapi-generator/src/test/resources/3_0/php-laravel/petstore-with-fake-endpoints-models-for-testing.yaml:612">
P3: Large commented-out endpoint block (lines 612-712, ~100 lines). The entire `testEnumParameters` GET /fake endpoint is disabled. If no longer needed, remove it entirely to keep the spec clean; if needed for future use, restore or keep with a clear TODO explaining why it's disabled.</violation>

<violation number="2" location="modules/openapi-generator/src/test/resources/3_0/php-laravel/petstore-with-fake-endpoints-models-for-testing.yaml:1290">
P2: Invalid `required` value: `required: optional` is not a valid boolean in OpenAPI 3.0. The `required` field for a Parameter Object must be `true` or `false`. Using the string `optional` will cause spec validation failures.</violation>
</file>

<file name=".github/workflows/samples-php-servers-phpstan.yaml">

<violation number="1" location=".github/workflows/samples-php-servers-phpstan.yaml:40">
P2: No `phpstan.neon` or `phpstan.neon.dist` exists in the sample directory, so PHPStan defaults to level 0 (basic checks only). The analysis will miss type-safety issues, missing return types, and dead code that a higher level would catch — limiting the value of running static analysis at all.</violation>
</file>

<file name="samples/server/petstore/php-laravel/Model/EnumTestEnumNumber.php">

<violation number="1" location="samples/server/petstore/php-laravel/Model/EnumTestEnumNumber.php:29">
P0: Enum `EnumTestEnumNumber` declares a `float` backing type (`: float`), which PHP does not support. PHP backed enums only allow `int` and `string` as backing types; using `float` will cause a fatal compile-time error on any PHP version (8.1+). This blocks the `EnumTest` model from loading and breaks deserialization of the `enum_number` property in the `Enum_Test` spec schema.</violation>
</file>

Tip: cubic can generate docs of your entire codebase and keep them up to date. Try it here.

Re-trigger cubic

* EnumTestEnumNumber
*/
enum TestEnumParametersEnumQueryDoubleParameter: float
enum EnumTestEnumNumber: float

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.

P0: Enum EnumTestEnumNumber declares a float backing type (: float), which PHP does not support. PHP backed enums only allow int and string as backing types; using float will cause a fatal compile-time error on any PHP version (8.1+). This blocks the EnumTest model from loading and breaks deserialization of the enum_number property in the Enum_Test spec schema.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At samples/server/petstore/php-laravel/Model/EnumTestEnumNumber.php, line 29:

<comment>Enum `EnumTestEnumNumber` declares a `float` backing type (`: float`), which PHP does not support. PHP backed enums only allow `int` and `string` as backing types; using `float` will cause a fatal compile-time error on any PHP version (8.1+). This blocks the `EnumTest` model from loading and breaks deserialization of the `enum_number` property in the `Enum_Test` spec schema.</comment>

<file context>
@@ -19,14 +19,14 @@
+ * EnumTestEnumNumber
  */
-enum TestEnumParametersEnumQueryDoubleParameter: float
+enum EnumTestEnumNumber: float
 {
         case NUMBER_1_DOT_1 = 1.1;
</file context>

- name: query_1
in: query
description: query parameter
required: optional

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.

P2: Invalid required value: required: optional is not a valid boolean in OpenAPI 3.0. The required field for a Parameter Object must be true or false. Using the string optional will cause spec validation failures.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At modules/openapi-generator/src/test/resources/3_0/php-laravel/petstore-with-fake-endpoints-models-for-testing.yaml, line 1290:

<comment>Invalid `required` value: `required: optional` is not a valid boolean in OpenAPI 3.0. The `required` field for a Parameter Object must be `true` or `false`. Using the string `optional` will cause spec validation failures.</comment>

<file context>
@@ -0,0 +1,2064 @@
+        - name: query_1
+          in: query
+          description: query parameter
+          required: optional
+          schema:
+            type: string
</file context>

working-directory: ${{ matrix.sample }}
run: |
composer require --dev phpstan/phpstan
vendor/bin/phpstan analyse Api Http Model routes.php

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.

P2: No phpstan.neon or phpstan.neon.dist exists in the sample directory, so PHPStan defaults to level 0 (basic checks only). The analysis will miss type-safety issues, missing return types, and dead code that a higher level would catch — limiting the value of running static analysis at all.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/workflows/samples-php-servers-phpstan.yaml, line 40:

<comment>No `phpstan.neon` or `phpstan.neon.dist` exists in the sample directory, so PHPStan defaults to level 0 (basic checks only). The analysis will miss type-safety issues, missing return types, and dead code that a higher level would catch — limiting the value of running static analysis at all.</comment>

<file context>
@@ -0,0 +1,40 @@
+        working-directory: ${{ matrix.sample }}
+        run: |
+          composer require --dev phpstan/phpstan
+          vendor/bin/phpstan analyse Api Http Model routes.php
</file context>

$ref: '#/components/schemas/Client'
requestBody:
$ref: '#/components/requestBodies/Client'
#get:

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.

P3: Large commented-out endpoint block (lines 612-712, ~100 lines). The entire testEnumParameters GET /fake endpoint is disabled. If no longer needed, remove it entirely to keep the spec clean; if needed for future use, restore or keep with a clear TODO explaining why it's disabled.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At modules/openapi-generator/src/test/resources/3_0/php-laravel/petstore-with-fake-endpoints-models-for-testing.yaml, line 612:

<comment>Large commented-out endpoint block (lines 612-712, ~100 lines). The entire `testEnumParameters` GET /fake endpoint is disabled. If no longer needed, remove it entirely to keep the spec clean; if needed for future use, restore or keep with a clear TODO explaining why it's disabled.</comment>

<file context>
@@ -0,0 +1,2064 @@
+                $ref: '#/components/schemas/Client'
+      requestBody:
+        $ref: '#/components/requestBodies/Client'
+    #get:
+    #  tags:
+    #    - fake
</file context>

@wing328
wing328 merged commit e737241 into master Jul 15, 2026
18 checks passed
@wing328
wing328 deleted the php-lav branch July 15, 2026 17:09
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.

1 participant