\Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface
if (!$this->authorizationChecker->isGranted(Attributes::DELETE, $post)) {
$this->logger->warning(sprintf('Can\'t delete post "%s"', $post->getId()));
return;
}
$document = new Excel($options);
$document = $excelFactory->create($options);
?class ExcelFactory
{
private CacheInterface $cache; // Судя по коду вам cacheDir и не нужно
public function __construct(CacheInterface $cache)
{
$this->cache = $cache;
}
public function create(array $options): Excel
{
return new Excel($this->cache, $options);
}
}
submit
по аналогии как это сделано в экстеншене