@@ -107,7 +107,7 @@ function ($deferred, $namespace, &$expiredIds) use ($getId) {
107107 *
108108 * @return AdapterInterface
109109 */
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 )
111111 {
112112 $ opcache = new PhpFilesAdapter ($ namespace , $ defaultLifetime , $ directory , true );
113113 if (null !== $ logger ) {
@@ -118,7 +118,7 @@ public static function createSystemCache($namespace, $defaultLifetime, $version,
118118 return $ opcache ;
119119 }
120120
121- $ apcu = new ApcuAdapter ($ namespace , ( int ) $ defaultLifetime / 5 , $ version );
121+ $ apcu = new ApcuAdapter ($ namespace , $ defaultLifetime / 5 , $ version );
122122 if ('cli ' === \PHP_SAPI && !filter_var (ini_get ('apc.enable_cli ' ), FILTER_VALIDATE_BOOLEAN )) {
123123 $ apcu ->setLogger (new NullLogger ());
124124 } elseif (null !== $ logger ) {
@@ -128,11 +128,8 @@ public static function createSystemCache($namespace, $defaultLifetime, $version,
128128 return new ChainAdapter ([$ apcu , $ opcache ]);
129129 }
130130
131- public static function createConnection ($ dsn , array $ options = [])
131+ public static function createConnection (string $ dsn , array $ options = [])
132132 {
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- }
136133 if (0 === strpos ($ dsn , 'redis: ' ) || 0 === strpos ($ dsn , 'rediss: ' )) {
137134 return RedisAdapter::createConnection ($ dsn , $ options );
138135 }
0 commit comments