Skip to content

Commit eaaa1a0

Browse files
committed
fix value
Signed-off-by: Robert Landers <landers.robert@gmail.com>
1 parent 63ee492 commit eaaa1a0

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

src/Proxy/OrchestratorProxy.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,14 @@ function (ReflectionParameter $param) {
6464

6565
if ($isHook) {
6666
$hookName = $method->getName();
67+
if ($getHook) {
68+
$value = '[]';
69+
} else {
70+
$value = '[$value]';
71+
}
6772
return <<<EOT
6873
{$name} {
69-
{$getHook}\$this->context->waitOne(\$this->context->callEntity(\$this->id, "{$hookName}", func_get_args()));
74+
{$getHook}\$this->context->waitOne(\$this->context->callEntity(\$this->id, "{$hookName}", {$value}));
7075
}
7176
EOT;
7277
}

src/Proxy/SpyProxy.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,15 @@ function (ReflectionParameter $param) {
6565

6666
if ($isHook) {
6767
$hookName = $method->getName();
68+
if (str_ends_with($hookName, 'get')) {
69+
$value = '[$value]';
70+
} else {
71+
$value = '[]';
72+
}
6873
return <<<EOT
6974
{$name} {
7075
\$this->operation = "{$hookName}";
71-
\$this->arguments = func_get_args();
76+
\$this->arguments = {$value};
7277
throw new \Exception('Not implemented');
7378
}
7479
EOT;
@@ -96,7 +101,7 @@ protected function impureSignal(ReflectionMethod $method): string
96101
protected function preamble(ReflectionClass $class): string
97102
{
98103
return <<<'EOT'
99-
public function __construct(private string|null &$operation = null, private array|null &$arguments = null) {}
100-
EOT;
104+
public function __construct(private string|null &$operation = null, private array|null &$arguments = null) {}
105+
EOT;
101106
}
102107
}

0 commit comments

Comments
 (0)