From 6690be979bd25d64f548266e1988e83fc702bb78 Mon Sep 17 00:00:00 2001 From: Oliver Bartsch Date: Mon, 9 Sep 2024 17:39:46 +0200 Subject: [PATCH] [TASK] Respect ContainerInterface in StandardVariableProvider --- src/Core/Variables/StandardVariableProvider.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Core/Variables/StandardVariableProvider.php b/src/Core/Variables/StandardVariableProvider.php index 872ba7e1f..5e071d4fc 100644 --- a/src/Core/Variables/StandardVariableProvider.php +++ b/src/Core/Variables/StandardVariableProvider.php @@ -9,6 +9,8 @@ namespace TYPO3Fluid\Fluid\Core\Variables; +use Psr\Container\ContainerInterface; + /** * Class StandardVariableProvider */ @@ -117,6 +119,10 @@ public function getByPath(string $path): mixed continue; } if (is_object($subject)) { + if ($subject instanceof ContainerInterface && $subject->has($pathSegment)) { + $subject = $subject->get($pathSegment); + continue; + } $upperCasePropertyName = ucfirst($pathSegment); $getMethod = 'get' . $upperCasePropertyName; if (method_exists($subject, $getMethod)) {