Replace rand with random_int and remove fallback try-catch.
#758
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: run-phpstan | |
| on: | |
| push: | |
| branches: | |
| - "*" | |
| pull_request: | |
| branches: [ 'master', 'main' ] | |
| jobs: | |
| run: | |
| name: Run PHPStan | |
| runs-on: 'ubuntu-latest' | |
| strategy: | |
| matrix: | |
| level: [ 3, 4 ] | |
| include: | |
| - current-level: 3 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@cf4cade2721270509d5b1c766ab3549210a39a2a # v2.33.0 | |
| - name: Install PHPStan | |
| run: composer require --dev phpstan/phpstan | |
| - name: Run PHPStan | |
| if: matrix.level == matrix.current-level | |
| run: ./vendor/bin/phpstan analyse -c ./spec/phpstan.neon --memory-limit 1024M --level "${{ matrix.level }}" | |
| - name: Run PHPStan | |
| if: matrix.level > matrix.current-level # && github.event_name != 'pull_request' | |
| continue-on-error: true | |
| run: | | |
| ./vendor/bin/phpstan analyse -c spec/phpstan.neon --memory-limit 1024M --level "${{ matrix.level }}" | |
| exit 0 | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| name: checkout "${{ github.base_ref }}" | |
| if: matrix.level > matrix.current-level && github.event_name == 'pull_request' | |
| with: | |
| fetch-depth: 1 | |
| ref: ${{ github.base_ref }} | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| name: checkout "${{ github.head_ref }}" | |
| if: matrix.level > matrix.current-level && github.event_name == 'pull_request' | |
| with: | |
| fetch-depth: 1 | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| - name: Run PHPStan for pull request event | |
| if: matrix.level > matrix.current-level && github.event_name == 'pull_request' | |
| shell: bash | |
| continue-on-error: true | |
| run: | | |
| FILES=(`git diff origin/${{ github.base_ref }} --name-only src spec/INTER-Mediator-UnitTest | tr '\n' ' '`) | |
| if [[ "$FILES" != "" ]]; then composer require --dev phpstan/phpstan; ./vendor/bin/phpstan analyse -c spec/phpstan.neon --memory-limit 1024M ${FILES} --level "${{ matrix.level }}"; fi | |
| exit 0 |