node = $node; $this->subjectName = $subjectName; } public function __invoke($object): string { // @deprecated: drop the condition, if compatibility to Flow 6.3 can be dropped $reflector = new \ReflectionClass(RenderingContext::class); if ($reflector->implementsInterface(ProxyInterface::class)) { try { $reflector = new \ReflectionClass($reflector->getParentClass()->getName()); } catch (\Exception $e) { // nothing, go with the first one } } $constructor = $reflector->getConstructor(); if ($constructor->getNumberOfRequiredParameters() > 0) { $context = new RenderingContext(new DummyView()); } else { $context = new RenderingContext(); } $context->getVariableProvider()->add($this->subjectName, $object); return \trim($this->node->evaluate($context)); } }