diff --git a/.circleci/config.yml b/.circleci/config.yml index 2fea91a7..c3224d01 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -4,14 +4,25 @@ orbs: ci: bigcommerce/internal@volatile php: bigcommerce/internal-php@volatile +define: &php_min "8.1" + jobs_default: &jobs_default e: name: php/php php-version: << matrix.php-version >> matrix: parameters: - php-version: [ "8.1", "8.2" ] + php-version: [ *php_min, "8.2" ] +jobs: + cs-fixer: + executor: + name: php/php + php-version: *php_min + steps: + - ci/pre-setup + - php/composer-install + - run: ./vendor/bin/php-cs-fixer fix --diff --dry-run -v workflows: version: 2 @@ -23,3 +34,5 @@ workflows: - php/static-analysis: <<: *jobs_default generate_ide_helper: false + - cs-fixer + diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php new file mode 100644 index 00000000..6ddad3ac --- /dev/null +++ b/.php-cs-fixer.dist.php @@ -0,0 +1,12 @@ +setFinder( + PhpCsFixer\Finder::create() + ->files() + ->in(__DIR__) + ->name("*.php") + ->ignoreVCSIgnored(true) + ) + ->setRules([ + '@PSR2' => true, + ]); diff --git a/.php_cs.dist b/.php_cs.dist deleted file mode 100644 index 3ee5f943..00000000 --- a/.php_cs.dist +++ /dev/null @@ -1,11 +0,0 @@ -setFinder( - PhpCsFixer\Finder::create() - ->files() - ->in(__DIR__ . '/src') - ->in(__DIR__ . '/test') - ) - ->setRules([ - '@PSR2' => true, - ]); diff --git a/rector.php b/rector.php index dd792ccf..f5f53630 100644 --- a/rector.php +++ b/rector.php @@ -8,7 +8,7 @@ use Rector\Set\ValueObject\LevelSetList; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->paths([__DIR__ . '/test',]); + $rectorConfig->paths([__DIR__ . '/test']); $rectorConfig->sets([ PHPUnitSetList::PHPUNIT_100 ]); diff --git a/test/Unit/Api/ClientTest.php b/test/Unit/Api/ClientTest.php index 6491e5f6..39354f42 100644 --- a/test/Unit/Api/ClientTest.php +++ b/test/Unit/Api/ClientTest.php @@ -55,10 +55,10 @@ public function testFailOnErrorPassesThroughToConnection() { $matcher = $this->exactly(2); $this->connection->expects($matcher) - ->method('failOnError')->willReturnCallback(fn() => match ($matcher->numberOfInvocations()) { - 1 => [true], - 2 => [false], - }); + ->method('failOnError')->willReturnCallback(fn () => match ($matcher->numberOfInvocations()) { + 1 => [true], + 2 => [false], + }); Client::failOnError(true); Client::failOnError(false); } @@ -75,10 +75,10 @@ public function testVerifyPeerPassesThroughToConnection() { $matcher = $this->exactly(2); $this->connection->expects($matcher) - ->method('verifyPeer')->willReturnCallback(fn() => match ($matcher->numberOfInvocations()) { - 1 => [true], - 2 => [false], - }); + ->method('verifyPeer')->willReturnCallback(fn () => match ($matcher->numberOfInvocations()) { + 1 => [true], + 2 => [false], + }); Client::verifyPeer(true); Client::verifyPeer(false); }