The @return string
is wrong because the class \Magento\Framework\View\TemplateEngine\Xhtml
class implements the \Magento\Framework\View\TemplateEngineInterface::render()
method and returns an instance of the \Magento\Framework\View\TemplateEngine\Xhtml\ResultInterface
(particularly, \Magento\Ui\TemplateEngine\Xhtml\Result
), not a string
: