Skip to content

Commit be73d47

Browse files
committed
fix small issues
Signed-off-by: Robert Landers <landers.robert@gmail.com>
1 parent 356ca4c commit be73d47

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

src/Proxy/Generator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ function (ReflectionMethod $method) {
9898
$namespace = $namespace ? "namespace {$namespace};" : '';
9999
$props = $reflection->getProperties(ReflectionProperty::IS_PUBLIC);
100100
$props = array_map(function (ReflectionProperty $prop) {
101-
$hooks = ['public ' . $this->getTypes($prop->getType()) . ' $' . $prop->getName() . '{'];
101+
$hooks = ['public ' . $this->getTypes($prop->getType()) . ' $' . $prop->getName() . ' {'];
102102
if ($hook = $prop->getHook(PropertyHookType::Get)) {
103103
$hooks[] = $this->impureCall($hook, true);
104104
}

src/Proxy/OrchestratorProxy.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ function (ReflectionParameter $param) {
6969
} else {
7070
$value = '[$value]';
7171
}
72+
$hookName = str_replace('$', '\$', $hookName);
7273
return <<<EOT
7374
{$name} {
7475
{$getHook}\$this->context->waitOne(\$this->context->callEntity(\$this->id, "{$hookName}", {$value}));

src/Proxy/SpyProxy.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ protected function pureMethod(ReflectionMethod $method, bool $isHook = false): s
3737

3838
protected function impureCall(ReflectionMethod $method, bool $isHook = false): string
3939
{
40-
$getHook = 'return ';
40+
$getHook = true;
4141
if ($isHook && str_ends_with($method->getName(), 'get')) {
4242
$name = 'get';
4343
} elseif ($isHook && str_ends_with($method->getName(), 'set')) {
4444
$name = 'set';
45-
$getHook = '';
45+
$getHook = false;
4646
} else {
4747
$name = $method->getName();
4848
}
@@ -70,6 +70,7 @@ function (ReflectionParameter $param) {
7070
} else {
7171
$value = '[]';
7272
}
73+
$hookName = str_replace('$', '\$', $hookName);
7374
return <<<EOT
7475
{$name} {
7576
\$this->operation = "{$hookName}";

0 commit comments

Comments
 (0)