Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
reduce arguments by ref
  • Loading branch information
marc-mabe committed Apr 18, 2016
commit b5768ea0f629300e10a3b73b10a3793e0089a2f1
42 changes: 21 additions & 21 deletions src/Storage/Adapter/AbstractAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ public function getItem($key, & $success = null, & $casToken = null)
* @return mixed Data on success, null on failure
* @throws Exception\ExceptionInterface
*/
abstract protected function internalGetItem(& $normalizedKey, & $success = null, & $casToken = null);
abstract protected function internalGetItem($normalizedKey, & $success = null, & $casToken = null);

/**
* Get multiple items.
Expand Down Expand Up @@ -429,7 +429,7 @@ public function getItems(array $keys)
* @return array Associative array of keys and values
* @throws Exception\ExceptionInterface
*/
protected function internalGetItems(array & $normalizedKeys)
protected function internalGetItems(array $normalizedKeys)
{
$success = null;
$result = [];
Expand Down Expand Up @@ -486,7 +486,7 @@ public function hasItem($key)
* @return bool
* @throws Exception\ExceptionInterface
*/
protected function internalHasItem(& $normalizedKey)
protected function internalHasItem($normalizedKey)
{
$success = null;
$this->internalGetItem($normalizedKey, $success);
Expand Down Expand Up @@ -536,7 +536,7 @@ public function hasItems(array $keys)
* @return array Array of found keys
* @throws Exception\ExceptionInterface
*/
protected function internalHasItems(array & $normalizedKeys)
protected function internalHasItems(array $normalizedKeys)
{
$result = [];
foreach ($normalizedKeys as $normalizedKey) {
Expand Down Expand Up @@ -590,7 +590,7 @@ public function getMetadata($key)
* @return array|bool Metadata on success, false on failure
* @throws Exception\ExceptionInterface
*/
protected function internalGetMetadata(& $normalizedKey)
protected function internalGetMetadata($normalizedKey)
{
if (!$this->internalHasItem($normalizedKey)) {
return false;
Expand Down Expand Up @@ -642,7 +642,7 @@ public function getMetadatas(array $keys)
* @return array Associative array of keys and metadata
* @throws Exception\ExceptionInterface
*/
protected function internalGetMetadatas(array & $normalizedKeys)
protected function internalGetMetadatas(array $normalizedKeys)
{
$result = [];
foreach ($normalizedKeys as $normalizedKey) {
Expand Down Expand Up @@ -702,7 +702,7 @@ public function setItem($key, $value)
* @return bool
* @throws Exception\ExceptionInterface
*/
abstract protected function internalSetItem(& $normalizedKey, & $value);
abstract protected function internalSetItem($normalizedKey, $value);

/**
* Store multiple items.
Expand Down Expand Up @@ -747,7 +747,7 @@ public function setItems(array $keyValuePairs)
* @return array Array of not stored keys
* @throws Exception\ExceptionInterface
*/
protected function internalSetItems(array & $normalizedKeyValuePairs)
protected function internalSetItems(array $normalizedKeyValuePairs)
{
$failedKeys = [];
foreach ($normalizedKeyValuePairs as $normalizedKey => $value) {
Expand Down Expand Up @@ -804,7 +804,7 @@ public function addItem($key, $value)
* @return bool
* @throws Exception\ExceptionInterface
*/
protected function internalAddItem(& $normalizedKey, & $value)
protected function internalAddItem($normalizedKey, $value)
{
if ($this->internalHasItem($normalizedKey)) {
return false;
Expand Down Expand Up @@ -855,7 +855,7 @@ public function addItems(array $keyValuePairs)
* @return array Array of not stored keys
* @throws Exception\ExceptionInterface
*/
protected function internalAddItems(array & $normalizedKeyValuePairs)
protected function internalAddItems(array $normalizedKeyValuePairs)
{
$result = [];
foreach ($normalizedKeyValuePairs as $normalizedKey => $value) {
Expand Down Expand Up @@ -912,7 +912,7 @@ public function replaceItem($key, $value)
* @return bool
* @throws Exception\ExceptionInterface
*/
protected function internalReplaceItem(& $normalizedKey, & $value)
protected function internalReplaceItem($normalizedKey, $value)
{
if (!$this->internalhasItem($normalizedKey)) {
return false;
Expand Down Expand Up @@ -964,7 +964,7 @@ public function replaceItems(array $keyValuePairs)
* @return array Array of not stored keys
* @throws Exception\ExceptionInterface
*/
protected function internalReplaceItems(array & $normalizedKeyValuePairs)
protected function internalReplaceItems(array $normalizedKeyValuePairs)
{
$result = [];
foreach ($normalizedKeyValuePairs as $normalizedKey => $value) {
Expand Down Expand Up @@ -1027,7 +1027,7 @@ public function checkAndSetItem($token, $key, $value)
* @see getItem()
* @see setItem()
*/
protected function internalCheckAndSetItem(& $token, & $normalizedKey, & $value)
protected function internalCheckAndSetItem($token, $normalizedKey, $value)
{
$oldValue = $this->internalGetItem($normalizedKey);
if ($oldValue !== $token) {
Expand Down Expand Up @@ -1080,7 +1080,7 @@ public function touchItem($key)
* @return bool
* @throws Exception\ExceptionInterface
*/
protected function internalTouchItem(& $normalizedKey)
protected function internalTouchItem($normalizedKey)
{
$success = null;
$value = $this->internalGetItem($normalizedKey, $success);
Expand Down Expand Up @@ -1133,7 +1133,7 @@ public function touchItems(array $keys)
* @return array Array of not updated keys
* @throws Exception\ExceptionInterface
*/
protected function internalTouchItems(array & $normalizedKeys)
protected function internalTouchItems(array $normalizedKeys)
{
$result = [];
foreach ($normalizedKeys as $normalizedKey) {
Expand Down Expand Up @@ -1187,7 +1187,7 @@ public function removeItem($key)
* @return bool
* @throws Exception\ExceptionInterface
*/
abstract protected function internalRemoveItem(& $normalizedKey);
abstract protected function internalRemoveItem($normalizedKey);

/**
* Remove multiple items.
Expand Down Expand Up @@ -1231,7 +1231,7 @@ public function removeItems(array $keys)
* @return array Array of not removed keys
* @throws Exception\ExceptionInterface
*/
protected function internalRemoveItems(array & $normalizedKeys)
protected function internalRemoveItems(array $normalizedKeys)
{
$result = [];
foreach ($normalizedKeys as $normalizedKey) {
Expand Down Expand Up @@ -1288,7 +1288,7 @@ public function incrementItem($key, $value)
* @return int|bool The new value on success, false on failure
* @throws Exception\ExceptionInterface
*/
protected function internalIncrementItem(& $normalizedKey, & $value)
protected function internalIncrementItem($normalizedKey, $value)
{
$success = null;
$value = (int) $value;
Expand Down Expand Up @@ -1347,7 +1347,7 @@ public function incrementItems(array $keyValuePairs)
* @return array Associative array of keys and new values
* @throws Exception\ExceptionInterface
*/
protected function internalIncrementItems(array & $normalizedKeyValuePairs)
protected function internalIncrementItems(array $normalizedKeyValuePairs)
{
$result = [];
foreach ($normalizedKeyValuePairs as $normalizedKey => $value) {
Expand Down Expand Up @@ -1405,7 +1405,7 @@ public function decrementItem($key, $value)
* @return int|bool The new value on success, false on failure
* @throws Exception\ExceptionInterface
*/
protected function internalDecrementItem(& $normalizedKey, & $value)
protected function internalDecrementItem($normalizedKey, $value)
{
$success = null;
$value = (int) $value;
Expand Down Expand Up @@ -1464,7 +1464,7 @@ public function decrementItems(array $keyValuePairs)
* @return array Associative array of keys and new values
* @throws Exception\ExceptionInterface
*/
protected function internalDecrementItems(array & $normalizedKeyValuePairs)
protected function internalDecrementItems(array $normalizedKeyValuePairs)
{
$result = [];
foreach ($normalizedKeyValuePairs as $normalizedKey => $value) {
Expand Down
14 changes: 7 additions & 7 deletions src/Storage/Adapter/AbstractZendServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ abstract class AbstractZendServer extends AbstractAdapter
* @return mixed Data on success, null on failure
* @throws Exception\ExceptionInterface
*/
protected function internalGetItem(& $normalizedKey, & $success = null, & $casToken = null)
protected function internalGetItem($normalizedKey, & $success = null, & $casToken = null)
{
$namespace = $this->getOptions()->getNamespace();
$prefix = ($namespace === '') ? '' : $namespace . self::NAMESPACE_SEPARATOR;
Expand All @@ -57,7 +57,7 @@ protected function internalGetItem(& $normalizedKey, & $success = null, & $casTo
* @return array Associative array of keys and values
* @throws Exception\ExceptionInterface
*/
protected function internalGetItems(array & $normalizedKeys)
protected function internalGetItems(array $normalizedKeys)
{
$namespace = $this->getOptions()->getNamespace();
if ($namespace === '') {
Expand Down Expand Up @@ -87,7 +87,7 @@ protected function internalGetItems(array & $normalizedKeys)
* @return bool
* @throws Exception\ExceptionInterface
*/
protected function internalHasItem(& $normalizedKey)
protected function internalHasItem($normalizedKey)
{
$namespace = $this->getOptions()->getNamespace();
$prefix = ($namespace === '') ? '' : $namespace . self::NAMESPACE_SEPARATOR;
Expand All @@ -101,7 +101,7 @@ protected function internalHasItem(& $normalizedKey)
* @return array Array of found keys
* @throws Exception\ExceptionInterface
*/
protected function internalHasItems(array & $normalizedKeys)
protected function internalHasItems(array $normalizedKeys)
{
$namespace = $this->getOptions()->getNamespace();
if ($namespace === '') {
Expand Down Expand Up @@ -134,7 +134,7 @@ protected function internalHasItems(array & $normalizedKeys)
* @triggers getMetadatas.post(PostEvent)
* @triggers getMetadatas.exception(ExceptionEvent)
*/
protected function internalGetMetadatas(array & $normalizedKeys)
protected function internalGetMetadatas(array $normalizedKeys)
{
$namespace = $this->getOptions()->getNamespace();
if ($namespace === '') {
Expand Down Expand Up @@ -168,7 +168,7 @@ protected function internalGetMetadatas(array & $normalizedKeys)
* @return bool
* @throws Exception\ExceptionInterface
*/
protected function internalSetItem(& $normalizedKey, & $value)
protected function internalSetItem($normalizedKey, $value)
{
$options = $this->getOptions();
$namespace = $options->getNamespace();
Expand All @@ -184,7 +184,7 @@ protected function internalSetItem(& $normalizedKey, & $value)
* @return bool
* @throws Exception\ExceptionInterface
*/
protected function internalRemoveItem(& $normalizedKey)
protected function internalRemoveItem($normalizedKey)
{
$namespace = $this->getOptions()->getNamespace();
$prefix = ($namespace === '') ? '' : $namespace . self::NAMESPACE_SEPARATOR;
Expand Down
32 changes: 16 additions & 16 deletions src/Storage/Adapter/Apc.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ public function clearByPrefix($prefix)
* @return mixed Data on success, null on failure
* @throws Exception\ExceptionInterface
*/
protected function internalGetItem(& $normalizedKey, & $success = null, & $casToken = null)
protected function internalGetItem($normalizedKey, & $success = null, & $casToken = null)
{
$options = $this->getOptions();
$namespace = $options->getNamespace();
Expand All @@ -235,7 +235,7 @@ protected function internalGetItem(& $normalizedKey, & $success = null, & $casTo
* @return array Associative array of keys and values
* @throws Exception\ExceptionInterface
*/
protected function internalGetItems(array & $normalizedKeys)
protected function internalGetItems(array $normalizedKeys)
{
$options = $this->getOptions();
$namespace = $options->getNamespace();
Expand Down Expand Up @@ -268,7 +268,7 @@ protected function internalGetItems(array & $normalizedKeys)
* @return bool
* @throws Exception\ExceptionInterface
*/
protected function internalHasItem(& $normalizedKey)
protected function internalHasItem($normalizedKey)
{
$options = $this->getOptions();
$namespace = $options->getNamespace();
Expand All @@ -283,7 +283,7 @@ protected function internalHasItem(& $normalizedKey)
* @return array Array of found keys
* @throws Exception\ExceptionInterface
*/
protected function internalHasItems(array & $normalizedKeys)
protected function internalHasItems(array $normalizedKeys)
{
$options = $this->getOptions();
$namespace = $options->getNamespace();
Expand Down Expand Up @@ -317,7 +317,7 @@ protected function internalHasItems(array & $normalizedKeys)
* @return array|bool Metadata on success, false on failure
* @throws Exception\ExceptionInterface
*/
protected function internalGetMetadata(& $normalizedKey)
protected function internalGetMetadata($normalizedKey)
{
$options = $this->getOptions();
$namespace = $options->getNamespace();
Expand Down Expand Up @@ -352,7 +352,7 @@ protected function internalGetMetadata(& $normalizedKey)
* @triggers getMetadatas.post(PostEvent)
* @triggers getMetadatas.exception(ExceptionEvent)
*/
protected function internalGetMetadatas(array & $normalizedKeys)
protected function internalGetMetadatas(array $normalizedKeys)
{
$keysRegExp = [];
foreach ($normalizedKeys as $normalizedKey) {
Expand Down Expand Up @@ -397,7 +397,7 @@ protected function internalGetMetadatas(array & $normalizedKeys)
* @return bool
* @throws Exception\ExceptionInterface
*/
protected function internalSetItem(& $normalizedKey, & $value)
protected function internalSetItem($normalizedKey, $value)
{
$options = $this->getOptions();
$namespace = $options->getNamespace();
Expand All @@ -422,7 +422,7 @@ protected function internalSetItem(& $normalizedKey, & $value)
* @return array Array of not stored keys
* @throws Exception\ExceptionInterface
*/
protected function internalSetItems(array & $normalizedKeyValuePairs)
protected function internalSetItems(array $normalizedKeyValuePairs)
{
$options = $this->getOptions();
$namespace = $options->getNamespace();
Expand Down Expand Up @@ -457,7 +457,7 @@ protected function internalSetItems(array & $normalizedKeyValuePairs)
* @return bool
* @throws Exception\ExceptionInterface
*/
protected function internalAddItem(& $normalizedKey, & $value)
protected function internalAddItem($normalizedKey, $value)
{
$options = $this->getOptions();
$namespace = $options->getNamespace();
Expand Down Expand Up @@ -486,7 +486,7 @@ protected function internalAddItem(& $normalizedKey, & $value)
* @return array Array of not stored keys
* @throws Exception\ExceptionInterface
*/
protected function internalAddItems(array & $normalizedKeyValuePairs)
protected function internalAddItems(array $normalizedKeyValuePairs)
{
$options = $this->getOptions();
$namespace = $options->getNamespace();
Expand Down Expand Up @@ -521,7 +521,7 @@ protected function internalAddItems(array & $normalizedKeyValuePairs)
* @return bool
* @throws Exception\ExceptionInterface
*/
protected function internalReplaceItem(& $normalizedKey, & $value)
protected function internalReplaceItem($normalizedKey, $value)
{
$options = $this->getOptions();
$namespace = $options->getNamespace();
Expand Down Expand Up @@ -550,7 +550,7 @@ protected function internalReplaceItem(& $normalizedKey, & $value)
* @return bool
* @throws Exception\ExceptionInterface
*/
protected function internalRemoveItem(& $normalizedKey)
protected function internalRemoveItem($normalizedKey)
{
$options = $this->getOptions();
$namespace = $options->getNamespace();
Expand All @@ -565,7 +565,7 @@ protected function internalRemoveItem(& $normalizedKey)
* @return array Array of not removed keys
* @throws Exception\ExceptionInterface
*/
protected function internalRemoveItems(array & $normalizedKeys)
protected function internalRemoveItems(array $normalizedKeys)
{
$options = $this->getOptions();
$namespace = $options->getNamespace();
Expand Down Expand Up @@ -598,7 +598,7 @@ protected function internalRemoveItems(array & $normalizedKeys)
* @return int|bool The new value on success, false on failure
* @throws Exception\ExceptionInterface
*/
protected function internalIncrementItem(& $normalizedKey, & $value)
protected function internalIncrementItem($normalizedKey, $value)
{
$options = $this->getOptions();
$namespace = $options->getNamespace();
Expand Down Expand Up @@ -629,7 +629,7 @@ protected function internalIncrementItem(& $normalizedKey, & $value)
* @return int|bool The new value on success, false on failure
* @throws Exception\ExceptionInterface
*/
protected function internalDecrementItem(& $normalizedKey, & $value)
protected function internalDecrementItem($normalizedKey, $value)
{
$options = $this->getOptions();
$namespace = $options->getNamespace();
Expand Down Expand Up @@ -743,7 +743,7 @@ protected function normalizeMetadata(array & $metadata)
* @see getItem()
* @see setItem()
*/
protected function internalCheckAndSetItem(& $token, & $normalizedKey, & $value)
protected function internalCheckAndSetItem($token, $normalizedKey, $value)
{
if (is_int($token) && is_int($value)) {
return apc_cas($normalizedKey, $token, $value);
Expand Down
Loading