Skip to content

Commit ebdecb9

Browse files
committed
Fix patch to ignore first arg
1 parent 761fc6d commit ebdecb9

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/Exercise/UniteTheTypes.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,14 @@ function (): string {
6565
public function getPatch(): Patch
6666
{
6767
$code = <<<'CODE'
68-
declare(strict_types=1);
69-
70-
$argv = array_map(function ($value) {
68+
$first = array_shift($argv);
69+
$argv = array_merge([$first], array_map(function ($value) {
7170
return match (true) {
7271
(int) $value != (float) $value => (float) $value,
7372
(bool) random_int(0, 1) => (int) $value,
7473
default => (string) $value
7574
};
76-
}, $argv);
75+
}, $argv));
7776
CODE;
7877

7978
$casterInsertion = new CodeInsertion(CodeInsertion::TYPE_BEFORE, $code);

0 commit comments

Comments
 (0)