Skip to content

Magento 2.4 TemplateTypesInterface deprecated interface: The deprecated interface will be removed in upcoming versions

Impossible to process constructor argument Parameter #3 [

Magento 2 TemplateTypesInterface deprecated interface: The deprecated interface will be removed in upcoming versions. Consider using an interface or class marked as api instead.

<?php
namespace VendorModuleModel;
use MagentoFrameworkAppTemplateTypesInterface;
use MagentoFrameworkSetupPatchDataPatchInterface;
use MagentoFrameworkSetupPatchPatchRevertableInterface;

class InstallerBase implements DataPatchInterface, PatchRevertableInterface
{
...

    public function __construct(
        ...
    ) {
        ...
    }

    public function save($subjectHTML)
    {

        $template->load($templateName, 'template_code');
        $template->setTemplateSubject($subjectHTML)
               ...
                ->setTemplateType(TemplateTypesInterface::TYPE_HTML);

        return $template->save();
    }