Skip to content

Commit dfaa867

Browse files
author
TCB13
committed
ArrayPush: multiple items at once.
1 parent cb4a933 commit dfaa867

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/ArrayPush.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,19 @@
55
class ArrayPush implements SpecialFunction
66
{
77
protected $name;
8-
protected $value;
8+
protected $values;
99

10-
public function __construct(string $property, $value)
10+
public function __construct(string $property, ...$values)
1111
{
1212
$this->name = $property;
13-
$this->value = $value;
13+
$this->values = $values;
1414
}
1515

1616
public function asArray(): array
1717
{
1818
return [
1919
"\$push" => [
20-
$this->name => $this->value
20+
$this->name => ["\$each" => $this->values]
2121
]
2222
];
2323
}

0 commit comments

Comments
 (0)