Passed
Push — develop ( 172205...6b8ef5 )
by nguereza
02:25
created
src/Executor.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
      */
175 175
     public function getVariable(string $name)
176 176
     {
177
-        if (! array_key_exists($name, $this->variables)) {
177
+        if (!array_key_exists($name, $this->variables)) {
178 178
             if ($this->variableNotFoundHandler !== null) {
179 179
                 return call_user_func($this->variableNotFoundHandler, $name);
180 180
             }
@@ -373,7 +373,7 @@  discard block
 block discarded – undo
373 373
             'uNeg' => [static fn($a) => 0 - $a, 200, false],
374 374
             '*' => [static fn($a, $b) => $a * $b, 180, false],
375 375
             '/' => [
376
-                static function ($a, $b) {
376
+                static function($a, $b) {
377 377
                     if ($b == 0) {
378 378
                         throw new DivisionByZeroException();
379 379
                     }
@@ -403,14 +403,14 @@  discard block
 block discarded – undo
403 403
     protected function defaultFunctions(): array
404 404
     {
405 405
         return [
406
-            'abs' => static function ($arg) {
406
+            'abs' => static function($arg) {
407 407
                 if ((int) $arg == $arg) {
408 408
                     return abs(intval($arg));
409 409
                 }
410 410
                 return abs(floatval($arg));
411 411
             },
412 412
             'array' => static fn(...$args) => $args,
413
-            'avg' => static function ($arg1, ...$args) {
413
+            'avg' => static function($arg1, ...$args) {
414 414
                 if (is_array($arg1)) {
415 415
                     if (count($arg1) === 0) {
416 416
                         throw new InvalidArgumentException('Array must contains at least one element');
@@ -422,13 +422,13 @@  discard block
 block discarded – undo
422 422
                 $args = [$arg1, ...$args];
423 423
                 return array_sum($args) / count($args);
424 424
             },
425
-            'ceil' => static function ($arg) {
425
+            'ceil' => static function($arg) {
426 426
                 if ((int) $arg == $arg) {
427 427
                     return ceil(intval($arg));
428 428
                 }
429 429
                 return ceil(floatval($arg));
430 430
             },
431
-            'floor' => static function ($arg) {
431
+            'floor' => static function($arg) {
432 432
                 if ((int) $arg == $arg) {
433 433
                     return floor(intval($arg));
434 434
                 }
@@ -444,14 +444,14 @@  discard block
 block discarded – undo
444 444
             'sqrt' => static fn($arg) => sqrt(floatval($arg)),
445 445
             'hypot' => static fn($arg1, $arg2) => hypot(floatval($arg1), floatval($arg2)),
446 446
             'intdiv' => static fn($arg1, $arg2) => intdiv(intval($arg1), intval($arg2)),
447
-            'max' => static function ($arg1, ...$args) {
447
+            'max' => static function($arg1, ...$args) {
448 448
                 if (is_array($arg1) && count($arg1) === 0) {
449 449
                     throw new InvalidArgumentException('Array must contains at least one element');
450 450
                 }
451 451
 
452 452
                 return max(is_array($arg1) ? $arg1 : [$arg1, ...$args]);
453 453
             },
454
-            'min' => static function ($arg1, ...$args) {
454
+            'min' => static function($arg1, ...$args) {
455 455
                 if (is_array($arg1) && count($arg1) === 0) {
456 456
                     throw new InvalidArgumentException('Array must contains at least one element');
457 457
                 }
@@ -459,7 +459,7 @@  discard block
 block discarded – undo
459 459
                 return min(is_array($arg1) ? $arg1 : [$arg1, ...$args]);
460 460
             },
461 461
             'pow' => static fn($arg1, $arg2) => $arg1 ** $arg2,
462
-            'round' => static function ($arg, int $precision = 0) {
462
+            'round' => static function($arg, int $precision = 0) {
463 463
                 if ((int) $arg == $arg) {
464 464
                     return round(intval($arg), intval($precision));
465 465
                 }
Please login to merge, or discard this patch.