From 0378df42b6b57cc31af2f1c26dcca55869c3ec6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Thu, 27 Jan 2022 17:08:00 +0100 Subject: [PATCH] fix cs --- .../Security/Authorization/ActivityVoterTest.php | 4 ++++ src/Bundle/ChillMainBundle/Entity/Address.php | 2 -- .../Entity/Embeddable/CommentEmbeddable.php | 11 ++--------- .../Entity/Workflow/EntityWorkflow.php | 1 + .../Entity/Workflow/EntityWorkflowComment.php | 1 + .../Tests/Export/ExportManagerTest.php | 2 ++ .../Authorization/AuthorizationHelperTest.php | 3 +++ .../Entity/Household/HouseholdComposition.php | 1 + .../Entity/Person/PersonResource.php | 1 + .../AccompanyingPeriodResourceNormalizer.php | 1 + .../Normalizer/AccompanyingPeriodWorkDenormalizer.php | 1 + .../Serializer/Normalizer/PersonJsonNormalizer.php | 2 ++ .../Tests/Security/Authorization/PersonVoterTest.php | 2 ++ .../Tests/Security/Authorization/ReportVoterTest.php | 2 ++ 14 files changed, 23 insertions(+), 11 deletions(-) diff --git a/src/Bundle/ChillActivityBundle/Tests/Security/Authorization/ActivityVoterTest.php b/src/Bundle/ChillActivityBundle/Tests/Security/Authorization/ActivityVoterTest.php index b3d8472c6..3ca5aab45 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Security/Authorization/ActivityVoterTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Security/Authorization/ActivityVoterTest.php @@ -29,9 +29,13 @@ use Symfony\Component\Security\Core\Authorization\Voter\VoterInterface; final class ActivityVoterTest extends KernelTestCase { use PrepareActivityTrait; + use PrepareCenterTrait; + use PreparePersonTrait; + use PrepareScopeTrait; + use PrepareUserTrait; /** diff --git a/src/Bundle/ChillMainBundle/Entity/Address.php b/src/Bundle/ChillMainBundle/Entity/Address.php index b717b33eb..0e6cd549b 100644 --- a/src/Bundle/ChillMainBundle/Entity/Address.php +++ b/src/Bundle/ChillMainBundle/Entity/Address.php @@ -43,8 +43,6 @@ class Address private $buildingName; /** - * @var bool - * * @ORM\Column(type="boolean") * @Groups({"write"}) */ diff --git a/src/Bundle/ChillMainBundle/Entity/Embeddable/CommentEmbeddable.php b/src/Bundle/ChillMainBundle/Entity/Embeddable/CommentEmbeddable.php index 51b8978a0..3d5176860 100644 --- a/src/Bundle/ChillMainBundle/Entity/Embeddable/CommentEmbeddable.php +++ b/src/Bundle/ChillMainBundle/Entity/Embeddable/CommentEmbeddable.php @@ -20,10 +20,9 @@ use Doctrine\ORM\Mapping as ORM; class CommentEmbeddable { /** - * @var string * @ORM\Column(type="text", nullable=true) */ - private $comment; + private ?string $comment; /** * @var DateTime @@ -39,10 +38,7 @@ class CommentEmbeddable */ private $userId; - /** - * @return string - */ - public function getComment() + public function getComment(): ?string { return $this->comment; } @@ -68,9 +64,6 @@ class CommentEmbeddable return empty($this->getComment()); } - /** - * @param string $comment - */ public function setComment(?string $comment) { $this->comment = $comment; diff --git a/src/Bundle/ChillMainBundle/Entity/Workflow/EntityWorkflow.php b/src/Bundle/ChillMainBundle/Entity/Workflow/EntityWorkflow.php index b56435f5d..0d7142e9f 100644 --- a/src/Bundle/ChillMainBundle/Entity/Workflow/EntityWorkflow.php +++ b/src/Bundle/ChillMainBundle/Entity/Workflow/EntityWorkflow.php @@ -37,6 +37,7 @@ use function count; class EntityWorkflow implements TrackCreationInterface, TrackUpdateInterface { use TrackCreationTrait; + use TrackUpdateTrait; /** diff --git a/src/Bundle/ChillMainBundle/Entity/Workflow/EntityWorkflowComment.php b/src/Bundle/ChillMainBundle/Entity/Workflow/EntityWorkflowComment.php index b041a5aa3..9f4e7f096 100644 --- a/src/Bundle/ChillMainBundle/Entity/Workflow/EntityWorkflowComment.php +++ b/src/Bundle/ChillMainBundle/Entity/Workflow/EntityWorkflowComment.php @@ -24,6 +24,7 @@ use Doctrine\ORM\Mapping as ORM; class EntityWorkflowComment implements TrackCreationInterface, TrackUpdateInterface { use TrackCreationTrait; + use TrackUpdateTrait; /** diff --git a/src/Bundle/ChillMainBundle/Tests/Export/ExportManagerTest.php b/src/Bundle/ChillMainBundle/Tests/Export/ExportManagerTest.php index 94266077a..82693b9c1 100644 --- a/src/Bundle/ChillMainBundle/Tests/Export/ExportManagerTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Export/ExportManagerTest.php @@ -44,7 +44,9 @@ use function count; final class ExportManagerTest extends KernelTestCase { use PrepareCenterTrait; + use PrepareScopeTrait; + use PrepareUserTrait; private Prophet $prophet; diff --git a/src/Bundle/ChillMainBundle/Tests/Security/Authorization/AuthorizationHelperTest.php b/src/Bundle/ChillMainBundle/Tests/Security/Authorization/AuthorizationHelperTest.php index f4984167f..32382713a 100644 --- a/src/Bundle/ChillMainBundle/Tests/Security/Authorization/AuthorizationHelperTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Security/Authorization/AuthorizationHelperTest.php @@ -34,8 +34,11 @@ use function in_array; final class AuthorizationHelperTest extends KernelTestCase { use PrepareCenterTrait; + use PrepareScopeTrait; + use PrepareUserTrait; + use ProphecyTrait; protected function setUp(): void diff --git a/src/Bundle/ChillPersonBundle/Entity/Household/HouseholdComposition.php b/src/Bundle/ChillPersonBundle/Entity/Household/HouseholdComposition.php index a381fafd8..8aef3a0fa 100644 --- a/src/Bundle/ChillPersonBundle/Entity/Household/HouseholdComposition.php +++ b/src/Bundle/ChillPersonBundle/Entity/Household/HouseholdComposition.php @@ -33,6 +33,7 @@ use Symfony\Component\Validator\Constraints as Assert; class HouseholdComposition implements TrackCreationInterface, TrackUpdateInterface { use TrackCreationTrait; + use TrackUpdateTrait; /** diff --git a/src/Bundle/ChillPersonBundle/Entity/Person/PersonResource.php b/src/Bundle/ChillPersonBundle/Entity/Person/PersonResource.php index cdd928598..3cd82680e 100644 --- a/src/Bundle/ChillPersonBundle/Entity/Person/PersonResource.php +++ b/src/Bundle/ChillPersonBundle/Entity/Person/PersonResource.php @@ -34,6 +34,7 @@ use Symfony\Component\Validator\Context\ExecutionContextInterface; class PersonResource implements TrackCreationInterface, TrackUpdateInterface { use TrackCreationTrait; + use TrackUpdateTrait; /** diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodResourceNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodResourceNormalizer.php index 7ab284e44..472fa6d9b 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodResourceNormalizer.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodResourceNormalizer.php @@ -29,6 +29,7 @@ use function count; class AccompanyingPeriodResourceNormalizer implements DenormalizerAwareInterface, DenormalizerInterface { use DenormalizerAwareTrait; + use ObjectToPopulateTrait; private ResourceRepository $repository; diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkDenormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkDenormalizer.php index edbe07e47..e76c9cb55 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkDenormalizer.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkDenormalizer.php @@ -33,6 +33,7 @@ use function is_array; class AccompanyingPeriodWorkDenormalizer implements ContextAwareDenormalizerInterface, DenormalizerAwareInterface { use DenormalizerAwareTrait; + use ObjectToPopulateTrait; public const GROUP_CREATE = 'accompanying_period_work:create'; diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonJsonNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonJsonNormalizer.php index d6f9ced53..568926f79 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonJsonNormalizer.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonJsonNormalizer.php @@ -40,7 +40,9 @@ class PersonJsonNormalizer implements NormalizerInterface { use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use ObjectToPopulateTrait; private CenterResolverManagerInterface $centerResolverManager; diff --git a/src/Bundle/ChillPersonBundle/Tests/Security/Authorization/PersonVoterTest.php b/src/Bundle/ChillPersonBundle/Tests/Security/Authorization/PersonVoterTest.php index 43cf00452..f3caf6d36 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Security/Authorization/PersonVoterTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Security/Authorization/PersonVoterTest.php @@ -29,7 +29,9 @@ use Symfony\Component\Security\Core\Authorization\Voter\VoterInterface; final class PersonVoterTest extends KernelTestCase { use PrepareCenterTrait; + use PrepareScopeTrait; + use PrepareUserTrait; /** diff --git a/src/Bundle/ChillReportBundle/Tests/Security/Authorization/ReportVoterTest.php b/src/Bundle/ChillReportBundle/Tests/Security/Authorization/ReportVoterTest.php index 9a78934db..8a312fb89 100644 --- a/src/Bundle/ChillReportBundle/Tests/Security/Authorization/ReportVoterTest.php +++ b/src/Bundle/ChillReportBundle/Tests/Security/Authorization/ReportVoterTest.php @@ -28,7 +28,9 @@ use Symfony\Component\Security\Core\Authorization\Voter\VoterInterface; final class ReportVoterTest extends KernelTestCase { use PrepareCenterTrait; + use PrepareScopeTrait; + use PrepareUserTrait; /**