mirror of
https://github.com/predis/predis.git
synced 2026-09-09 18:07:42 +00:00
No need to check for PHP >= 7.0 anymore for persistent SSL.
Leaving assertParameters() for now but in general we should review how connection backends are initialized to simplify things and remove some protected methods, at least from base classes.
This commit is contained in:
@@ -58,11 +58,8 @@ class StreamConnection extends AbstractConnection
|
||||
case 'tcp':
|
||||
case 'redis':
|
||||
case 'unix':
|
||||
break;
|
||||
|
||||
case 'tls':
|
||||
case 'rediss':
|
||||
$this->assertSslSupport($parameters);
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -72,23 +69,6 @@ class StreamConnection extends AbstractConnection
|
||||
return $parameters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks needed conditions for SSL-encrypted connections.
|
||||
*
|
||||
* @param ParametersInterface $parameters Initialization parameters for the connection.
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
protected function assertSslSupport(ParametersInterface $parameters)
|
||||
{
|
||||
if (
|
||||
filter_var($parameters->persistent, FILTER_VALIDATE_BOOLEAN) &&
|
||||
version_compare(PHP_VERSION, '7.0.0beta') < 0
|
||||
) {
|
||||
throw new \InvalidArgumentException('Persistent SSL connections require PHP >= 7.0.0.');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user