Skip to content

Commit

Permalink
Change default serialization type to none as it implicitly was before
Browse files Browse the repository at this point in the history
Fixes #417
  • Loading branch information
curry684 committed Apr 23, 2018
1 parent 59f1630 commit ed4c925
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions DependencyInjection/SncRedisExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,7 @@ protected function loadSwiftMailer(array $config, ContainerBuilder $container)
public function loadSerializationType($type)
{
$types = array(
'default' => \Redis::SERIALIZER_NONE,
'none' => \Redis::SERIALIZER_NONE,
'php' => \Redis::SERIALIZER_PHP
);
Expand All @@ -451,20 +452,11 @@ public function loadSerializationType($type)
$types['igbinary'] = \Redis::SERIALIZER_IGBINARY;
}

// allow user to pass in default serialization in which case we should automatically decide for them
if ('default' == $type) {
return isset($types['igbinary']) ? $types['igbinary'] : $types['php'];
} elseif (array_key_exists($type, $types)) {
if (array_key_exists($type, $types)) {
return $types[$type];
}

throw new InvalidConfigurationException(
sprintf(
'%s in not a valid serializer. Valid serializers: %s',
$type,
implode(", ", array_keys($types))
)
);
throw new InvalidConfigurationException(sprintf('%s in not a valid serializer. Valid serializers: %s', $type, implode(", ", array_keys($types))));
}

/* Loads the profiler storage configuration.
Expand Down

0 comments on commit ed4c925

Please sign in to comment.