Skip to content

Commit a846c5f

Browse files
committed
Make the nested if more readable
1 parent da79b7f commit a846c5f

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/DataLoader.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,8 @@ public function load($key)
6262
throw new \InvalidArgumentException(self::class . '::load must be called with a value, but got null');
6363
}
6464

65-
if ($this->options->shouldCache()) {
66-
if ($this->promiseCache->get($key)) {
67-
return $this->promiseCache->get($key);
68-
}
65+
if ($this->options->shouldCache() && $this->promiseCache->get($key)) {
66+
return $this->promiseCache->get($key);
6967
}
7068

7169
$promise = new Promise(

0 commit comments

Comments
 (0)