Skip to content

Commit

Permalink
Add php-cs-fixer to the CI
Browse files Browse the repository at this point in the history
  • Loading branch information
funivan committed Jan 10, 2024
1 parent 64ecfd2 commit 066906f
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 20 deletions.
9 changes: 9 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ jobs_default: &jobs_default
parameters:
php-version: [ "8.1", "8.2" ]

jobs:
cs-fixer:
executor:
name: php/php
steps:
- ci/pre-setup
- php/composer-install
- run: ./vendor/bin/php-cs-fixer fix --diff --dry-run -v

workflows:
version: 2
Expand All @@ -23,3 +31,4 @@ workflows:
- php/static-analysis:
<<: *jobs_default
generate_ide_helper: false
- cs-fixer
12 changes: 12 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php
return (new PhpCsFixer\Config())
->setFinder(
PhpCsFixer\Finder::create()
->files()
->in(__DIR__)
->name("*.php")
->ignoreVCSIgnored(true)
)
->setRules([
'@PSR2' => true,
]);
11 changes: 0 additions & 11 deletions .php_cs.dist

This file was deleted.

2 changes: 1 addition & 1 deletion rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
]);
Expand Down
16 changes: 8 additions & 8 deletions test/Unit/Api/ClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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);
}
Expand Down

0 comments on commit 066906f

Please sign in to comment.