DX: fix cs

This commit is contained in:
Julien Fastré 2023-02-17 22:20:09 +01:00
parent 542b6ccc83
commit 096e2f6e40
Signed by: julienfastre
GPG Key ID: BDE2190974723FCB
9 changed files with 52 additions and 26 deletions

View File

@ -234,7 +234,7 @@ final class ActivityControllerTest extends WebTestCase
$user = new \Chill\MainBundle\Entity\User(); $user = new \Chill\MainBundle\Entity\User();
$user $user
->setPassword($container->get('security.password_encoder') ->setPassword($container->get('security.password_encoder')
->encodePassword($user, 'password')) ->encodePassword($user, 'password'))
->setUsername($username) ->setUsername($username)
->addGroupCenter($groupCenter); ->addGroupCenter($groupCenter);

View File

@ -55,7 +55,7 @@ class LoadAsideActivity extends Fixture implements DependentFixtureInterface
$this->getReference('aside_activity_category_0') $this->getReference('aside_activity_category_0')
) )
->setDate((new DateTimeImmutable('today')) ->setDate((new DateTimeImmutable('today'))
->sub(new DateInterval('P' . random_int(1, 100) . 'D'))); ->sub(new DateInterval('P' . random_int(1, 100) . 'D')));
$manager->persist($activity); $manager->persist($activity);
} }

View File

@ -1,5 +1,14 @@
<?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\AsideActivityBundle\Export\Export; namespace Chill\AsideActivityBundle\Export\Export;
use Chill\AsideActivityBundle\Entity\AsideActivity; use Chill\AsideActivityBundle\Entity\AsideActivity;

View File

@ -2,6 +2,13 @@
declare(strict_types=1); 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\Migrations\Budget; namespace Chill\Migrations\Budget;
use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\Schema;

View File

@ -104,6 +104,7 @@ interface PaginatorInterface extends Countable
/** /**
* check if the page with the given number exists. * check if the page with the given number exists.
* *
* @param mixed $number
*/ */
public function hasPage($number): bool; public function hasPage($number): bool;

View File

