Commit 5755fdab by Taylor Otwell

Refactor Str::pool method.

parent c50246c6
...@@ -88,17 +88,13 @@ class Str { ...@@ -88,17 +88,13 @@ class Str {
*/ */
private static function pool($type = 'alnum') private static function pool($type = 'alnum')
{ {
if ($type == 'alnum') switch ($type)
{ {
return '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; case 'alnum':
} return '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
elseif ($type == 'alpha')
{ default:
return 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; return 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
}
else
{
throw new \Exception("Unrecognized random pool [$type].");
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment