Skip to content

Commit 02ba9a4

Browse files
committed
CI/GH Action: fix failing build
For those polyfill repos which are still actively maintained (PHP 7.2 and higher), the minimum required PHP version has been raised to PHP 7.1. The polyfill repos rely on the Composer version negotation to serve the correct package version for the PHP version on which the install is run. With that in mind, we should rely on the same and presume that if the polyfills are installed at version 1.20 or higher, that their minimum supported PHP version is PHP 7.1.
1 parent 453807b commit 02ba9a4

2 files changed

Lines changed: 18 additions & 3 deletions

File tree

.github/workflows/ci.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,28 @@ jobs:
118118
vendor/bin/phpcs -ps ./Test/SymfonyPolyfillPHP74Test.php --standard=PHPCompatibilitySymfonyPolyfillPHP74 --runtime-set testVersion 5.3-
119119
120120
# Check that the rulesets don't throw unnecessary errors for the compat libraries themselves.
121-
- name: Test running against the polyfills
121+
# Note: the polyfills for PHP 5.4 - 7.1 have been decoupled from the monorepo at version 1.19.
122+
# and are no longer updated.
123+
- name: Test running against the polyfills - polyfills 5.4-7.1
122124
run: |
123125
vendor/bin/phpcs -ps ./vendor/symfony/polyfill-php54/ --standard=PHPCompatibilitySymfonyPolyfillPHP54 --runtime-set testVersion 5.3-
124126
vendor/bin/phpcs -ps ./vendor/symfony/polyfill-php55/ --standard=PHPCompatibilitySymfonyPolyfillPHP55 --runtime-set testVersion 5.3-
125127
vendor/bin/phpcs -ps ./vendor/symfony/polyfill-php56/ ./vendor/symfony/polyfill-util/ --standard=PHPCompatibilitySymfonyPolyfillPHP56 --runtime-set testVersion 5.3- --ignore=*/polyfill-util/TestListener*
126128
vendor/bin/phpcs -ps ./vendor/symfony/polyfill-php70/ --standard=PHPCompatibilitySymfonyPolyfillPHP70 --runtime-set testVersion 5.3-
127129
vendor/bin/phpcs -ps ./vendor/symfony/polyfill-php71/ --standard=PHPCompatibilitySymfonyPolyfillPHP71 --runtime-set testVersion 5.3-
130+
131+
# The polyfills for PHP 7.2 and higher are compatible with PHP 5.3+ at version 1.19.
132+
- name: Test running against the polyfills - polyfills 7.2-
133+
if: ${{ matrix.php == '5.4' }}
134+
run: |
128135
vendor/bin/phpcs -ps ./vendor/symfony/polyfill-php72/ --standard=PHPCompatibilitySymfonyPolyfillPHP72 --runtime-set testVersion 5.3-
129136
vendor/bin/phpcs -ps ./vendor/symfony/polyfill-php73/ --standard=PHPCompatibilitySymfonyPolyfillPHP73 --runtime-set testVersion 5.3-
130137
vendor/bin/phpcs -ps ./vendor/symfony/polyfill-php74/ --standard=PHPCompatibilitySymfonyPolyfillPHP74 --runtime-set testVersion 5.3-
138+
139+
# The polyfills for PHP 7.2 and higher are compatible with PHP 7.1+ at version 1.20 and above.
140+
- name: Test running against the polyfills - polyfills 7.2-
141+
if: ${{ matrix.php != '5.4' }}
142+
run: |
143+
vendor/bin/phpcs -ps ./vendor/symfony/polyfill-php72/ --standard=PHPCompatibilitySymfonyPolyfillPHP72 --runtime-set testVersion 7.1-
144+
vendor/bin/phpcs -ps ./vendor/symfony/polyfill-php73/ --standard=PHPCompatibilitySymfonyPolyfillPHP73 --runtime-set testVersion 7.1-
145+
vendor/bin/phpcs -ps ./vendor/symfony/polyfill-php74/ --standard=PHPCompatibilitySymfonyPolyfillPHP74 --runtime-set testVersion 7.1-

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ For example:
9696
# For a project which should be compatible with PHP 5.3 up to and including PHP 7.0:
9797
./vendor/bin/phpcs -p . --standard=PHPCompatibilitySymfonyPolyfillPHP56 --runtime-set testVersion 5.3-7.0
9898

99-
# For a project which should be compatible with PHP 5.4 and higher:
100-
./vendor/bin/phpcs -p . --standard=PHPCompatibilitySymfonyPolyfillPHP73 --runtime-set testVersion 5.4-
99+
# For a project which should be compatible with PHP 7.1 and higher:
100+
./vendor/bin/phpcs -p . --standard=PHPCompatibilitySymfonyPolyfillPHP73 --runtime-set testVersion 7.1-
101101
```
102102

103103
For more detailed information about setting the `testVersion`, see the README of the generic [PHPCompatibility](https://github.com/PHPCompatibility/PHPCompatibility#sniffing-your-code-for-compatibility-with-specific-php-versions) standard.

0 commit comments

Comments
 (0)