mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 14:43:49 +00:00
Fix phpstan issues
This commit is contained in:
@@ -38,6 +38,9 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
use function array_key_exists;
|
||||
|
||||
/**
|
||||
* @template-implements DocGeneratorContextWithPublicFormInterface<AccompanyingPeriod>
|
||||
*/
|
||||
class AccompanyingPeriodContext implements
|
||||
DocGeneratorContextWithAdminFormInterface,
|
||||
DocGeneratorContextWithPublicFormInterface
|
||||
@@ -153,7 +156,7 @@ class AccompanyingPeriodContext implements
|
||||
/**
|
||||
* @param AccompanyingPeriod $entity
|
||||
*/
|
||||
public function buildPublicForm(FormBuilderInterface $builder, DocGeneratorTemplate $template, $entity): void
|
||||
public function buildPublicForm(FormBuilderInterface $builder, DocGeneratorTemplate $template, mixed $entity): void
|
||||
{
|
||||
$options = $template->getOptions();
|
||||
$persons = $entity->getCurrentParticipations()->map(static function (AccompanyingPeriodParticipation $p) {
|
||||
@@ -286,9 +289,6 @@ class AccompanyingPeriodContext implements
|
||||
return $denormalized;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param AccompanyingPeriod $entity
|
||||
*/
|
||||
public function storeGenerated(DocGeneratorTemplate $template, StoredObject $storedObject, object $entity, array $contextGenerationData): void
|
||||
{
|
||||
$doc = new AccompanyingCourseDocument();
|
||||
|
@@ -24,6 +24,8 @@ use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
|
||||
*
|
||||
* Although there isn't any document associated to AccompanyingPeriodWork, this context
|
||||
* is use by @link{AccompanyingPeriodWorkEvaluationContext}.
|
||||
*
|
||||
* @implements DocGeneratorContextWithPublicFormInterface<AccompanyingPeriodWork>
|
||||
*/
|
||||
class AccompanyingPeriodWorkContext implements DocGeneratorContextWithPublicFormInterface
|
||||
{
|
||||
@@ -56,17 +58,11 @@ class AccompanyingPeriodWorkContext implements DocGeneratorContextWithPublicForm
|
||||
$builder->remove('category');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param AccompanyingPeriodWork $entity
|
||||
*/
|
||||
public function buildPublicForm(FormBuilderInterface $builder, DocGeneratorTemplate $template, $entity): void
|
||||
{
|
||||
$this->periodContext->buildPublicForm($builder, $template, $entity->getAccompanyingPeriod());
|
||||
}
|
||||
|
||||
/**
|
||||
* @param AccompanyingPeriodWork $entity
|
||||
*/
|
||||
public function getData(DocGeneratorTemplate $template, $entity, array $contextGenerationData = []): array
|
||||
{
|
||||
$data = $this->periodContext->getData($template, $entity->getAccompanyingPeriod(), $contextGenerationData);
|
||||
@@ -88,9 +84,6 @@ class AccompanyingPeriodWorkContext implements DocGeneratorContextWithPublicForm
|
||||
return AccompanyingPeriodWork::class;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param AccompanyingPeriodWork $entity
|
||||
*/
|
||||
public function getFormData(DocGeneratorTemplate $template, $entity): array
|
||||
{
|
||||
return $this->periodContext->getFormData($template, $entity->getAccompanyingPeriod());
|
||||
@@ -113,17 +106,17 @@ class AccompanyingPeriodWorkContext implements DocGeneratorContextWithPublicForm
|
||||
|
||||
public function hasPublicForm(DocGeneratorTemplate $template, $entity): bool
|
||||
{
|
||||
return $this->periodContext->hasPublicForm($template, $entity);
|
||||
return $this->periodContext->hasPublicForm($template, $entity->getAccompanyingPeriod());
|
||||
}
|
||||
|
||||
public function contextGenerationDataNormalize(DocGeneratorTemplate $template, $entity, array $data): array
|
||||
{
|
||||
return $this->periodContext->contextGenerationDataNormalize($template, $entity, $data);
|
||||
return $this->periodContext->contextGenerationDataNormalize($template, $entity->getAccompanyingPeriod(), $data);
|
||||
}
|
||||
|
||||
public function contextGenerationDataDenormalize(DocGeneratorTemplate $template, $entity, array $data): array
|
||||
{
|
||||
return $this->periodContext->contextGenerationDataDenormalize($template, $entity, $data);
|
||||
return $this->periodContext->contextGenerationDataDenormalize($template, $entity->getAccompanyingPeriod(), $data);
|
||||
}
|
||||
|
||||
public function storeGenerated(DocGeneratorTemplate $template, StoredObject $storedObject, object $entity, array $contextGenerationData): void
|
||||
|
@@ -26,6 +26,9 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\Serializer\Normalizer\AbstractNormalizer;
|
||||
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
|
||||
|
||||
/**
|
||||
* @implements DocGeneratorContextWithPublicFormInterface<AccompanyingPeriodWorkEvaluation>
|
||||
*/
|
||||
class AccompanyingPeriodWorkEvaluationContext implements
|
||||
DocGeneratorContextWithAdminFormInterface,
|
||||
DocGeneratorContextWithPublicFormInterface
|
||||
@@ -102,17 +105,11 @@ class AccompanyingPeriodWorkEvaluationContext implements
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param AccompanyingPeriodWorkEvaluation $entity
|
||||
*/
|
||||
public function buildPublicForm(FormBuilderInterface $builder, DocGeneratorTemplate $template, $entity): void
|
||||
{
|
||||
$this->accompanyingPeriodWorkContext->buildPublicForm($builder, $template, $entity->getAccompanyingPeriodWork());
|
||||
}
|
||||
|
||||
/**
|
||||
* @param AccompanyingPeriodWorkEvaluation $entity
|
||||
*/
|
||||
public function getData(DocGeneratorTemplate $template, $entity, array $contextGenerationData = []): array
|
||||
{
|
||||
$data = $this->accompanyingPeriodWorkContext
|
||||
@@ -139,9 +136,6 @@ class AccompanyingPeriodWorkEvaluationContext implements
|
||||
return AccompanyingPeriodWorkEvaluation::class;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param AccompanyingPeriodWorkEvaluation $entity
|
||||
*/
|
||||
public function getFormData(DocGeneratorTemplate $template, $entity): array
|
||||
{
|
||||
return $this->accompanyingPeriodWorkContext->getFormData(
|
||||
@@ -177,13 +171,13 @@ class AccompanyingPeriodWorkEvaluationContext implements
|
||||
public function contextGenerationDataNormalize(DocGeneratorTemplate $template, $entity, array $data): array
|
||||
{
|
||||
return $this->accompanyingPeriodWorkContext
|
||||
->contextGenerationDataNormalize($template, $entity, $data);
|
||||
->contextGenerationDataNormalize($template, $entity->getAccompanyingPeriodWork(), $data);
|
||||
}
|
||||
|
||||
public function contextGenerationDataDenormalize(DocGeneratorTemplate $template, $entity, array $data): array
|
||||
{
|
||||
return $this->accompanyingPeriodWorkContext
|
||||
->contextGenerationDataDenormalize($template, $entity, $data);
|
||||
->contextGenerationDataDenormalize($template, $entity->getAccompanyingPeriodWork(), $data);
|
||||
}
|
||||
|
||||
public function storeGenerated(DocGeneratorTemplate $template, StoredObject $storedObject, object $entity, array $contextGenerationData): void
|
||||
|
@@ -249,9 +249,6 @@ final class PersonContext implements PersonContextInterface
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Person $entity
|
||||
*/
|
||||
public function storeGenerated(DocGeneratorTemplate $template, StoredObject $storedObject, object $entity, array $contextGenerationData): void
|
||||
{
|
||||
$doc = new PersonDocument();
|
||||
|
@@ -18,6 +18,9 @@ use Chill\DocStoreBundle\Entity\StoredObject;
|
||||
use Chill\PersonBundle\Entity\Person;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
/**
|
||||
* @template-extends DocGeneratorContextWithPublicFormInterface<Person>
|
||||
*/
|
||||
interface PersonContextInterface extends DocGeneratorContextWithAdminFormInterface, DocGeneratorContextWithPublicFormInterface
|
||||
{
|
||||
public function adminFormReverseTransform(array $data): array;
|
||||
@@ -26,10 +29,7 @@ interface PersonContextInterface extends DocGeneratorContextWithAdminFormInterfa
|
||||
|
||||
public function buildAdminForm(FormBuilderInterface $builder): void;
|
||||
|
||||
/**
|
||||
* @param Person $entity
|
||||
*/
|
||||
public function buildPublicForm(FormBuilderInterface $builder, DocGeneratorTemplate $template, $entity): void;
|
||||
public function buildPublicForm(FormBuilderInterface $builder, DocGeneratorTemplate $template, mixed $entity): void;
|
||||
|
||||
public function getData(DocGeneratorTemplate $template, $entity, array $contextGenerationData = []): array;
|
||||
|
||||
@@ -37,7 +37,7 @@ interface PersonContextInterface extends DocGeneratorContextWithAdminFormInterfa
|
||||
|
||||
public function getEntityClass(): string;
|
||||
|
||||
public function getFormData(DocGeneratorTemplate $template, $entity): array;
|
||||
public function getFormData(DocGeneratorTemplate $template, mixed $entity): array;
|
||||
|
||||
public function getName(): string;
|
||||
|
||||
@@ -52,8 +52,5 @@ interface PersonContextInterface extends DocGeneratorContextWithAdminFormInterfa
|
||||
|
||||
public function contextGenerationDataDenormalize(DocGeneratorTemplate $template, $entity, array $data): array;
|
||||
|
||||
/**
|
||||
* @param Person $entity
|
||||
*/
|
||||
public function storeGenerated(DocGeneratorTemplate $template, StoredObject $storedObject, object $entity, array $contextGenerationData): void;
|
||||
}
|
||||
|
Reference in New Issue
Block a user