Skip to content

Commit f154bab

Browse files
lordthorzonusStyleCIBot
authored andcommitted
Apply fixes from StyleCI
1 parent 5e80d2a commit f154bab

File tree

7 files changed

+26
-24
lines changed

7 files changed

+26
-24
lines changed

src/DataLoader.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44

55
namespace leinonen\DataLoader;
66

7-
use React\Promise\Promise;
7+
use React\EventLoop\LoopInterface;
88
use function React\Promise\all;
9+
use React\Promise\ExtendedPromiseInterface;
10+
use React\Promise\Promise;
911
use function React\Promise\reject;
10-
use React\EventLoop\LoopInterface;
1112
use function React\Promise\resolve;
12-
use React\Promise\ExtendedPromiseInterface;
1313

1414
final class DataLoader implements DataLoaderInterface
1515
{
@@ -88,7 +88,7 @@ public function loadMany(array $keys): ExtendedPromiseInterface
8888
{
8989
return all(
9090
\array_map(
91-
fn($key) => $this->load($key),
91+
fn ($key) => $this->load($key),
9292
$keys
9393
)
9494
);
@@ -134,7 +134,7 @@ private function scheduleDispatch(): void
134134
{
135135
if ($this->options->shouldBatch()) {
136136
$this->eventLoop->futureTick(
137-
fn() => $this->dispatchQueue()
137+
fn () => $this->dispatchQueue()
138138
);
139139

140140
return;
@@ -189,7 +189,7 @@ function ($values) use ($batch, $keys) {
189189
$this->handleSuccessfulDispatch($batch, $values);
190190
}
191191
)
192-
->then(null, fn($error) => $this->handleFailedDispatch($batch, $error));
192+
->then(null, fn ($error) => $this->handleFailedDispatch($batch, $error));
193193
}
194194

195195
/**

src/DataLoaderInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
namespace leinonen\DataLoader;
66

7-
use React\Promise\Promise;
87
use React\Promise\ExtendedPromiseInterface;
8+
use React\Promise\Promise;
99

1010
interface DataLoaderInterface
1111
{

src/DataLoaderOptions.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
<?php declare(strict_types=1);
1+
<?php
2+
3+
declare(strict_types=1);
24

35
namespace leinonen\DataLoader;
46

tests/Unit/CacheMapTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
namespace leinonen\DataLoader\Tests\Unit;
44

5-
use PHPUnit\Framework\TestCase;
65
use leinonen\DataLoader\CacheMap;
6+
use PHPUnit\Framework\TestCase;
77

88
class CacheMapTest extends TestCase
99
{

tests/Unit/DataLoaderAbuseTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
namespace leinonen\DataLoader\Tests\Unit;
44

5-
use React\Promise\Promise;
6-
use React\EventLoop\Factory;
7-
use PHPUnit\Framework\TestCase;
85
use leinonen\DataLoader\CacheMap;
9-
use React\EventLoop\LoopInterface;
10-
use function React\Promise\resolve;
116
use leinonen\DataLoader\DataLoader;
127
use leinonen\DataLoader\DataLoaderException;
8+
use PHPUnit\Framework\TestCase;
9+
use React\EventLoop\Factory;
10+
use React\EventLoop\LoopInterface;
11+
use React\Promise\Promise;
12+
use function React\Promise\resolve;
1313

1414
class DataLoaderAbuseTest extends TestCase
1515
{

tests/Unit/DataLoaderOptionsTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
namespace leinonen\DataLoader\Tests\Unit;
44

5-
use PHPUnit\Framework\TestCase;
65
use leinonen\DataLoader\DataLoaderOptions;
6+
use PHPUnit\Framework\TestCase;
77

88
class DataLoaderOptionsTest extends TestCase
99
{

tests/Unit/DataLoaderTest.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
namespace leinonen\DataLoader\Tests\Unit;
44

5-
use React\Promise\Promise;
6-
use React\EventLoop\Factory;
7-
use function React\Promise\all;
8-
use PHPUnit\Framework\TestCase;
95
use leinonen\DataLoader\CacheMap;
10-
use React\EventLoop\LoopInterface;
11-
use function React\Promise\resolve;
126
use leinonen\DataLoader\DataLoader;
137
use leinonen\DataLoader\DataLoaderOptions;
8+
use PHPUnit\Framework\TestCase;
9+
use React\EventLoop\Factory;
10+
use React\EventLoop\LoopInterface;
11+
use function React\Promise\all;
12+
use React\Promise\Promise;
13+
use function React\Promise\resolve;
1414

1515
class DataLoaderTest extends TestCase
1616
{
@@ -37,7 +37,7 @@ public function setUp(): void
3737
public function it_builds_a_really_simple_data_loader()
3838
{
3939
$identityLoader = new DataLoader(
40-
fn($keys) => resolve($keys),
40+
fn ($keys) => resolve($keys),
4141
$this->eventLoop,
4242
new CacheMap()
4343
);
@@ -889,7 +889,7 @@ function ($keys) {
889889

890890
return resolve(
891891
\array_map(
892-
fn($key) => ($key % 2 === 0) ? $key : new \Exception("Odd: {$key}"),
892+
fn ($key) => ($key % 2 === 0) ? $key : new \Exception("Odd: {$key}"),
893893
$keys
894894
)
895895
);
@@ -912,7 +912,7 @@ function ($keys) {
912912

913913
return resolve(
914914
\array_map(
915-
fn($key) => new \Exception("Error: {$key}"),
915+
fn ($key) => new \Exception("Error: {$key}"),
916916
$keys
917917
)
918918
);

0 commit comments

Comments
 (0)