Skip to content

Commit df5703b

Browse files
committed
Add php-cs-fixer to the CI
1 parent 64ecfd2 commit df5703b

File tree

5 files changed

+35
-21
lines changed

5 files changed

+35
-21
lines changed

.circleci/config.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,25 @@ orbs:
44
ci: bigcommerce/internal@volatile
55
php: bigcommerce/internal-php@volatile
66

7+
define: &php_min "8.1"
8+
79
jobs_default: &jobs_default
810
e:
911
name: php/php
1012
php-version: << matrix.php-version >>
1113
matrix:
1214
parameters:
13-
php-version: [ "8.1", "8.2" ]
15+
php-version: [ *php_min, "8.2" ]
1416

17+
jobs:
18+
cs-fixer:
19+
executor:
20+
name: php/php
21+
php-version: *php_min
22+
steps:
23+
- ci/pre-setup
24+
- php/composer-install
25+
- run: ./vendor/bin/php-cs-fixer fix --diff --dry-run -v
1526

1627
workflows:
1728
version: 2
@@ -23,3 +34,5 @@ workflows:
2334
- php/static-analysis:
2435
<<: *jobs_default
2536
generate_ide_helper: false
37+
- cs-fixer
38+

.php-cs-fixer.dist.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
return (new PhpCsFixer\Config())
3+
->setFinder(
4+
PhpCsFixer\Finder::create()
5+
->files()
6+
->in(__DIR__)
7+
->name("*.php")
8+
->ignoreVCSIgnored(true)
9+
)
10+
->setRules([
11+
'@PSR2' => true,
12+
]);

.php_cs.dist

Lines changed: 0 additions & 11 deletions
This file was deleted.

rector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
use Rector\Set\ValueObject\LevelSetList;
99

1010
return static function (RectorConfig $rectorConfig): void {
11-
$rectorConfig->paths([__DIR__ . '/test',]);
11+
$rectorConfig->paths([__DIR__ . '/test']);
1212
$rectorConfig->sets([
1313
PHPUnitSetList::PHPUNIT_100
1414
]);

test/Unit/Api/ClientTest.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ public function testFailOnErrorPassesThroughToConnection()
5555
{
5656
$matcher = $this->exactly(2);
5757
$this->connection->expects($matcher)
58-
->method('failOnError')->willReturnCallback(fn() => match ($matcher->numberOfInvocations()) {
59-
1 => [true],
60-
2 => [false],
61-
});
58+
->method('failOnError')->willReturnCallback(fn () => match ($matcher->numberOfInvocations()) {
59+
1 => [true],
60+
2 => [false],
61+
});
6262
Client::failOnError(true);
6363
Client::failOnError(false);
6464
}
@@ -75,10 +75,10 @@ public function testVerifyPeerPassesThroughToConnection()
7575
{
7676
$matcher = $this->exactly(2);
7777
$this->connection->expects($matcher)
78-
->method('verifyPeer')->willReturnCallback(fn() => match ($matcher->numberOfInvocations()) {
79-
1 => [true],
80-
2 => [false],
81-
});
78+
->method('verifyPeer')->willReturnCallback(fn () => match ($matcher->numberOfInvocations()) {
79+
1 => [true],
80+
2 => [false],
81+
});
8282
Client::verifyPeer(true);
8383
Client::verifyPeer(false);
8484
}

0 commit comments

Comments
 (0)