@@ -41,11 +41,21 @@ jobs:
4141 # ### SNIFF STAGE ####
4242 - stage : sniff
4343 php : 7.4
44- env : PHPCS_VERSION="dev-master"
4544 addons :
4645 apt :
4746 packages :
4847 - libxml2-utils
48+
49+ before_install :
50+ - phpenv config-rm xdebug.ini || echo 'No xdebug config.'
51+ - export XMLLINT_INDENT=" "
52+ # Set up CS check.
53+ # - Using PHPCS `master` as an early detection system for bugs upstream.
54+ # - The sniff stage doesn't run the unit tests, so no need for PHPUnit.
55+ - travis_retry composer remove --dev phpunit/phpunit --no-update --no-scripts
56+ - travis_retry composer require --no-update squizlabs/php_codesniffer:"dev-master"
57+ - travis_retry composer install --no-interaction
58+
4959 script :
5060 # Check the code style of the code base.
5161 - composer check-cs
@@ -124,24 +134,14 @@ before_install:
124134 # On stable PHPCS versions, allow for PHP deprecation notices.
125135 # Unit tests don't need to fail on those for stable releases where those issues won't get fixed anymore.
126136 - |
127- if [[ "${TRAVIS_BUILD_STAGE_NAME^}" != "Sniff" && "$ PHPCS_VERSION" != "dev-master" && "$PHPCS_VERSION" != "4.0.x-dev" ]]; then
137+ if [[ "$PHPCS_VERSION" != "dev-master" && "$PHPCS_VERSION" != "4.0.x-dev" ]]; then
128138 echo 'error_reporting = E_ALL & ~E_DEPRECATED' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
129139 fi
130140
131- - export XMLLINT_INDENT=" "
132-
133141 # Set up test environment using Composer.
134- - |
135- if [[ "${TRAVIS_BUILD_STAGE_NAME^}" != "Sniff" ]]; then
136- # Remove the PHPCSDevCS dependency as it has different PHPCS requirements and would block installs.
137- travis_retry composer remove --dev phpcsstandards/phpcsdevcs --no-update --no-scripts
138- fi
139142 - travis_retry composer require --no-update --no-scripts squizlabs/php_codesniffer:${PHPCS_VERSION}
140- - |
141- if [[ "${TRAVIS_BUILD_STAGE_NAME^}" == "Sniff" ]]; then
142- # The sniff stage doesn't run the unit tests, so no need for PHPUnit.
143- travis_retry composer remove --dev phpunit/phpunit --no-update --no-scripts
144- fi
143+ # Remove the PHPCSDevCS dependency as it has different PHPCS requirements and would block installs.
144+ - travis_retry composer remove --dev phpcsstandards/phpcsdevcs --no-update --no-scripts
145145
146146 # --prefer-dist will allow for optimal use of the travis caching ability.
147147 # The Composer PHPCS plugin takes care of setting the installed_paths for PHPCS.
0 commit comments