Refactor Str::pool method.

This commit is contained in:
Taylor Otwell
2011-07-07 07:16:20 -07:00
parent c50246c694
commit 5755fdaba0

View File

@@ -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].");
}
}
}