Phpstan and cs fixes

This commit is contained in:
Julie Lenaerts 2025-03-27 14:32:06 +01:00
parent bd4c34cc1d
commit 4fa4d3b65c
4 changed files with 13 additions and 20 deletions

View File

@ -11,7 +11,6 @@ declare(strict_types=1);
namespace Chill\PersonBundle\Controller; namespace Chill\PersonBundle\Controller;
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
use Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWork; use Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWork;
use Chill\PersonBundle\Form\FindAccompanyingPeriodWorkType; use Chill\PersonBundle\Form\FindAccompanyingPeriodWorkType;
use Chill\PersonBundle\Form\PersonConfimDuplicateType; use Chill\PersonBundle\Form\PersonConfimDuplicateType;
@ -22,9 +21,10 @@ use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Annotation\Route;
use Symfony\Contracts\Translation\TranslatorInterface; use Symfony\Contracts\Translation\TranslatorInterface;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
class AccompanyingPeriodWorkDuplicateController extends AbstractController class AccompanyingPeriodWorkDuplicateController extends AbstractController
{ {
public function __construct(private readonly AccompanyingPeriodWorkRepository $accompanyingPeriodWorkRepository, private readonly TranslatorInterface $translator, private readonly TranslatableStringHelperInterface $stringHelper, private readonly AccompanyingPeriodWorkMergeService $accompanyingPeriodWorkMergeService) {} public function __construct(private readonly AccompanyingPeriodWorkRepository $accompanyingPeriodWorkRepository, private readonly TranslatorInterface $translator, private readonly AccompanyingPeriodWorkMergeService $accompanyingPeriodWorkMergeService) {}
/** /**
* @ParamConverter("accompanyingPeriodWork", options={"id": "acpw_id"}) * @ParamConverter("accompanyingPeriodWork", options={"id": "acpw_id"})
@ -121,6 +121,4 @@ class AccompanyingPeriodWorkDuplicateController extends AbstractController
} }
} }
} }
} }

View File

@ -12,9 +12,7 @@ declare(strict_types=1);
namespace Chill\PersonBundle\Form; namespace Chill\PersonBundle\Form;
use Chill\PersonBundle\Entity\AccompanyingPeriod; use Chill\PersonBundle\Entity\AccompanyingPeriod;
use Chill\PersonBundle\Form\Type\PickAccompanyingPeriodWorkDynamicType;
use Chill\PersonBundle\Form\Type\PickLinkedAccompanyingPeriodWorkType; use Chill\PersonBundle\Form\Type\PickLinkedAccompanyingPeriodWorkType;
use Chill\PersonBundle\Repository\AccompanyingPeriod\AccompanyingPeriodWorkRepository;
use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\HiddenType; use Symfony\Component\Form\Extension\Core\Type\HiddenType;
use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\FormBuilderInterface;
@ -22,18 +20,11 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
class FindAccompanyingPeriodWorkType extends AbstractType class FindAccompanyingPeriodWorkType extends AbstractType
{ {
public function __construct(private readonly AccompanyingPeriodWorkRepository $repository)
{
}
public function buildForm(FormBuilderInterface $builder, array $options) public function buildForm(FormBuilderInterface $builder, array $options)
{ {
// $accompanyingPeriod = $options['accompanyingPeriod'];
// $suggestedAcpw = $this->repository->findByAccompanyingPeriod($accompanyingPeriod);
$builder $builder
->add('acpw', PickLinkedAccompanyingPeriodWorkType::class, [ ->add('acpw', PickLinkedAccompanyingPeriodWorkType::class, [
'label' => 'Accompanying period work', 'label' => 'Accompanying period work',
// 'suggested' => $suggestedAcpw,
'multiple' => false, 'multiple' => false,
]) ])
->add('direction', HiddenType::class, [ ->add('direction', HiddenType::class, [

View File

@ -1,16 +1,21 @@
<?php <?php
declare(strict_types=1);
/*
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\PersonBundle\Form\Type; namespace Chill\PersonBundle\Form\Type;
use Chill\MainBundle\Form\Type\DataTransformer\EntityToJsonTransformer;
use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\FormInterface; use Symfony\Component\Form\FormInterface;
use Symfony\Component\Form\FormView; use Symfony\Component\Form\FormView;
use Symfony\Component\OptionsResolver\OptionsResolver; use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
use Symfony\Component\Serializer\SerializerInterface;
class PickLinkedAccompanyingPeriodWorkType extends AbstractType class PickLinkedAccompanyingPeriodWorkType extends AbstractType
{ {
@ -47,5 +52,4 @@ class PickLinkedAccompanyingPeriodWorkType extends AbstractType
{ {
return 'pick_linked_entities'; return 'pick_linked_entities';
} }
} }

View File

@ -59,7 +59,7 @@ class AccompanyingPeriodWorkMergeService
'sql' => "UPDATE chill_main_workflow_entity w 'sql' => "UPDATE chill_main_workflow_entity w
SET relatedentityid = :toKeepId SET relatedentityid = :toKeepId
WHERE w.relatedentityid = :toDeleteId WHERE w.relatedentityid = :toDeleteId
AND w.relatedentityclass = 'Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWork'", AND w.relatedentityclass = 'Chill\\PersonBundle\\Entity\\AccompanyingPeriod\\AccompanyingPeriodWork'",
'params' => ['toKeepId' => $toKeep->getId(), 'toDeleteId' => $toDelete->getId()], 'params' => ['toKeepId' => $toKeep->getId(), 'toDeleteId' => $toDelete->getId()],
]; ];