From 45efa98df9c56df4290b12ce417bdeb899badc00 Mon Sep 17 00:00:00 2001 From: spiralbot Date: Wed, 11 Sep 2024 17:18:30 +0000 Subject: [PATCH] Merge pull request #1147: Fix Stempler in Container Scopes --- src/Request/InputManager.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Request/InputManager.php b/src/Request/InputManager.php index 4efda02d..54da23f1 100644 --- a/src/Request/InputManager.php +++ b/src/Request/InputManager.php @@ -13,6 +13,7 @@ use Spiral\Core\Attribute\Scope; use Spiral\Core\Attribute\Singleton; use Spiral\Core\Exception\ScopeException; +use Spiral\Core\Internal\Introspector; use Spiral\Http\Config\HttpConfig; use Spiral\Http\Exception\InputException; use Spiral\Http\Header\AcceptHeader; @@ -192,10 +193,11 @@ public function request(): Request try { $request = $this->container->get(Request::class); } catch (ContainerExceptionInterface $e) { + $scope = implode('.', \array_reverse(Introspector::scopeNames($this->container))); throw new ScopeException( - 'Unable to get `ServerRequestInterface` in active container scope', + "Unable to get `ServerRequestInterface` in the `$scope` container scope", $e->getCode(), - $e + $e, ); }