Skip to content

Commit 127c7b0

Browse files
committed
2 parents 25ab2d1 + da056c5 commit 127c7b0

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

src/DataLoaderException.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
<?php
22

3-
43
namespace leinonen\DataLoader;
54

6-
75
class DataLoaderException extends \RuntimeException
86
{
9-
107
}

src/DataLoaderOptions.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ private function validateOptions($maxBatchSize, $shouldBatch, $shouldCache)
8080
*/
8181
private function validateBatchOption($shouldBatch)
8282
{
83-
if (!\is_bool($shouldBatch)) {
83+
if (! \is_bool($shouldBatch)) {
8484
throw new \InvalidArgumentException('Expected argument $shouldBatch to be a boolean');
8585
}
8686
}
@@ -90,7 +90,7 @@ private function validateBatchOption($shouldBatch)
9090
*/
9191
private function validateCacheOption($shouldCache)
9292
{
93-
if (!\is_bool($shouldCache)) {
93+
if (! \is_bool($shouldCache)) {
9494
throw new \InvalidArgumentException('Expected argument $shouldCache to be a boolean');
9595
}
9696
}
@@ -100,7 +100,7 @@ private function validateCacheOption($shouldCache)
100100
*/
101101
private function validateMaxBatchSizeOption($maxBatchSize)
102102
{
103-
if ($maxBatchSize !== null && !\is_int($maxBatchSize)) {
103+
if ($maxBatchSize !== null && ! \is_int($maxBatchSize)) {
104104
throw new \InvalidArgumentException('Expected argument $maxBatchSize to be null or an integer');
105105
}
106106
}

tests/Unit/DataLoaderAbuseTest.php

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

33
namespace leinonen\DataLoader\Tests\Unit;
44

5-
use leinonen\DataLoader\DataLoaderException;
65
use React\Promise\Promise;
76
use React\EventLoop\Factory;
87
use leinonen\DataLoader\CacheMap;
98
use React\EventLoop\LoopInterface;
109
use leinonen\DataLoader\DataLoader;
10+
use leinonen\DataLoader\DataLoaderException;
1111

1212
class DataLoaderAbuseTest extends \PHPUnit_Framework_TestCase
1313
{
@@ -62,7 +62,6 @@ public function load_many_requires_actual_keys()
6262
public function batch_function_must_return_a_promise_not_null()
6363
{
6464
$badLoader = $this->createDataLoader(function ($keys) {
65-
return null;
6665
});
6766

6867
$exception = null;

0 commit comments

Comments
 (0)