33 lines
893 B
PHP
33 lines
893 B
PHP
<?php
|
|
|
|
namespace App\Service\Pdf;
|
|
|
|
use Psr\Cache\CacheItemPoolInterface;
|
|
use Symfony\Component\Cache\Adapter\ArrayAdapter;
|
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
|
use Symfony\Contracts\Translation\TranslatorInterface;
|
|
|
|
abstract class AbstractPdfRenderer
|
|
{
|
|
protected CacheItemPoolInterface|ArrayAdapter $cache;
|
|
|
|
protected int $B = 0;
|
|
protected int $I = 0;
|
|
protected int $U = 0;
|
|
|
|
protected array $config;
|
|
|
|
public function __construct(protected readonly TranslatorInterface $translator, array $options)
|
|
{
|
|
$optionsResolver = new OptionsResolver();
|
|
$optionsResolver
|
|
->setRequired('project_dir')
|
|
->setAllowedTypes('project_dir', 'string')
|
|
;
|
|
$this->config = $optionsResolver->resolve($options);
|
|
|
|
// Static cache without serialization
|
|
$this->cache = new ArrayAdapter(0, false);
|
|
}
|
|
}
|