Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Commit

Permalink
Merge branch 'cs/zendframework/zendframework#7014-empty-return-instea…
Browse files Browse the repository at this point in the history
…d-of-null-return' into develop

Close zendframework/zendframework#7014
  • Loading branch information
Ocramius committed Dec 16, 2014
4 parents 858b629 + 1ec6c6d + babe345 + 18732c1 commit d20b408
Show file tree
Hide file tree
Showing 12 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/Storage/Adapter/AbstractAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ public function getItem($key, & $success = null, & $casToken = null)
{
if (!$this->getOptions()->getReadable()) {
$success = false;
return null;
return;
}

$this->normalizeKey($key);
Expand Down
2 changes: 1 addition & 1 deletion src/Storage/Adapter/Apc.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ protected function internalGetItem(& $normalizedKey, & $success = null, & $casTo
$result = apc_fetch($internalKey, $success);

if (!$success) {
return null;
return;
}

$casToken = $result;
Expand Down
2 changes: 1 addition & 1 deletion src/Storage/Adapter/BlackHole.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public function getOptions()
public function getItem($key, & $success = null, & $casToken = null)
{
$success = false;
return null;
return;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Storage/Adapter/Dba.php
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ protected function internalGetItem(& $normalizedKey, & $success = null, & $casTo

if ($value === false) {
$success = false;
return null;
return;
}

$success = true;
Expand Down
2 changes: 1 addition & 1 deletion src/Storage/Adapter/Filesystem.php
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ protected function internalGetItem(& $normalizedKey, & $success = null, & $casTo
{
if (!$this->internalHasItem($normalizedKey)) {
$success = false;
return null;
return;
}

try {
Expand Down
2 changes: 1 addition & 1 deletion src/Storage/Adapter/Memcache.php
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ protected function internalGetItem(& $normalizedKey, & $success = null, & $casTo
$result = $memc->get($internalKey);
$success = ($result !== false);
if ($result === false) {
return null;
return;
}

$casToken = $result;
Expand Down
2 changes: 1 addition & 1 deletion src/Storage/Adapter/Memory.php
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ protected function internalGetItem(& $normalizedKey, & $success = null, & $casTo
}

if (!$success) {
return null;
return;
}

$casToken = $data[0];
Expand Down
4 changes: 2 additions & 2 deletions src/Storage/Adapter/MongoDb.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ protected function internalGetItem(& $normalizedKey, & $success = null, & $casTo
$success = false;

if (null === $result) {
return null;
return;
}

if (isset($result['expires'])) {
Expand All @@ -137,7 +137,7 @@ protected function internalGetItem(& $normalizedKey, & $success = null, & $casTo
if ($result['expires']->sec < time()) {
$this->internalRemoveItem($key);

return null;
return;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/Storage/Adapter/Redis.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ protected function internalGetItem(& $normalizedKey, & $success = null, & $casTo

if ($value === false) {
$success = false;
return null;
return;
}

$success = true;
Expand Down
4 changes: 2 additions & 2 deletions src/Storage/Adapter/RedisResourceManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -233,14 +233,14 @@ protected function extractPassword($resource, $serverUri)
}

if (! is_string($serverUri)) {
return null;
return;
}

// parse server from URI host{:?port}
$server = trim($serverUri);

if (strpos($server, '/') === 0) {
return null;
return;
}

//non unix domain socket connection
Expand Down
4 changes: 2 additions & 2 deletions src/Storage/Adapter/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,13 +152,13 @@ protected function internalGetItem(& $normalizedKey, & $success = null, & $casTo

if (!$cntr->offsetExists($ns)) {
$success = false;
return null;
return;
}

$data = $cntr->offsetGet($ns);
$success = array_key_exists($normalizedKey, $data);
if (!$success) {
return null;
return;
}

$casToken = $value = $data[$normalizedKey];
Expand Down
2 changes: 1 addition & 1 deletion test/Storage/Adapter/AbstractAdapterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ public function testInternalGetItemsCallsInternalGetItemForEachKey()
return $items[$k];
} else {
$success = false;
return null;
return;
}
}));
}
Expand Down

0 comments on commit d20b408

Please sign in to comment.