Resolve the "Property is never assigned null so it can be removed from the property type" error detected by PHPStan #198
Workflow file for this run
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
| name: PHPStan | |
| permissions: | |
| contents: read | |
| on: | |
| push: | |
| pull_request: | |
| jobs: | |
| run: | |
| name: Run PHPStan | |
| runs-on: 'ubuntu-latest' | |
| strategy: | |
| matrix: | |
| level: [ 3, 4 ] | |
| include: | |
| - current-level: 3 | |
| steps: | |
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| - name: Setup PHP | |
| uses: ./.github/actions/setup-php | |
| - name: Install PHPStan | |
| run: composer install | |
| - name: Restore cached baseline for PHPStan | |
| id: cache-baseline-restore | |
| uses: actions/cache/restore@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1 | |
| with: | |
| path: test/phpstan-baseline.neon | |
| key: phpstan-baseline-${{ github.run_id }}" | |
| restore-keys: phpstan-baseline- | |
| - name: Run PHPStan | |
| if: matrix.level < matrix.current-level || matrix.level == matrix.current-level | |
| run: | | |
| ./vendor/bin/phpstan analyse --memory-limit 1G -c test/phpstan.neon src test -l "${{ matrix.level }}" | |
| - name: Run PHPStan | |
| if: matrix.level > matrix.current-level | |
| continue-on-error: true | |
| run: | | |
| ./vendor/bin/phpstan analyse --memory-limit 1G -c test/phpstan.neon src test -l "${{ matrix.level }}" | |
| exit 0 |