@@ -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 | } |
@@ -100,8 +100,7 @@ discard block |
||
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | $address = self::getNewAddress(); |
| 103 | - self::$collection[$address] = &$pointer; |
|
| 104 | - ++self::$entriesCount; |
|
| 103 | + self::$collection[$address] = &$pointer;++self::$entriesCount; |
|
| 105 | 104 | |
| 106 | 105 | return $address; |
| 107 | 106 | } |
@@ -132,8 +131,7 @@ discard block |
||
| 132 | 131 | return false; |
| 133 | 132 | } |
| 134 | 133 | |
| 135 | - unset(self::$collection[$address]); |
|
| 136 | - --self::$entriesCount; |
|
| 134 | + unset(self::$collection[$address]);--self::$entriesCount; |
|
| 137 | 135 | |
| 138 | 136 | return true; |
| 139 | 137 | } |
@@ -32,8 +32,7 @@ discard block |
||
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | return strval( |
| 35 | - $type === self::TYPE_INT || $precision == 0 ? (intval($leftOperand) + intval($rightOperand)) : |
|
| 36 | - round(floatval($leftOperand) + floatval($rightOperand), $precision, $this->getRoundingStrategy()) |
|
| 35 | + $type === self::TYPE_INT || $precision == 0 ? (intval($leftOperand) + intval($rightOperand)) : round(floatval($leftOperand) + floatval($rightOperand), $precision, $this->getRoundingStrategy()) |
|
| 37 | 36 | ); |
| 38 | 37 | } |
| 39 | 38 | |
@@ -57,8 +56,7 @@ discard block |
||
| 57 | 56 | } |
| 58 | 57 | |
| 59 | 58 | return strval( |
| 60 | - $type === self::TYPE_INT || $precision == 0 ? (intval($leftOperand) - intval($rightOperand)) : |
|
| 61 | - round($leftOperand - $rightOperand, $precision, $this->getRoundingStrategy()) |
|
| 59 | + $type === self::TYPE_INT || $precision == 0 ? (intval($leftOperand) - intval($rightOperand)) : round($leftOperand - $rightOperand, $precision, $this->getRoundingStrategy()) |
|
| 62 | 60 | ); |
| 63 | 61 | } |
| 64 | 62 | |
@@ -82,8 +80,7 @@ discard block |
||
| 82 | 80 | } |
| 83 | 81 | |
| 84 | 82 | return strval( |
| 85 | - $type === self::TYPE_INT || $precision == 0 ? (intval($leftOperand) / intval($rightOperand)) : |
|
| 86 | - round($leftOperand / $rightOperand, $precision, $this->getRoundingStrategy()) |
|
| 83 | + $type === self::TYPE_INT || $precision == 0 ? (intval($leftOperand) / intval($rightOperand)) : round($leftOperand / $rightOperand, $precision, $this->getRoundingStrategy()) |
|
| 87 | 84 | ); |
| 88 | 85 | } |
| 89 | 86 | |
@@ -107,8 +104,7 @@ discard block |
||
| 107 | 104 | } |
| 108 | 105 | |
| 109 | 106 | return strval( |
| 110 | - $type === self::TYPE_INT || $precision == 0 ? (intval($leftOperand) * intval($rightOperand)) : |
|
| 111 | - round($leftOperand * $rightOperand, ($precision ?? 0), $this->getRoundingStrategy()) |
|
| 107 | + $type === self::TYPE_INT || $precision == 0 ? (intval($leftOperand) * intval($rightOperand)) : round($leftOperand * $rightOperand, ($precision ?? 0), $this->getRoundingStrategy()) |
|
| 112 | 108 | ); |
| 113 | 109 | } |
| 114 | 110 | |
@@ -278,7 +274,7 @@ discard block |
||
| 278 | 274 | return $this->getNonPrecisionResult('gmp_fact', $operand); |
| 279 | 275 | } |
| 280 | 276 | |
| 281 | - $factorial = function (string $num) use (&$factorial) { |
|
| 277 | + $factorial = function(string $num) use (&$factorial) { |
|
| 282 | 278 | if ($num < 2) { |
| 283 | 279 | return 1; |
| 284 | 280 | } |
@@ -309,7 +305,7 @@ discard block |
||
| 309 | 305 | return $this->getNonPrecisionResult('gmp_gcd', $leftOperand, $rightOperand); |
| 310 | 306 | } |
| 311 | 307 | |
| 312 | - $gcd = function (string $a, string $b) use (&$gcd) { |
|
| 308 | + $gcd = function(string $a, string $b) use (&$gcd) { |
|
| 313 | 309 | return $b > .01 ? $gcd($b, strval(fmod(floatval($a), floatval($b)))) : $a; |
| 314 | 310 | }; |
| 315 | 311 | |
@@ -360,7 +356,7 @@ discard block |
||
| 360 | 356 | } |
| 361 | 357 | |
| 362 | 358 | $operand = ($operand + 1); |
| 363 | - for ($i = $operand;; ++$i) { |
|
| 359 | + for ($i = $operand; ; ++$i) { |
|
| 364 | 360 | if ($this->isPrime(strval($i))) { |
| 365 | 361 | return strval($i); |
| 366 | 362 | } |
@@ -52,7 +52,7 @@ |
||
| 52 | 52 | private static function asInt($mixed) : int |
| 53 | 53 | { |
| 54 | 54 | return static::asSubType( |
| 55 | - function ($v) { |
|
| 55 | + function($v) { |
|
| 56 | 56 | return intval(round($v)); |
| 57 | 57 | }, |
| 58 | 58 | $mixed |