@@ -107,7 +107,7 @@ function ($deferred, $namespace, &$expiredIds) use ($getId) {
107
107
*
108
108
* @return AdapterInterface
109
109
*/
110
- public static function createSystemCache ($ namespace , $ defaultLifetime , $ version , $ directory , LoggerInterface $ logger = null )
110
+ public static function createSystemCache (string $ namespace , int $ defaultLifetime , string $ version , string $ directory , LoggerInterface $ logger = null )
111
111
{
112
112
$ opcache = new PhpFilesAdapter ($ namespace , $ defaultLifetime , $ directory , true );
113
113
if (null !== $ logger ) {
@@ -118,7 +118,7 @@ public static function createSystemCache($namespace, $defaultLifetime, $version,
118
118
return $ opcache ;
119
119
}
120
120
121
- $ apcu = new ApcuAdapter ($ namespace , ( int ) $ defaultLifetime / 5 , $ version );
121
+ $ apcu = new ApcuAdapter ($ namespace , $ defaultLifetime / 5 , $ version );
122
122
if ('cli ' === \PHP_SAPI && !filter_var (ini_get ('apc.enable_cli ' ), FILTER_VALIDATE_BOOLEAN )) {
123
123
$ apcu ->setLogger (new NullLogger ());
124
124
} elseif (null !== $ logger ) {
@@ -128,11 +128,8 @@ public static function createSystemCache($namespace, $defaultLifetime, $version,
128
128
return new ChainAdapter ([$ apcu , $ opcache ]);
129
129
}
130
130
131
- public static function createConnection ($ dsn , array $ options = [])
131
+ public static function createConnection (string $ dsn , array $ options = [])
132
132
{
133
- if (!\is_string ($ dsn )) {
134
- throw new InvalidArgumentException (sprintf ('The %s() method expect argument #1 to be string, %s given. ' , __METHOD__ , \gettype ($ dsn )));
135
- }
136
133
if (0 === strpos ($ dsn , 'redis: ' ) || 0 === strpos ($ dsn , 'rediss: ' )) {
137
134
return RedisAdapter::createConnection ($ dsn , $ options );
138
135
}
0 commit comments