Skip to content

Commit b938754

Browse files
authored
Merge pull request #203 from PHPCSStandards/feature/devcs-compatible
Composer: update to PHPCSDevCS 1.2.0
2 parents 452a93b + f23f287 commit b938754

File tree

5 files changed

+13
-14
lines changed

5 files changed

+13
-14
lines changed

.github/workflows/cs.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,8 @@ jobs:
3939
run: |
4040
# The sniff stage doesn't run the unit tests, so no need for PHPUnit.
4141
composer remove --no-update --dev phpunit/phpunit --no-scripts --no-interaction
42-
# Using PHPCS `3.x` as an early detection system for bugs upstream.
43-
# This should be changed to 4.x, but we'll need to wait for PHPCSDevCS to be compatible with 4.x.
44-
composer require --no-update squizlabs/php_codesniffer:"3.x-dev" --no-interaction
42+
# Using PHPCS `4.x` as an early detection system for bugs upstream.
43+
composer require --no-update squizlabs/php_codesniffer:"4.x-dev" --no-interaction
4544
4645
# Install dependencies and handle caching in one go.
4746
# @link https://github.com/marketplace/actions/install-php-dependencies-with-composer

Tests/IOTestCase.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ protected function executeCliCommand($command, $workingDir = null)
4747
}
4848

4949
$descriptorspec = [
50-
0 => ['pipe', 'r'], // stdin
51-
1 => ['pipe', 'w'], // stdout
52-
2 => ['pipe', 'w'], // stderr
50+
0 => ['pipe', 'r'], // stdin
51+
1 => ['pipe', 'w'], // stdout
52+
2 => ['pipe', 'w'], // stderr
5353
];
5454

5555
$options = null;

bin/phpcs-check-feature-completeness

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@
3131
* @link https://github.com/PHPCSStandards/PHPCSDevTools
3232
*/
3333

34-
if (is_file(__DIR__.'/../autoload.php') === true) {
34+
if (is_file(__DIR__ . '/../autoload.php') === true) {
3535
// Installed via Composer.
36-
require_once __DIR__.'/../autoload.php';
36+
require_once __DIR__ . '/../autoload.php';
3737
} else {
3838
// Presume git clone.
3939
require_once __DIR__ . '/../Scripts/FileList.php';

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"phpunit/phpunit" : "^4.8.36 || ^5.7.21 || ^6.0 || ^7.0 || ^8.0 || ^9.0 || ^10.5.32 || ^11.3.3",
3232
"php-parallel-lint/php-parallel-lint": "^1.4.0",
3333
"php-parallel-lint/php-console-highlighter": "^1.0.0",
34-
"phpcsstandards/phpcsdevcs": "^1.1.6",
34+
"phpcsstandards/phpcsdevcs": "^1.2.0",
3535
"phpcsstandards/phpcsutils" : "^1.0",
3636
"yoast/phpunit-polyfills": "^1.1 || ^2.0 || ^3.0"
3737
},

phpcs.xml.dist

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
-->
1111

1212
<file>.</file>
13+
<file>./bin/phpcs-check-feature-completeness</file>
1314

1415
<!-- Exclude Composer vendor directory. -->
1516
<exclude-pattern>*/vendor/*</exclude-pattern>
@@ -33,12 +34,11 @@
3334
-->
3435

3536
<rule ref="PHPCSDev">
36-
<!-- Allow for the file docblock on the line directly following the PHP open tag.
37-
As the sniff in PHPCS does not use modular error codes (yet - see PR #2729),
38-
the complete error code needs to be disabled, not just the bit involving
39-
the file docblocks.
40-
-->
37+
<!-- Only needed for PHPCS 3.x. This exclusion can be removed when PHPCSDevCS drops support for PHPCS 3.x. -->
4138
<exclude name="PSR12.Files.FileHeader.SpacingAfterBlock"/>
39+
40+
<!-- Temporary exclude. Changing pre-existing classes to final can only be done in a major release. -->
41+
<exclude name="Universal.Classes.RequireFinalClass"/>
4242
</rule>
4343

4444
<!-- Set minimum PHP version supported to PHP 5.4. -->

0 commit comments

Comments
 (0)