Skip to content

Commit

Permalink
Replace PHP_CodeSniffer with EasyCodingStandard (#80)
Browse files Browse the repository at this point in the history
* Replace PHP_CodeSniffer with EasyCodingStandard

* Apply CodeStyle from ECS

* Add ECS comments set

* Add ECS namespaces set

* Add ECS dockblock set

* Add ECS array set

* Fixed multiple blank lines between methods
  • Loading branch information
yann-eugone authored Jun 5, 2023
1 parent 9ad4a59 commit efbbe75
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/Job/CopyFilesJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ final public function execute(JobExecution $jobExecution): void
throw UnexpectedValueException::type('string|string[]', $config);
}

$transformLocation = $this->transformLocation ?? fn ($sourceLocation) => $sourceLocation;
$transformLocation = $this->transformLocation ?? fn($sourceLocation) => $sourceLocation;
foreach ($locations as $sourceLocation) {
$destinationLocation = $transformLocation($sourceLocation);
if (!\is_string($destinationLocation)) {
Expand Down
2 changes: 1 addition & 1 deletion src/Job/MoveFilesJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ final public function execute(JobExecution $jobExecution): void
throw UnexpectedValueException::type('string|string[]', $config);
}

$transformLocation = $this->transformLocation ?? fn ($sourceLocation) => $sourceLocation;
$transformLocation = $this->transformLocation ?? fn($sourceLocation) => $sourceLocation;
foreach ($locations as $sourceLocation) {
$destinationLocation = $transformLocation($sourceLocation);
if (!\is_string($destinationLocation)) {
Expand Down
4 changes: 2 additions & 2 deletions tests/Job/CopyFilesJobTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function testWithPathTransformation(): void
$source->write('source-file.txt', 'SOURCE TO BE COPIED');
$destination = new Filesystem(new InMemoryFilesystemAdapter());
$location = new StaticValueParameterAccessor('source-file.txt');
$transformDestination = fn () => 'destination-file.txt';
$transformDestination = fn() => 'destination-file.txt';

self::assertFalse(
$destination->has('source-file.txt'),
Expand Down Expand Up @@ -179,7 +179,7 @@ public function testWrongDestinationType(): void
$source->write('file.txt', 'FILE');
$destination = new Filesystem(new InMemoryFilesystemAdapter());
$location = new StaticValueParameterAccessor('source');
$transformation = fn () => null;
$transformation = fn() => null;

$job = new CopyFilesJob($location, $source, $destination, $transformation);
$job->execute(JobExecution::createRoot('123456', 'phpunit-copy-file'));
Expand Down
4 changes: 2 additions & 2 deletions tests/Job/MoveFilesJobTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function testWithPathTransformation(): void
$source->write('source-file.txt', 'SOURCE TO BE MOVED');
$destination = new Filesystem(new InMemoryFilesystemAdapter());
$location = new StaticValueParameterAccessor('source-file.txt');
$transformDestination = fn () => 'destination-file.txt';
$transformDestination = fn() => 'destination-file.txt';

self::assertFalse(
$destination->has('source-file.txt'),
Expand Down Expand Up @@ -218,7 +218,7 @@ public function testWrongDestinationType(): void
$source->write('file.txt', 'FILE');
$destination = new Filesystem(new InMemoryFilesystemAdapter());
$location = new StaticValueParameterAccessor('source');
$transformation = fn () => null;
$transformation = fn() => null;

$job = new MoveFilesJob($location, $source, $destination, $transformation);
$job->execute(JobExecution::createRoot('123456', 'phpunit-move-file'));
Expand Down
2 changes: 1 addition & 1 deletion tests/Scheduler/FileFoundSchedulerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
use League\Flysystem\Filesystem;
use League\Flysystem\InMemory\InMemoryFilesystemAdapter;
use League\Flysystem\UnableToCheckExistence;
use Yokai\Batch\Bridge\League\Flysystem\Scheduler\FileFoundScheduler;
use PHPUnit\Framework\TestCase;
use Yokai\Batch\Bridge\League\Flysystem\Scheduler\FileFoundScheduler;
use Yokai\Batch\Exception\UnexpectedValueException;
use Yokai\Batch\Job\Parameters\StaticValueParameterAccessor;
use Yokai\Batch\JobExecution;
Expand Down

0 comments on commit efbbe75

Please sign in to comment.