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:
Daniele Alessandri
2020-09-01 20:11:46 +02:00
parent 1285951243
commit eabbd100c9
-20
View File
@@ -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}
*/