fix: declare nullable parameters explicitly #90
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: Tests | |
| on: | |
| push: | |
| branches: [ main, develop ] | |
| pull_request: | |
| branches: [ main, develop ] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| # Every version this library supports, and only those. | |
| # `composer.json` requires php >=8.1, so the 7.4 and 8.0 legs | |
| # could never install: composer's platform_check aborted before | |
| # a single test ran, and fail-fast then cancelled the versions | |
| # that do work. develop had been red since April for this alone. | |
| php-versions: [ '8.1', '8.2', '8.3', '8.4' ] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php-versions }} | |
| - name: Check PHP Version | |
| run: php -v | |
| - name: Validate composer.json and composer.lock | |
| run: composer validate | |
| - name: Cache dependencies | |
| id: cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: vendor | |
| key: ${{ runner.os }}-build-${{ matrix.php-versions }}-${{ hashFiles('composer.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-build-${{ matrix.php-versions }}- | |
| - name: Install dependencies | |
| if: steps.cache.outputs.cache-hit != 'true' | |
| # We run `--no-scripts` to avoid using Strauss during unit tests | |
| run: composer install --prefer-dist --no-progress --no-scripts | |
| # Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit" | |
| # Docs: https://getcomposer.org/doc/articles/scripts.md | |
| - name: Run linter | |
| run: composer run-script linter | |
| - name: Run test suite | |
| run: composer run-script test | |
| - name: Run Code Sniffer | |
| run: composer run-script sniffer | |
| # Disabled. Needs gravity forms available to read symbols. | |
| # - name: Run static analysis | |
| # run: composer run-script analyse |