Update codebase for PHP 8.1+ #2
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: PHP Compatibility | |
| on: | |
| push: | |
| branches: [ master ] | |
| pull_request: | |
| branches: [ master ] | |
| jobs: | |
| php-compatibility: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: '8.1' | |
| extensions: dom, curl, libxml, mbstring, zip | |
| coverage: none | |
| - name: Install dependencies | |
| run: | | |
| composer update --prefer-dist --no-interaction | |
| composer require --dev phpcompatibility/php-compatibility | |
| - name: Install PHPCS | |
| run: | | |
| composer config allow-plugins.dealerdirect/phpcodesniffer-composer-installer true | |
| composer require --dev dealerdirect/phpcodesniffer-composer-installer | |
| - name: Check PHP compatibility | |
| run: | | |
| vendor/bin/phpcs --config-set installed_paths vendor/phpcompatibility/php-compatibility | |
| vendor/bin/phpcs -p src/ --standard=PHPCompatibility --runtime-set testVersion 8.1- |