@@ -38,8 +38,7 @@ |
||
38 | 38 | * |
39 | 39 | * @return string |
40 | 40 | */ |
41 | - function random_bytes($bytes) |
|
42 | - { |
|
41 | + function random_bytes($bytes) { |
|
43 | 42 | try { |
44 | 43 | $bytes = RandomCompat_intval($bytes); |
45 | 44 | } catch (TypeError $ex) { |
@@ -40,8 +40,7 @@ |
||
40 | 40 | * |
41 | 41 | * @return string |
42 | 42 | */ |
43 | - function random_bytes($bytes) |
|
44 | - { |
|
43 | + function random_bytes($bytes) { |
|
45 | 44 | try { |
46 | 45 | $bytes = RandomCompat_intval($bytes); |
47 | 46 | } catch (TypeError $ex) { |
@@ -39,8 +39,7 @@ |
||
39 | 39 | * |
40 | 40 | * @return string |
41 | 41 | */ |
42 | - function random_bytes($bytes) |
|
43 | - { |
|
42 | + function random_bytes($bytes) { |
|
44 | 43 | try { |
45 | 44 | $bytes = RandomCompat_intval($bytes); |
46 | 45 | } catch (TypeError $ex) { |
@@ -44,8 +44,7 @@ |
||
44 | 44 | * |
45 | 45 | * @return string |
46 | 46 | */ |
47 | - function random_bytes($bytes) |
|
48 | - { |
|
47 | + function random_bytes($bytes) { |
|
49 | 48 | static $fp = null; |
50 | 49 | /** |
51 | 50 | * This block should only be run once |
@@ -38,8 +38,7 @@ |
||
38 | 38 | * |
39 | 39 | * @return int |
40 | 40 | */ |
41 | - function random_int($min, $max) |
|
42 | - { |
|
41 | + function random_int($min, $max) { |
|
43 | 42 | /** |
44 | 43 | * Type and input logic checks |
45 | 44 | * |
@@ -28,21 +28,18 @@ |
||
28 | 28 | |
29 | 29 | if (!class_exists('Error', false)) { |
30 | 30 | // We can't really avoid making this extend Exception in PHP 5. |
31 | - class Error extends Exception |
|
32 | - { |
|
31 | + class Error extends Exception { |
|
33 | 32 | |
34 | 33 | } |
35 | 34 | } |
36 | 35 | |
37 | 36 | if (!class_exists('TypeError', false)) { |
38 | 37 | if (is_subclass_of('Error', 'Exception')) { |
39 | - class TypeError extends Error |
|
40 | - { |
|
38 | + class TypeError extends Error { |
|
41 | 39 | |
42 | 40 | } |
43 | 41 | } else { |
44 | - class TypeError extends Exception |
|
45 | - { |
|
42 | + class TypeError extends Exception { |
|
46 | 43 | |
47 | 44 | } |
48 | 45 | } |
@@ -45,8 +45,7 @@ |
||
45 | 45 | * |
46 | 46 | * @throws TypeError |
47 | 47 | */ |
48 | - function RandomCompat_intval($number, $fail_open = false) |
|
49 | - { |
|
48 | + function RandomCompat_intval($number, $fail_open = false) { |
|
50 | 49 | if (is_int($number) || is_float($number)) { |
51 | 50 | $number += 0; |
52 | 51 | } elseif (is_numeric($number)) { |
@@ -40,8 +40,7 @@ |
||
40 | 40 | * |
41 | 41 | * @return string |
42 | 42 | */ |
43 | - function random_bytes($bytes) |
|
44 | - { |
|
43 | + function random_bytes($bytes) { |
|
45 | 44 | try { |
46 | 45 | $bytes = RandomCompat_intval($bytes); |
47 | 46 | } catch (TypeError $ex) { |
@@ -207,8 +207,7 @@ |
||
207 | 207 | * @throws Exception |
208 | 208 | * @return string |
209 | 209 | */ |
210 | - function random_bytes($length) |
|
211 | - { |
|
210 | + function random_bytes($length) { |
|
212 | 211 | unset($length); // Suppress "variable not used" warnings. |
213 | 212 | throw new Exception( |
214 | 213 | 'There is no suitable CSPRNG installed on your system' |