tcpdf refactoring

This commit is contained in:
Yuri Kuznetsov
2021-02-22 15:19:31 +02:00
parent 274fb0f380
commit d1b27dfd9d
2 changed files with 4 additions and 20 deletions
@@ -30,8 +30,6 @@
namespace Espo\Tools\Pdf\Tcpdf;
use Espo\Core\{
Utils\Config,
Htmlizer\Factory as HtmlizerFactory,
Pdf\Tcpdf,
};
@@ -48,15 +46,9 @@ class TcpdfCollectionPrinter implements CollectionPrinter
{
protected $entityProcessor;
protected $config;
protected $htmlizerFactory;
public function __construct(Config $config, HtmlizerFactory $htmlizerFactory)
public function __construct(EntityProcessor $entityProcessor)
{
$this->config = $config;
$this->htmlizerFactory = $htmlizerFactory;
$this->entityProcessor = new EntityProcessor($config, $htmlizerFactory);
$this->entityProcessor = $entityProcessor;
}
public function print(Template $template, Collection $collection, Data $data) : Contents
@@ -30,8 +30,6 @@
namespace Espo\Tools\Pdf\Tcpdf;
use Espo\Core\{
Utils\Config,
Htmlizer\Factory as HtmlizerFactory,
Pdf\Tcpdf,
};
@@ -47,15 +45,9 @@ class TcpdfEntityPrinter implements EntityPrinter
{
protected $entityProcessor;
protected $config;
protected $htmlizerFactory;
public function __construct(Config $config, HtmlizerFactory $htmlizerFactory)
public function __construct(EntityProcessor $entityProcessor)
{
$this->config = $config;
$this->htmlizerFactory = $htmlizerFactory;
$this->entityProcessor = new EntityProcessor($config, $htmlizerFactory);
$this->entityProcessor = $entityProcessor;
}
public function print(Template $template, Entity $entity, Data $data) : Contents