@@ -31,7 +31,7 @@ |
||
31 | 31 | } |
32 | 32 | $signatureChars = str_split($signature, 2); |
33 | 33 | $hexChars = array_map( |
34 | - function ($val) { |
|
34 | + function($val) { |
|
35 | 35 | return strtoupper(bin2hex($val)); |
36 | 36 | }, |
37 | 37 | str_split(substr($string, 0, count($signatureChars))) |
@@ -11,11 +11,11 @@ discard block |
||
11 | 11 | * @var array |
12 | 12 | */ |
13 | 13 | protected static $formats = [ |
14 | - 'decimal' => [ // SI Prefixes (decimal) |
|
14 | + 'decimal' => [// SI Prefixes (decimal) |
|
15 | 15 | 'mod' => 1000, |
16 | 16 | 'units' => ['B', 'kB', 'MB', 'GB', 'TB', 'PB'], |
17 | 17 | ], |
18 | - 'binary' => [ // IEC prefixes (binary) |
|
18 | + 'binary' => [// IEC prefixes (binary) |
|
19 | 19 | 'mod' => 1024, |
20 | 20 | 'units' => ['B', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB'], |
21 | 21 | ], |
@@ -39,11 +39,11 @@ discard block |
||
39 | 39 | } |
40 | 40 | |
41 | 41 | $format = self::$formats[$format]; |
42 | - $precision = (int) $precision; |
|
42 | + $precision = (int)$precision; |
|
43 | 43 | |
44 | 44 | /** @var float $base */ |
45 | - $base = log((float) $size, $format['mod']); |
|
46 | - $key = (int) floor($base); |
|
45 | + $base = log((float)$size, $format['mod']); |
|
46 | + $key = (int)floor($base); |
|
47 | 47 | |
48 | 48 | $value = round(pow($format['mod'], $base - floor($base)), $precision); |
49 | 49 |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | if (!is_string($json)) { |
42 | 42 | throw new \InvalidArgumentException('Argument json is not a string'); |
43 | 43 | } |
44 | - $result = json_decode($json, (bool) $assoc, 512, (int) $options); |
|
44 | + $result = json_decode($json, (bool)$assoc, 512, (int)$options); |
|
45 | 45 | if ($result === null) { |
46 | 46 | throw new \RuntimeException(static::$errorMessages[json_last_error()]); |
47 | 47 | } |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | */ |
64 | 64 | public static function encode($value, $options = 0) |
65 | 65 | { |
66 | - $result = json_encode($value, (int) $options); |
|
66 | + $result = json_encode($value, (int)$options); |
|
67 | 67 | // @codeCoverageIgnoreStart |
68 | 68 | if ($result === false) { |
69 | 69 | throw new \RuntimeException(static::$errorMessages[json_last_error()]); |
@@ -14,7 +14,7 @@ |
||
14 | 14 | */ |
15 | 15 | public static function stdClassToArray(\stdClass $object) |
16 | 16 | { |
17 | - $object = (array) $object; |
|
17 | + $object = (array)$object; |
|
18 | 18 | foreach ($object as &$value) { |
19 | 19 | if ($value instanceof \stdClass) { |
20 | 20 | $value = self::stdClassToArray($value); |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | { |
75 | 75 | return array_filter( |
76 | 76 | $array, |
77 | - function ($key) use ($value) { |
|
77 | + function($key) use ($value) { |
|
78 | 78 | return strpos($key, $value) === 0; |
79 | 79 | }, |
80 | 80 | ARRAY_FILTER_USE_KEY |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | { |
114 | 114 | return array_combine( |
115 | 115 | array_map( |
116 | - function ($key) use ($prefix, $separator) { |
|
116 | + function($key) use ($prefix, $separator) { |
|
117 | 117 | return $prefix . $separator . $key; |
118 | 118 | }, |
119 | 119 | array_keys($array) |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | */ |
132 | 132 | public static function isAssociativeArray(array $input) |
133 | 133 | { |
134 | - return (bool) count(array_filter(array_keys($input), 'is_string')); |
|
134 | + return (bool)count(array_filter(array_keys($input), 'is_string')); |
|
135 | 135 | } |
136 | 136 | |
137 | 137 | /** |