@@ -203,21 +203,21 @@ public static function getInstance($driver = 'auto', array $config = [], $instan
203203 {
204204 static $ badPracticeOmeter = [];
205205
206- if ($ instanceId !== null && !is_string ($ instanceId )) {
206+ if ($ instanceId !== null && !\ is_string ($ instanceId )) {
207207 throw new phpFastCacheInvalidArgumentException ('The Instance ID must be a string ' );
208208 }
209209
210210 /**
211211 * @todo: Standardize a method for driver name
212212 */
213213 $ driver = self ::standardizeDriverName ($ driver );
214- $ config = array_merge (self ::$ config , $ config );
214+ $ config = \ array_merge (self ::$ config , $ config );
215215 self ::validateConfig ($ config );
216216 if (!$ driver || $ driver === 'Auto ' ) {
217217 $ driver = self ::getAutoClass ($ config );
218218 }
219219
220- $ instance = $ instanceId ?: crc32 ($ driver . serialize ($ config ));
220+ $ instance = $ instanceId ?: crc32 ($ driver . \ serialize ($ config ));
221221
222222 if (!isset (self ::$ instances [ $ instance ])) {
223223 $ badPracticeOmeter [ $ driver ] = 1 ;
@@ -277,7 +277,7 @@ public static function getInstance($driver = 'auto', array $config = [], $instan
277277 */
278278 public static function getInstanceById ($ instanceId ): ExtendedCacheItemPoolInterface
279279 {
280- if ($ instanceId !== null && !is_string ($ instanceId )) {
280+ if ($ instanceId !== null && !\ is_string ($ instanceId )) {
281281 throw new phpFastCacheInvalidArgumentException ('The Instance ID must be a string ' );
282282 }
283283
@@ -347,7 +347,7 @@ public static function getAutoClass(array $config = [])
347347 */
348348 public static function __callStatic ($ name , $ arguments )
349349 {
350- $ options = (array_key_exists (0 , $ arguments ) && is_array ($ arguments ) ? $ arguments [ 0 ] : []);
350+ $ options = (\ array_key_exists (0 , $ arguments ) && \ is_array ($ arguments ) ? $ arguments [ 0 ] : []);
351351
352352 return self ::getInstance ($ name , $ options );
353353 }
@@ -360,7 +360,7 @@ public static function clearInstances()
360360 self ::$ instances = [];
361361
362362 gc_collect_cycles ();
363- return !count (self ::$ instances );
363+ return !\ count (self ::$ instances );
364364 }
365365
366366 /**
@@ -376,7 +376,7 @@ public static function getNamespacePath()
376376 */
377377 public static function setNamespacePath ($ path )
378378 {
379- self ::$ namespacePath = trim ($ path , "\\" ) . '\\' ;
379+ self ::$ namespacePath = \ trim ($ path , "\\" ) . '\\' ;
380380 }
381381
382382 /**
@@ -386,9 +386,9 @@ public static function setNamespacePath($path)
386386 */
387387 public static function setDefaultConfig ($ name , $ value = null )
388388 {
389- if (is_array ($ name )) {
390- self ::$ config = array_merge (self ::$ config , $ name );
391- } else if (is_string ($ name )) {
389+ if (\ is_array ($ name )) {
390+ self ::$ config = \ array_merge (self ::$ config , $ name );
391+ } else if (\ is_string ($ name )) {
392392 self ::$ config [ $ name ] = $ value ;
393393 } else {
394394 throw new phpFastCacheInvalidArgumentException ('Invalid variable type: $name ' );
@@ -450,7 +450,7 @@ public static function getStaticSystemDrivers()
450450 */
451451 public static function getStaticAllDrivers ()
452452 {
453- return array_merge (self ::getStaticSystemDrivers (), [
453+ return \ array_merge (self ::getStaticSystemDrivers (), [
454454 'Devtrue ' ,
455455 'Devfalse ' ,
456456 'Cookie ' ,
@@ -464,10 +464,10 @@ public static function getStaticAllDrivers()
464464 */
465465 public static function standardizeDriverName ($ driverName )
466466 {
467- if (!is_string ($ driverName )) {
468- throw new phpFastCacheInvalidArgumentException (sprintf ('Expected $driverName to be a string got "%s" instead ' , gettype ($ driverName )));
467+ if (!\ is_string ($ driverName )) {
468+ throw new phpFastCacheInvalidArgumentException (sprintf ('Expected $driverName to be a string got "%s" instead ' , \ gettype ($ driverName )));
469469 }
470- return ucfirst (strtolower (trim ($ driverName )));
470+ return \ ucfirst (\ strtolower (\ trim ($ driverName )));
471471 }
472472
473473 /**
@@ -486,47 +486,47 @@ protected static function validateConfig(array $config)
486486 case 'ignoreSymfonyNotice ' :
487487 case 'htaccess ' :
488488 case 'compress_data ' :
489- if (!is_bool ($ configValue )) {
489+ if (!\ is_bool ($ configValue )) {
490490 throw new phpFastCacheInvalidConfigurationException ("{$ configName } must be a boolean " );
491491 }
492492 break ;
493493 case 'defaultTtl ' :
494- if (!is_numeric ($ configValue )) {
494+ if (!\ is_numeric ($ configValue )) {
495495 throw new phpFastCacheInvalidConfigurationException ("{$ configName } must be numeric " );
496496 }
497497 break ;
498498 case 'defaultKeyHashFunction ' :
499- if (!is_string ($ configValue ) && !function_exists ($ configValue )) {
499+ if (!\ is_string ($ configValue ) && !\ function_exists ($ configValue )) {
500500 throw new phpFastCacheInvalidConfigurationException ("{$ configName } must be a valid function name string " );
501501 }
502502 break ;
503503 case 'securityKey ' :
504504 case 'path ' :
505- if (!is_string ($ configValue ) && (!is_bool ($ configValue ) || $ configValue )) {
505+ if (!\ is_string ($ configValue ) && (!\ is_bool ($ configValue ) || $ configValue )) {
506506 throw new phpFastCacheInvalidConfigurationException ("{$ configName } must be a string or a false boolean " );
507507 }
508508 break ;
509509 case 'default_chmod ' :
510510 case 'limited_memory_each_object ' :
511- if (!is_int ($ configValue )) {
511+ if (!\ is_int ($ configValue )) {
512512 throw new phpFastCacheInvalidConfigurationException ("{$ configName } must be an integer " );
513513 }
514514 break ;
515515 case 'fallback ' :
516- if (!is_bool ($ configValue ) && !is_string ($ configValue )) {
516+ if (!\ is_bool ($ configValue ) && !\ is_string ($ configValue )) {
517517 throw new phpFastCacheInvalidConfigurationException ("{$ configName } must be a boolean or string " );
518518 }
519519 break ;
520520 case 'cacheFileExtension ' :
521- if (!is_string ($ configValue )) {
521+ if (!\ is_string ($ configValue )) {
522522 throw new phpFastCacheInvalidConfigurationException ("{$ configName } must be a boolean " );
523523 }
524- if (strpos ($ configValue , '. ' ) !== false ) {
524+ if (\ strpos ($ configValue , '. ' ) !== false ) {
525525 throw new phpFastCacheInvalidConfigurationException ("{$ configName } cannot contain a dot \". \"" );
526526 }
527- if (!in_array ($ configValue , self ::$ safeFileExtensions )) {
527+ if (!\ in_array ($ configValue , self ::$ safeFileExtensions )) {
528528 throw new phpFastCacheInvalidConfigurationException (
529- "{$ configName } is not a safe extension, currently allowed extension: " . implode (', ' , self ::$ safeFileExtensions )
529+ "{$ configName } is not a safe extension, currently allowed extension: " . \ implode (', ' , self ::$ safeFileExtensions )
530530 );
531531 }
532532 break ;
0 commit comments