Skip to content

Commit 72657e8

Browse files
committed
refactor: use child containers instead of clone for request scoping
Replace `clone $this->container` with `new Container($this->container)` to use the parent-child delegation pattern introduced in utopia-php/di 0.3, consistent with how Base::prepare() already creates scoped containers. https://claude.ai/code/session_0196tmVsX1KjJKmuHncp7HiV
1 parent 487a7a8 commit 72657e8

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/Http/Http.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ public function start()
395395
$response = new $this->responseClass($response);
396396
}
397397

398-
$container = clone $this->container;
398+
$container = new Container($this->container);
399399

400400
$container->set('request', fn () => $request)
401401
->set('response', fn () => $response);
@@ -411,7 +411,7 @@ public function start()
411411
});
412412

413413
$this->server->onStart(function () {
414-
$container = clone $this->container;
414+
$container = new Container($this->container);
415415

416416
$container->set('server', fn () => $this->server);
417417

0 commit comments

Comments
 (0)