From 00dfe3f54c1c0184fc3b613aa866ccfc9778d2d3 Mon Sep 17 00:00:00 2001 From: Stanislau Komar Date: Tue, 23 Sep 2025 17:17:32 +0400 Subject: [PATCH 1/2] v1.7.1 Fix curcular proxy service initialization --- src/ContainerCompiled.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ContainerCompiled.php b/src/ContainerCompiled.php index 4b9466d..ae72ce4 100644 --- a/src/ContainerCompiled.php +++ b/src/ContainerCompiled.php @@ -57,7 +57,7 @@ public function get(string $id): object * * @psalm-suppress MixedMethodCall */ - $instance = new $proxyClass($this); + $instance = new $proxyClass($this->decorated); return $instance; } From e3f8c9d079b2b1867a4ec7aaa6c6dade286de342 Mon Sep 17 00:00:00 2001 From: Stanislau Komar Date: Tue, 23 Sep 2025 17:24:53 +0400 Subject: [PATCH 2/2] v1.7.1 Fix curcular exception --- src/Proxy/ProxyFactory.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Proxy/ProxyFactory.php b/src/Proxy/ProxyFactory.php index 64312c3..1309ed8 100644 --- a/src/Proxy/ProxyFactory.php +++ b/src/Proxy/ProxyFactory.php @@ -200,10 +200,8 @@ private function createProxyClass( string $methods, bool $isInterface, ): string { - $template = "final readonly class %s %s %s + $template = "final %s class %s %s %s { - private ?%s \$_proxiedObject; - public function __construct( private \Psr\Container\ContainerInterface \$container ) { @@ -222,11 +220,11 @@ private function _proxied(): %s return \sprintf( $template, + $classRef->isReadOnly() ? 'readonly' : '', $proxyClassName, $isInterface ? 'implements' : 'extends', $fullClassName, $fullClassName, - $fullClassName, $this->createProxyClassConstructor($classRef), $methods );