Skip to content

Commit

Permalink
Fixing switch
Browse files Browse the repository at this point in the history
  • Loading branch information
cryptiklemur committed Nov 30, 2013
1 parent 358d794 commit a5dcceb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/GiantBomb/Client/GiantBombClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,8 @@ private function createCache( array $config )

$redis->setOption( Redis::OPT_SERIALIZER, Redis::SERIALIZER_PHP );
$cache = new RedisCache();
$cache->setRedis( $redis );
$cache->setRedis( $redis );
break;
case 'memcached':
if( !class_exists( '\Memcached' ) ){
throw new \LogicException( "Memcached is required." );
Expand All @@ -229,7 +230,7 @@ private function createCache( array $config )
$memcached = new Memcached( $config[ 'persistent' ] ? serialize( $config[ 'servers' ] ) : null );

foreach( $config[ 'servers' ] as $server ) {
$memcached->addServer( $server[ 'host' ], $server[ 'port' ], $server[ 'weight' ] );
$memcached->addServer( $server[ 'host' ], $server[ 'port' ], isset( $server[ 'weight' ] ) ? $server[ 'weight' ] : null );
}

if( null !== $config[ 'options' ] ) {
Expand All @@ -238,6 +239,7 @@ private function createCache( array $config )

$cache = new MemcachedCache();
$cache->setMemcached( $memcached );
break;
default:
throw new \InvalidArgumentException( sprintf( "%s is not a valid cache type. ", $config[ 'type' ] ) );
}
Expand Down

0 comments on commit a5dcceb

Please sign in to comment.