Skip to content

Commit 472e763

Browse files
committed
Enforcing $driverName to be a string on CacheManager
1 parent 1c5071c commit 472e763

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/phpFastCache/CacheManager.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,11 +369,15 @@ public static function getStaticAllDrivers()
369369
}
370370

371371
/**
372-
* @param string $driverName
372+
* @param $driverName
373373
* @return string
374+
* @throws \phpFastCache\Exceptions\phpFastCacheInvalidArgumentException
374375
*/
375376
public static function standardizeDriverName($driverName)
376377
{
378+
if(!is_string($driverName)){
379+
throw new phpFastCacheInvalidArgumentException(sprintf('Expected $driverName to be a string got "%s" instead', gettype($driverName)));
380+
}
377381
return ucfirst(strtolower(trim($driverName)));
378382
}
379383

0 commit comments

Comments
 (0)