@ -70,10 +70,10 @@ class AccompanyingPeriodController extends AbstractController
if ($person->isOpen() === false) { if ($person->isOpen() === false) {
$this->get('session')->getFlashBag() $this->get('session')->getFlashBag()
->add('error', $this->get('translator') ->add('error', $this->get('translator')
->trans( ->trans(
'Beware period is closed', 'Beware period is closed',
['%name%' => $person->__toString()] ['%name%' => $person->__toString()]
)); ));
return $this->redirect( return $this->redirect(
$this->generateUrl('chill_person_accompanying_period_list', [ $this->generateUrl('chill_person_accompanying_period_list', [
@ -99,9 +99,9 @@ class AccompanyingPeriodController extends AbstractController
if (count($errors) === 0) { if (count($errors) === 0) {
$this->get('session')->getFlashBag() $this->get('session')->getFlashBag()
->add('success', $this->get('translator') ->add('success', $this->get('translator')
->trans('An accompanying period has been closed.', [ ->trans('An accompanying period has been closed.', [
'%name%' => $person->__toString(), '%name%' => $person->__toString(),
])); ]));
$this->getDoctrine()->getManager()->flush(); $this->getDoctrine()->getManager()->flush();
@ -113,7 +113,7 @@ class AccompanyingPeriodController extends AbstractController
} }
$this->get('session')->getFlashBag() $this->get('session')->getFlashBag()
->add('error', $this->get('translator') ->add('error', $this->get('translator')
->trans('Error! Period not closed!')); ->trans('Error! Period not closed!'));
foreach ($errors as $error) { foreach ($errors as $error) {
$this->get('session')->getFlashBag() $this->get('session')->getFlashBag()
@ -251,10 +251,10 @@ class AccompanyingPeriodController extends AbstractController
if ($person->isOpen()) { if ($person->isOpen()) {
$this->get('session')->getFlashBag() $this->get('session')->getFlashBag()
->add('error', $this->get('translator') ->add('error', $this->get('translator')
->trans( ->trans(
'Error! Period %name% is not closed ; it can be open', 'Error! Period %name% is not closed ; it can be open',
['%name%' => $person->__toString()] ['%name%' => $person->__toString()]
)); ));
return $this->redirect( return $this->redirect(
$this->generateUrl('chill_person_accompanying_period_list', [ $this->generateUrl('chill_person_accompanying_period_list', [
@ -285,10 +285,10 @@ class AccompanyingPeriodController extends AbstractController
if (count($errors) <= 0) { if (count($errors) <= 0) {
$this->get('session')->getFlashBag() $this->get('session')->getFlashBag()
->add('success', $this->get('translator') ->add('success', $this->get('translator')
->trans( ->trans(
'An accompanying period has been opened.', 'An accompanying period has been opened.',
['%name%' => $person->__toString()] ['%name%' => $person->__toString()]
)); ));
$this->getDoctrine()->getManager()->flush(); $this->getDoctrine()->getManager()->flush();
@ -300,7 +300,7 @@ class AccompanyingPeriodController extends AbstractController
} }
$this->get('session')->getFlashBag() $this->get('session')->getFlashBag()
->add('error', $this->get('translator') ->add('error', $this->get('translator')
->trans('Period not opened')); ->trans('Period not opened'));
foreach ($errors as $error) { foreach ($errors as $error) {
$this->get('session')->getFlashBag() $this->get('session')->getFlashBag()

View File

@ -159,7 +159,7 @@ final class PersonDocGenNormalizerTest extends KernelTestCase
$householdMember = new HouseholdMember(); $householdMember = new HouseholdMember();
$householdMember $householdMember
->setPosition((new Position())->setAllowHolder(true)->setLabel(['fr' => 'position']) ->setPosition((new Position())->setAllowHolder(true)->setLabel(['fr' => 'position'])
->setShareHousehold(true)) ->setShareHousehold(true))
->setHolder(true); ->setHolder(true);
$person->addHouseholdParticipation($householdMember); $person->addHouseholdParticipation($householdMember);
$household->addMember($householdMember); $household->addMember($householdMember);
@ -171,7 +171,7 @@ final class PersonDocGenNormalizerTest extends KernelTestCase
$householdMember = new HouseholdMember(); $householdMember = new HouseholdMember();
$householdMember $householdMember
->setPosition((new Position())->setAllowHolder(true)->setLabel(['fr' => 'position2']) ->setPosition((new Position())->setAllowHolder(true)->setLabel(['fr' => 'position2'])
->setShareHousehold(true)) ->setShareHousehold(true))
->setHolder(false); ->setHolder(false);
$person->addHouseholdParticipation($householdMember); $person->addHouseholdParticipation($householdMember);
$household->addMember($householdMember); $household->addMember($householdMember);

View File

@ -1,5 +1,14 @@
<?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 Validator\AccompanyingPeriod; namespace Validator\AccompanyingPeriod;
use Chill\PersonBundle\Entity\AccompanyingPeriod; use Chill\PersonBundle\Entity\AccompanyingPeriod;
@ -13,6 +22,10 @@ use Prophecy\Argument;
use Prophecy\PhpUnit\ProphecyTrait; use Prophecy\PhpUnit\ProphecyTrait;
use Symfony\Component\Validator\Test\ConstraintValidatorTestCase; use Symfony\Component\Validator\Test\ConstraintValidatorTestCase;
/**
* @internal
* @coversNothing
*/
class ParticipationOverlapValidatorTest extends ConstraintValidatorTestCase class ParticipationOverlapValidatorTest extends ConstraintValidatorTestCase
{ {
use ProphecyTrait; use ProphecyTrait;
@ -101,8 +114,4 @@ class ParticipationOverlapValidatorTest extends ConstraintValidatorTestCase
{ {
return new ParticipationOverlap(['message' => 'participation-overlaps']); return new ParticipationOverlap(['message' => 'participation-overlaps']);
} }
} }

View File

@ -74,7 +74,7 @@ final class TimelineProviderTest extends WebTestCase
$report = (new Report()) $report = (new Report())
->setUser(self::$em->getRepository(\Chill\MainBundle\Entity\User::class) ->setUser(self::$em->getRepository(\Chill\MainBundle\Entity\User::class)
->findOneByUsername('center a_social')) ->findOneByUsername('center a_social'))
->setDate(new DateTime('2015-05-02')) ->setDate(new DateTime('2015-05-02'))
->setPerson($this->person) ->setPerson($this->person)
->setCFGroup($this->getHousingCustomFieldsGroup()) ->setCFGroup($this->getHousingCustomFieldsGroup())