From 5cebcfddb7f1ce183827754134c80d7ee286bcaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Sat, 25 Dec 2021 22:51:58 +0100 Subject: [PATCH] fix cs ? --- .../Normalizer/CollectionDocGenNormalizer.php | 2 +- .../Normalizer/DocGenObjectNormalizer.php | 2 +- .../{show.html.twig => list.html.twig} | 0 .../Routing/MenuBuilder/UserMenuBuilder.php | 4 ++-- .../Serializer/Normalizer/AddressNormalizer.php | 2 +- .../Normalizer/CollectionNormalizer.php | 2 +- .../Tests/Export/ExportManagerTest.php | 16 ++++++++-------- .../PasswordRecover/TokenManagerTest.php | 3 ++- .../config/services/notification.yaml | 2 +- .../ChillMainBundle/translations/messages.fr.yml | 4 ++++ .../Controller/HouseholdMemberController.php | 2 +- .../DataFixtures/ORM/LoadHouseholdPosition.php | 2 +- .../AccompanyingPeriodDocGenNormalizer.php | 2 +- .../AccompanyingPeriodOriginNormalizer.php | 2 +- ...AccompanyingPeriodParticipationNormalizer.php | 2 +- .../Normalizer/PersonJsonNormalizer.php | 2 +- .../Normalizer/RelationshipDocGenNormalizer.php | 2 +- .../Tests/Form/Type/PickPersonTypeTest.php | 3 ++- .../Normalizer/ThirdPartyNormalizer.php | 2 +- 19 files changed, 31 insertions(+), 25 deletions(-) rename src/Bundle/ChillMainBundle/Resources/views/Notification/{show.html.twig => list.html.twig} (100%) diff --git a/src/Bundle/ChillDocGeneratorBundle/Serializer/Normalizer/CollectionDocGenNormalizer.php b/src/Bundle/ChillDocGeneratorBundle/Serializer/Normalizer/CollectionDocGenNormalizer.php index 55774dd83..cd01a003a 100644 --- a/src/Bundle/ChillDocGeneratorBundle/Serializer/Normalizer/CollectionDocGenNormalizer.php +++ b/src/Bundle/ChillDocGeneratorBundle/Serializer/Normalizer/CollectionDocGenNormalizer.php @@ -26,7 +26,7 @@ class CollectionDocGenNormalizer implements ContextAwareNormalizerInterface, Nor /** * @param Collection $object - * @param null|string $format + * @param string|null $format * * @return array|ArrayObject|bool|float|int|string|void|null */ diff --git a/src/Bundle/ChillDocGeneratorBundle/Serializer/Normalizer/DocGenObjectNormalizer.php b/src/Bundle/ChillDocGeneratorBundle/Serializer/Normalizer/DocGenObjectNormalizer.php index fc4b4beb9..0a3f6e403 100644 --- a/src/Bundle/ChillDocGeneratorBundle/Serializer/Normalizer/DocGenObjectNormalizer.php +++ b/src/Bundle/ChillDocGeneratorBundle/Serializer/Normalizer/DocGenObjectNormalizer.php @@ -66,7 +66,7 @@ class DocGenObjectNormalizer implements NormalizerAwareInterface, NormalizerInte if (!$this->classMetadataFactory->hasMetadataFor($classMetadataKey)) { throw new LogicException(sprintf( 'This object does not have metadata: %s. Add groups on this entity to allow to serialize with the format %s and groups %s', - is_object($object) ? get_class($object) : '(todo' /*$context['docgen:expects'],*/, + is_object($object) ? get_class($object) : '(todo' /*$context['docgen:expects'],*/ , $format, implode(', ', ($context['groups'] ?? [])) )); diff --git a/src/Bundle/ChillMainBundle/Resources/views/Notification/show.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Notification/list.html.twig similarity index 100% rename from src/Bundle/ChillMainBundle/Resources/views/Notification/show.html.twig rename to src/Bundle/ChillMainBundle/Resources/views/Notification/list.html.twig diff --git a/src/Bundle/ChillMainBundle/Routing/MenuBuilder/UserMenuBuilder.php b/src/Bundle/ChillMainBundle/Routing/MenuBuilder/UserMenuBuilder.php index 495b2ca8b..74a8ff31d 100644 --- a/src/Bundle/ChillMainBundle/Routing/MenuBuilder/UserMenuBuilder.php +++ b/src/Bundle/ChillMainBundle/Routing/MenuBuilder/UserMenuBuilder.php @@ -52,11 +52,11 @@ class UserMenuBuilder implements LocalMenuBuilderInterface $menu ->addChild( $this->translator->trans('My notifications'), - ['route' => 'chill_main_notification_show'] + ['route' => 'chill_main_notification_my'] ) ->setExtras([ 'order' => 600, - 'icon' => 'envelope' + 'icon' => 'envelope', ]); $menu diff --git a/src/Bundle/ChillMainBundle/Serializer/Normalizer/AddressNormalizer.php b/src/Bundle/ChillMainBundle/Serializer/Normalizer/AddressNormalizer.php index f66eb4de6..119126a2e 100644 --- a/src/Bundle/ChillMainBundle/Serializer/Normalizer/AddressNormalizer.php +++ b/src/Bundle/ChillMainBundle/Serializer/Normalizer/AddressNormalizer.php @@ -48,7 +48,7 @@ class AddressNormalizer implements ContextAwareNormalizerInterface, NormalizerAw /** * @param Address $address - * @param null|string $format + * @param string|null $format */ public function normalize($address, $format = null, array $context = []) { diff --git a/src/Bundle/ChillMainBundle/Serializer/Normalizer/CollectionNormalizer.php b/src/Bundle/ChillMainBundle/Serializer/Normalizer/CollectionNormalizer.php index 7ca4d563c..08b22871f 100644 --- a/src/Bundle/ChillMainBundle/Serializer/Normalizer/CollectionNormalizer.php +++ b/src/Bundle/ChillMainBundle/Serializer/Normalizer/CollectionNormalizer.php @@ -22,7 +22,7 @@ class CollectionNormalizer implements NormalizerAwareInterface, NormalizerInterf /** * @param Collection $collection - * @param null|string $format + * @param string|null $format */ public function normalize($collection, $format = null, array $context = []) { diff --git a/src/Bundle/ChillMainBundle/Tests/Export/ExportManagerTest.php b/src/Bundle/ChillMainBundle/Tests/Export/ExportManagerTest.php index c09385e50..94266077a 100644 --- a/src/Bundle/ChillMainBundle/Tests/Export/ExportManagerTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Export/ExportManagerTest.php @@ -388,7 +388,7 @@ final class ExportManagerTest extends KernelTestCase public function testGetAggregatorNonExistant() { - $this->expectException(\RuntimeException::class); + $this->expectException(RuntimeException::class); $exportManager = $this->createExportManager(); @@ -446,7 +446,7 @@ final class ExportManagerTest extends KernelTestCase public function testGetExportNonExistant() { - $this->expectException(\RuntimeException::class); + $this->expectException(RuntimeException::class); $exportManager = $this->createExportManager(); @@ -485,7 +485,7 @@ final class ExportManagerTest extends KernelTestCase public function testGetFilterNonExistant() { - $this->expectException(\RuntimeException::class); + $this->expectException(RuntimeException::class); $exportManager = $this->createExportManager(); @@ -646,7 +646,7 @@ final class ExportManagerTest extends KernelTestCase public function testNonExistingFormatter() { - $this->expectException(\RuntimeException::class); + $this->expectException(RuntimeException::class); $exportManager = $this->createExportManager(); @@ -668,10 +668,10 @@ final class ExportManagerTest extends KernelTestCase ?UserInterface $user = null ): ExportManager { $localUser = $user ?? self::$container->get( - 'doctrine.orm.entity_manager' - ) - ->getRepository('ChillMainBundle:User') - ->findOneBy(['username' => 'center a_social']); + 'doctrine.orm.entity_manager' + ) + ->getRepository('ChillMainBundle:User') + ->findOneBy(['username' => 'center a_social']); $token = new UsernamePasswordToken($localUser, 'password', 'provider'); $tokenStorage = new TokenStorage(); $tokenStorage->setToken($token); diff --git a/src/Bundle/ChillMainBundle/Tests/Security/PasswordRecover/TokenManagerTest.php b/src/Bundle/ChillMainBundle/Tests/Security/PasswordRecover/TokenManagerTest.php index 294ddceb6..cc10e43cb 100644 --- a/src/Bundle/ChillMainBundle/Tests/Security/PasswordRecover/TokenManagerTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Security/PasswordRecover/TokenManagerTest.php @@ -16,6 +16,7 @@ use Chill\MainBundle\Security\PasswordRecover\TokenManager; use DateInterval; use DateTimeImmutable; use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; +use UnexpectedValueException; /** * @internal @@ -57,7 +58,7 @@ final class TokenManagerTest extends KernelTestCase public function testGenerateEmptyUsernameCanonical() { - $this->expectException(\UnexpectedValueException::class); + $this->expectException(UnexpectedValueException::class); $tokenManager = $this->tokenManager; // set a username, but not a username canonical diff --git a/src/Bundle/ChillMainBundle/config/services/notification.yaml b/src/Bundle/ChillMainBundle/config/services/notification.yaml index efb25c5b5..34027d631 100644 --- a/src/Bundle/ChillMainBundle/config/services/notification.yaml +++ b/src/Bundle/ChillMainBundle/config/services/notification.yaml @@ -13,4 +13,4 @@ services: $translator: '@Symfony\Component\Translation\TranslatorInterface' $routeParameters: '%chill_main.notifications%' - Chill\MainBundle\Notification\NotificationRenderer: ~ + Chill\MainBundle\Notification\NotificationHandlerManager: ~ diff --git a/src/Bundle/ChillMainBundle/translations/messages.fr.yml b/src/Bundle/ChillMainBundle/translations/messages.fr.yml index 4ae23f1e3..1d6fa70e0 100644 --- a/src/Bundle/ChillMainBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillMainBundle/translations/messages.fr.yml @@ -351,3 +351,7 @@ By: Par For: Pour Created for: Créé pour Created by: Créé par + +notification: + Notify: Notifier + Notification create: Notification envoyée diff --git a/src/Bundle/ChillPersonBundle/Controller/HouseholdMemberController.php b/src/Bundle/ChillPersonBundle/Controller/HouseholdMemberController.php index 78234d114..ddf5d9683 100644 --- a/src/Bundle/ChillPersonBundle/Controller/HouseholdMemberController.php +++ b/src/Bundle/ChillPersonBundle/Controller/HouseholdMemberController.php @@ -187,7 +187,7 @@ class HouseholdMemberController extends ApiController $_format, ['groups' => ['read']] ); - } catch (Exception\InvalidArgumentException|Exception\UnexpectedValueException $e) { + } catch (Exception\InvalidArgumentException | Exception\UnexpectedValueException $e) { throw new BadRequestException("Deserialization error: {$e->getMessage()}", 45896, $e); } diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadHouseholdPosition.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadHouseholdPosition.php index 1642a71b9..fed7d2817 100644 --- a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadHouseholdPosition.php +++ b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadHouseholdPosition.php @@ -33,7 +33,7 @@ class LoadHouseholdPosition extends Fixture { foreach ( self::POSITIONS_DATA as [$name, $share, $allowHolder, - $ordering, $ref, ] + $ordering, $ref, ] ) { $position = (new Position()) ->setLabel(['fr' => $name]) diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodDocGenNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodDocGenNormalizer.php index 4343561fc..561067652 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodDocGenNormalizer.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodDocGenNormalizer.php @@ -93,7 +93,7 @@ class AccompanyingPeriodDocGenNormalizer implements ContextAwareNormalizerInterf /** * @param AccompanyingPeriod|null $period - * @param null|string $format + * @param string|null $format */ public function normalize($period, $format = null, array $context = []) { diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodOriginNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodOriginNormalizer.php index 88dce414f..66f65b67b 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodOriginNormalizer.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodOriginNormalizer.php @@ -21,7 +21,7 @@ final class AccompanyingPeriodOriginNormalizer implements NormalizerInterface { /** * @param Origin $origin - * @param null|string $format + * @param string|null $format */ public function normalize($origin, $format = null, array $context = []) { diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodParticipationNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodParticipationNormalizer.php index b392ccc24..d9472184e 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodParticipationNormalizer.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodParticipationNormalizer.php @@ -21,7 +21,7 @@ class AccompanyingPeriodParticipationNormalizer implements NormalizerAwareInterf /** * @param AccompanyingPeriodParticipation $participation - * @param null|string $format + * @param string|null $format */ public function normalize($participation, $format = null, array $context = []) { diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonJsonNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonJsonNormalizer.php index 273c2aa32..8962acc83 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonJsonNormalizer.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonJsonNormalizer.php @@ -141,7 +141,7 @@ class PersonJsonNormalizer implements /** * @param Person $person - * @param null|string $format + * @param string|null $format */ public function normalize($person, $format = null, array $context = []) { diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/RelationshipDocGenNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/RelationshipDocGenNormalizer.php index cfae9f6e6..52a0f701c 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/RelationshipDocGenNormalizer.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/RelationshipDocGenNormalizer.php @@ -31,7 +31,7 @@ class RelationshipDocGenNormalizer implements ContextAwareNormalizerInterface, N /** * @param Relationship $relation - * @param null|string $format + * @param string|null $format */ public function normalize($relation, $format = null, array $context = []) { diff --git a/src/Bundle/ChillPersonBundle/Tests/Form/Type/PickPersonTypeTest.php b/src/Bundle/ChillPersonBundle/Tests/Form/Type/PickPersonTypeTest.php index 5c7942de3..6a9e37531 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Form/Type/PickPersonTypeTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Form/Type/PickPersonTypeTest.php @@ -12,6 +12,7 @@ declare(strict_types=1); namespace Chill\PersonBundle\Tests\Form\Type; use Chill\PersonBundle\Form\Type\PickPersonType; +use RuntimeException; use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken; use function count; @@ -52,7 +53,7 @@ final class PickPersonTypeTest extends KernelTestCase */ public function testWithInvalidOptionCenters() { - $this->expectException(\RuntimeException::class); + $this->expectException(RuntimeException::class); $this->markTestSkipped('need to inject locale into url generator without request'); $this->formFactory diff --git a/src/Bundle/ChillThirdPartyBundle/Serializer/Normalizer/ThirdPartyNormalizer.php b/src/Bundle/ChillThirdPartyBundle/Serializer/Normalizer/ThirdPartyNormalizer.php index d95192f2a..3f4fe87bf 100644 --- a/src/Bundle/ChillThirdPartyBundle/Serializer/Normalizer/ThirdPartyNormalizer.php +++ b/src/Bundle/ChillThirdPartyBundle/Serializer/Normalizer/ThirdPartyNormalizer.php @@ -30,7 +30,7 @@ class ThirdPartyNormalizer implements NormalizerAwareInterface, NormalizerInterf /** * @param ThirdParty $thirdParty - * @param null|string $format + * @param string|null $format */ public function normalize($thirdParty, $format = null, array $context = []) {