Use early return
This commit is contained in:
parent
34b6ce9259
commit
5f891435f1
1 changed files with 7 additions and 6 deletions
|
@ -105,13 +105,14 @@ class DefaultRegion implements Region
|
|||
$result = array();
|
||||
|
||||
foreach ($collection->identifiers as $key) {
|
||||
$entry = $this->cache->fetch($this->getCacheEntryKey($key));
|
||||
if ($entry === false) {
|
||||
$result = null;
|
||||
break;
|
||||
} else {
|
||||
$result[] = $entry;
|
||||
$entryKey = $this->getCacheEntryKey($key);
|
||||
$entryValue = $this->cache->fetch($entryKey);
|
||||
|
||||
if ($entryValue === false) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$result[] = $entryValue;
|
||||
}
|
||||
|
||||
return $result;
|
||||
|
|
Loading…
Add table
Reference in a new issue