From 98ac517b0371eb8ea2eba57202183f0b5dcada30 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sun, 28 Jun 2026 22:10:35 +0800 Subject: [PATCH 1/2] test with phpstan --- .github/workflows/samples-php-syntax-check.yaml | 5 +++++ .../php-nextgen/OpenAPIClient-php/.openapi-generator-ignore | 2 ++ 2 files changed, 7 insertions(+) diff --git a/.github/workflows/samples-php-syntax-check.yaml b/.github/workflows/samples-php-syntax-check.yaml index 6fffac10ff02..58999f39b5fa 100644 --- a/.github/workflows/samples-php-syntax-check.yaml +++ b/.github/workflows/samples-php-syntax-check.yaml @@ -34,3 +34,8 @@ jobs: - name: php -l working-directory: ${{ matrix.sample }} run: find . -name "*.php" -exec php -l {} + + - name: phpstan + working-directory: ${{ matrix.sample }} + run: | + composer require --dev phpstan/phpstan + vendor/bin/phpstan analyse src diff --git a/samples/client/petstore/php-nextgen/OpenAPIClient-php/.openapi-generator-ignore b/samples/client/petstore/php-nextgen/OpenAPIClient-php/.openapi-generator-ignore index 82e4e79984b4..5a9f4cf07bc2 100644 --- a/samples/client/petstore/php-nextgen/OpenAPIClient-php/.openapi-generator-ignore +++ b/samples/client/petstore/php-nextgen/OpenAPIClient-php/.openapi-generator-ignore @@ -23,3 +23,5 @@ #!docs/README.md # # +# +# From f5aa3f246823181a5e54218e29032fea34c51c5c Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sun, 28 Jun 2026 22:23:15 +0800 Subject: [PATCH 2/2] update --- .../samples-php-nextgen-phpstan.yaml | 35 +++++++++++++++++++ .../workflows/samples-php-syntax-check.yaml | 5 --- 2 files changed, 35 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/samples-php-nextgen-phpstan.yaml diff --git a/.github/workflows/samples-php-nextgen-phpstan.yaml b/.github/workflows/samples-php-nextgen-phpstan.yaml new file mode 100644 index 000000000000..c9c76d04b91e --- /dev/null +++ b/.github/workflows/samples-php-nextgen-phpstan.yaml @@ -0,0 +1,35 @@ +name: Samples php-nextgen (phpstan) + +on: + push: + paths: + - samples/client/petstore/php-nextgen/OpenAPIClient-php/** + pull_request: + paths: + - samples/client/petstore/php-nextgen/OpenAPIClient-php/** +jobs: + build: + name: Build + runs-on: ubuntu-latest + strategy: + fail-fast: true + matrix: + php: + - "8.1" + - "8.2" + - "8.3" + - "8.4" + sample: + # clients + - samples/client/petstore/php-nextgen/OpenAPIClient-php/ + steps: + - uses: actions/checkout@v7 + - name: Setup PHP with tools + uses: shivammathur/setup-php@v2 + with: + php-version: "${{ matrix.php }}" + - name: phpstan + working-directory: ${{ matrix.sample }} + run: | + composer require --dev phpstan/phpstan + vendor/bin/phpstan analyse src diff --git a/.github/workflows/samples-php-syntax-check.yaml b/.github/workflows/samples-php-syntax-check.yaml index 58999f39b5fa..6fffac10ff02 100644 --- a/.github/workflows/samples-php-syntax-check.yaml +++ b/.github/workflows/samples-php-syntax-check.yaml @@ -34,8 +34,3 @@ jobs: - name: php -l working-directory: ${{ matrix.sample }} run: find . -name "*.php" -exec php -l {} + - - name: phpstan - working-directory: ${{ matrix.sample }} - run: | - composer require --dev phpstan/phpstan - vendor/bin/phpstan analyse src