Refactor Str::pool method.
This commit is contained in:
@@ -88,18 +88,14 @@ class Str {
|
||||
*/
|
||||
private static function pool($type = 'alnum')
|
||||
{
|
||||
if ($type == 'alnum')
|
||||
switch ($type)
|
||||
{
|
||||
case 'alnum':
|
||||
return '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
|
||||
}
|
||||
elseif ($type == 'alpha')
|
||||
{
|
||||
|
||||
default:
|
||||
return 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new \Exception("Unrecognized random pool [$type].");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user