feat: hook handler argument types (sniff + PHPStan rule) #3
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
| # Continuous Integration for stellarwp/coding-standards. | |
| # | |
| # On every push to main and every pull request: validates composer.json and runs | |
| # the PHPUnit suite (the HookHandlerTypes sniff and PHPStan rule tests) across a | |
| # range of PHP versions. | |
| name: CI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| jobs: | |
| test: | |
| name: Test (PHP ${{ matrix.php-version }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| # PHPUnit 9.6 and PHPStan 1.x support this range. The PHPStan rule test | |
| # skips on 7.4 (a php-parser emulation quirk in the test harness only); | |
| # the sniff test runs on every version. | |
| php-version: | |
| - '7.4' | |
| - '8.0' | |
| - '8.1' | |
| - '8.2' | |
| - '8.3' | |
| - '8.4' | |
| steps: | |
| - name: Check out the code | |
| uses: actions/checkout@v7 | |
| - name: Configure PHP ${{ matrix.php-version }} | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php-version }} | |
| extensions: mbstring | |
| coverage: none | |
| - name: Validate composer.json | |
| run: composer validate --no-check-lock | |
| - name: Install dependencies | |
| uses: ramsey/composer-install@v4 | |
| # Runs the sniff (AbstractSniffUnitTest) and PHPStan rule (RuleTestCase) | |
| # tests. The sniff test constructs the full StellarWP ruleset, so a broken | |
| # ruleset fails here too. --testdox lists each test and its result. | |
| - name: Run the test suite | |
| run: composer phpunit |