Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/samples-php-servers-phpstan.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Samples php-laravel 8.x

on:
push:
paths:
- samples/server/petstore/php-laravel/**
- samples/server/petstore/php-laravel-issue-21334/**
pull_request:
paths:
- samples/server/petstore/php-laravel/**
- samples/server/petstore/php-laravel-issue-21334/**
jobs:
build:
name: Build
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php:
- "8.3"
- "8.4"
sample:
# servers
# comment out due to errors
#- samples/server/petstore/php-laravel/
- samples/server/petstore/php-laravel-issue-21334/
steps:
- uses: actions/checkout@v7
- name: Setup PHP with tools
uses: shivammathur/setup-php@v2
with:
php-version: "${{ matrix.php }}"
- name: composer install
working-directory: ${{ matrix.sample }}
run: composer install
- name: phpstan
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>

6 changes: 0 additions & 6 deletions .github/workflows/samples-php8.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,10 @@ on:
paths:
- samples/server/petstore/php-symfony/SymfonyBundle-php/**
- samples/server/petstore/php-flight/**
- samples/server/petstore/php-laravel/**
- samples/server/petstore/php-laravel-issue-21334/**
pull_request:
paths:
- samples/server/petstore/php-symfony/SymfonyBundle-php/**
- samples/server/petstore/php-flight/**
- samples/server/petstore/php-laravel/**
- samples/server/petstore/php-laravel-issue-21334/**
jobs:
build:
name: Build PHP projects
Expand All @@ -29,8 +25,6 @@ jobs:
# servers
- samples/server/petstore/php-symfony/SymfonyBundle-php/
- samples/server/petstore/php-flight/
- samples/server/petstore/php-laravel/
- samples/server/petstore/php-laravel-issue-21334/
steps:
- uses: actions/checkout@v7
- name: Setup PHP with tools
Expand Down
2 changes: 1 addition & 1 deletion bin/configs/php-laravel.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
generatorName: php-laravel
outputDir: samples/server/petstore/php-laravel
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml
inputSpec: modules/openapi-generator/src/test/resources/3_0/php-laravel/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/php-laravel
gitUserId: openapitools
gitRepoId: petstore
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@
}
],
"require": {
"php": "^8.1",
"laravel/framework": "^10.0",
"php": "^8.3",
"laravel/framework": "^13.0",
"crell/serde": "^1.0"
},
"require-dev": {
"phpunit/phpunit": "^9.5"
"phpunit/phpunit": "^12.0"
},
"autoload": {
"psr-4": {
Expand Down
Loading
Loading