move logic of context to different interfaces

This commit is contained in:
2021-12-02 18:18:11 +01:00
parent af6efdd0ba
commit be626079d0
7 changed files with 71 additions and 171 deletions

View File

@@ -12,6 +12,8 @@ declare(strict_types=1);
namespace Chill\PersonBundle\Service\DocGenerator;
use Chill\DocGeneratorBundle\Context\DocGeneratorContextInterface;
use Chill\DocGeneratorBundle\Context\DocGeneratorContextWithAdminFormInterface;
use Chill\DocGeneratorBundle\Context\DocGeneratorContextWithPublicFormInterface;
use Chill\DocGeneratorBundle\Context\Exception\UnexpectedTypeException;
use Chill\DocGeneratorBundle\Entity\DocGeneratorTemplate;
use Chill\DocStoreBundle\Entity\AccompanyingCourseDocument;
@@ -31,7 +33,10 @@ use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
use function array_key_exists;
class AccompanyingPeriodContext implements DocGeneratorContextInterface
class AccompanyingPeriodContext implements
DocGeneratorContextInterface,
DocGeneratorContextWithAdminFormInterface,
DocGeneratorContextWithPublicFormInterface
{
private DocumentCategoryRepository $documentCategoryRepository;
@@ -196,8 +201,8 @@ class AccompanyingPeriodContext implements DocGeneratorContextInterface
$doc
->setCategory(
$this->documentCategoryRepository->find(
$template->getOptions()['category']
)
$template->getOptions()['category']
)
);
}