src/Caching/ProxyCacheAdapter.php
protected function iteratorToArray($keys)
    {
        // Already array
        if (is_array($keys)) {
            return $keys;
        }

        // Handle iterable
        if ($keys instanceof Traversable) {
            return iterator_to_array($keys, false);
        }

        // Error
        $keysType = is_object($keys) ? get_class($keys) : gettype($keys);
        throw new InvalidArgumentException("Cache keys must be array or Traversable, \"{$keysType}\" given");
    }
protected function iteratorToArray($keys)
    {
        // Already array
        if (is_array($keys)) {
            return $keys;
        }

        // Handle iterable
        if ($keys instanceof Traversable) {
            return iterator_to_array($keys, false);
        }

        // Error
        $keysType = is_object($keys) ? get_class($keys) : gettype($keys);
        throw new InvalidArgumentException("Cache keys must be array or Traversable, \"{$keysType}\" given");
    }
protected function iteratorToArray ( $ keys ) { // Already array if ( is_array ( $ keys ) ) { return $ keys ; } // Handle iterable if ( $ keys instanceof Traversable ) { return iterator_to_array ( $ keys , false ) ; } // Error $ keysType = is_object ( $ keys ) ? get_class ( $ keys ) : gettype ( $ keys ) ; throw new InvalidArgumentException ( "Cache keys must be array or Traversable, \"{$keysType}\" given" ) ; }
Ensure that a list is cast to an array

@param iterable $keys
@return array
Ensure that a list is cast to an array