@@ -101,8 +101,7 @@ discard block |
||
101 | 101 | public function strpos(string $subStr, int $offset = 0, bool $caseSensitive = false) : IntType |
102 | 102 | { |
103 | 103 | $res = ($caseSensitive) ? |
104 | - mb_strpos($this->str, $subStr, $offset, $this->encoding) : |
|
105 | - mb_stripos($this->str, $subStr, $offset, $this->encoding); |
|
104 | + mb_strpos($this->str, $subStr, $offset, $this->encoding) : mb_stripos($this->str, $subStr, $offset, $this->encoding); |
|
106 | 105 | |
107 | 106 | return new IntType($res); |
108 | 107 | } |
@@ -119,8 +118,7 @@ discard block |
||
119 | 118 | public function strrpos(string $subStr, int $offset = 0, bool $caseSensitive = false) : IntType |
120 | 119 | { |
121 | 120 | $res = ($caseSensitive) ? |
122 | - mb_strrpos($this->str, $subStr, $offset, $this->encoding) : |
|
123 | - mb_strripos($this->str, $subStr, $offset, $this->encoding); |
|
121 | + mb_strrpos($this->str, $subStr, $offset, $this->encoding) : mb_strripos($this->str, $subStr, $offset, $this->encoding); |
|
124 | 122 | |
125 | 123 | return new IntType($res); |
126 | 124 | } |
@@ -48,7 +48,7 @@ |
||
48 | 48 | */ |
49 | 49 | private static function asInt($mixed) : int |
50 | 50 | { |
51 | - return static::asSubType($mixed, function ($v) { |
|
51 | + return static::asSubType($mixed, function($v) { |
|
52 | 52 | return intval(round($v)); |
53 | 53 | }); |
54 | 54 | } |
@@ -61,8 +61,7 @@ discard block |
||
61 | 61 | $address = ++self::$lastAddress; |
62 | 62 | } |
63 | 63 | |
64 | - self::$collection[$address] = &$value; |
|
65 | - ++self::$entriesCount; |
|
64 | + self::$collection[$address] = &$value;++self::$entriesCount; |
|
66 | 65 | |
67 | 66 | return $address; |
68 | 67 | } |
@@ -91,7 +90,6 @@ discard block |
||
91 | 90 | return; |
92 | 91 | } |
93 | 92 | |
94 | - unset(self::$collection[$id]); |
|
95 | - --self::$entriesCount; |
|
93 | + unset(self::$collection[$id]);--self::$entriesCount; |
|
96 | 94 | } |
97 | 95 | } |
@@ -29,8 +29,7 @@ discard block |
||
29 | 29 | } |
30 | 30 | |
31 | 31 | return strval( |
32 | - !$precision ? (intval($leftOperand) + intval($rightOperand)) : |
|
33 | - round(floatval($leftOperand) + floatval($rightOperand), $precision, PHP_ROUND_HALF_UP) |
|
32 | + !$precision ? (intval($leftOperand) + intval($rightOperand)) : round(floatval($leftOperand) + floatval($rightOperand), $precision, PHP_ROUND_HALF_UP) |
|
34 | 33 | ); |
35 | 34 | } |
36 | 35 | |
@@ -54,8 +53,7 @@ discard block |
||
54 | 53 | } |
55 | 54 | |
56 | 55 | return strval( |
57 | - !$precision ? (intval($leftOperand) - intval($rightOperand)) : |
|
58 | - round($leftOperand - $rightOperand, $precision, PHP_ROUND_HALF_UP) |
|
56 | + !$precision ? (intval($leftOperand) - intval($rightOperand)) : round($leftOperand - $rightOperand, $precision, PHP_ROUND_HALF_UP) |
|
59 | 57 | ); |
60 | 58 | } |
61 | 59 | |
@@ -79,8 +77,7 @@ discard block |
||
79 | 77 | } |
80 | 78 | |
81 | 79 | return strval( |
82 | - !$precision ? (intval($leftOperand) / intval($rightOperand)) : |
|
83 | - round($leftOperand / $rightOperand, $precision, PHP_ROUND_HALF_UP) |
|
80 | + !$precision ? (intval($leftOperand) / intval($rightOperand)) : round($leftOperand / $rightOperand, $precision, PHP_ROUND_HALF_UP) |
|
84 | 81 | ); |
85 | 82 | } |
86 | 83 | |
@@ -104,8 +101,7 @@ discard block |
||
104 | 101 | } |
105 | 102 | |
106 | 103 | return strval( |
107 | - !$precision ? (intval($leftOperand) * intval($rightOperand)) : |
|
108 | - round($leftOperand * $rightOperand, $precision, PHP_ROUND_HALF_UP) |
|
104 | + !$precision ? (intval($leftOperand) * intval($rightOperand)) : round($leftOperand * $rightOperand, $precision, PHP_ROUND_HALF_UP) |
|
109 | 105 | ); |
110 | 106 | } |
111 | 107 | |
@@ -252,7 +248,7 @@ discard block |
||
252 | 248 | return $this->getNonPrecisionResult('gmp_fact', $operand); |
253 | 249 | } |
254 | 250 | |
255 | - $factorial = function (string $num) use (&$factorial) { |
|
251 | + $factorial = function(string $num) use (&$factorial) { |
|
256 | 252 | if ($num < 2) { |
257 | 253 | return 1; |
258 | 254 | } |
@@ -277,7 +273,7 @@ discard block |
||
277 | 273 | return $this->getNonPrecisionResult('gmp_gcd', $leftOperand, $rightOperand); |
278 | 274 | } |
279 | 275 | |
280 | - $gcd = function (string $a, string $b) use (&$gcd) { |
|
276 | + $gcd = function(string $a, string $b) use (&$gcd) { |
|
281 | 277 | return $b > .01 ? $gcd($b, fmod($a, $b)) : $a; |
282 | 278 | }; |
283 | 279 |