@@ -29,10 +29,10 @@ |
||
| 29 | 29 | { |
| 30 | 30 | $parts = parse_url($url); |
| 31 | 31 | |
| 32 | - if (! isset($parts['host']) || strlen($parts['host']) == 0) { |
|
| 32 | + if (!isset($parts['host']) || strlen($parts['host']) == 0) { |
|
| 33 | 33 | throw new InvalidUrlException('This URL does not contain a host part'); |
| 34 | 34 | } |
| 35 | - if (! isset($parts['scheme']) || strlen($parts['scheme']) == 0) { |
|
| 35 | + if (!isset($parts['scheme']) || strlen($parts['scheme']) == 0) { |
|
| 36 | 36 | throw new InvalidUrlException('This URL does not contain a scheme part'); |
| 37 | 37 | } |
| 38 | 38 | |
@@ -1,9 +1,9 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * This file is part of the PHP Generics package. |
|
| 4 | - * |
|
| 5 | - * @package Generics |
|
| 6 | - */ |
|
| 3 | + * This file is part of the PHP Generics package. |
|
| 4 | + * |
|
| 5 | + * @package Generics |
|
| 6 | + */ |
|
| 7 | 7 | namespace Generics\Util; |
| 8 | 8 | |
| 9 | 9 | /** |
@@ -52,8 +52,8 @@ discard block |
||
| 52 | 52 | setlocale(LC_ALL, "C"); |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | - for ($i = 32; $i < 256; $i ++) { |
|
| 56 | - if (($allowed == RandomString::ASCII && ! ctype_alnum(chr($i))) || (! ctype_print(chr($i)))) { |
|
| 55 | + for ($i = 32; $i < 256; $i++) { |
|
| 56 | + if (($allowed == RandomString::ASCII && !ctype_alnum(chr($i))) || (!ctype_print(chr($i)))) { |
|
| 57 | 57 | continue; |
| 58 | 58 | } |
| 59 | 59 | $allowedChars[] = $i; |
@@ -67,12 +67,12 @@ discard block |
||
| 67 | 67 | $i = $length; |
| 68 | 68 | while ($i > 0) { |
| 69 | 69 | $index = mt_rand(0, count($allowedChars) - 1); |
| 70 | - if (! $repeatable && in_array($index, $used)) { |
|
| 70 | + if (!$repeatable && in_array($index, $used)) { |
|
| 71 | 71 | continue; |
| 72 | 72 | } |
| 73 | 73 | $string .= chr($allowedChars[$index]); |
| 74 | 74 | $used[] = $i; |
| 75 | - $i --; |
|
| 75 | + $i--; |
|
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | return $string; |