From fc9689e881ca4f03c3bf612032304976d50dbe80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 31 Oct 2022 18:22:01 +0100 Subject: [PATCH] DX: repairs code style, and psalm types --- phpstan-types.neon | 20 ------------------- .../Export/Helper/ExportAddressHelper.php | 7 +------ .../Export/Export/ListPerson.php | 2 +- .../ListPersonWithAccompanyingPeriod.php | 2 +- 4 files changed, 3 insertions(+), 28 deletions(-) diff --git a/phpstan-types.neon b/phpstan-types.neon index bf2ece912..1aae06880 100644 --- a/phpstan-types.neon +++ b/phpstan-types.neon @@ -10,16 +10,6 @@ parameters: count: 1 path: src/Bundle/ChillActivityBundle/Entity/ActivityReasonCategory.php - - - message: "#^Method Chill\\\\ActivityBundle\\\\Export\\\\Export\\\\StatActivityDuration\\:\\:getDescription\\(\\) should return string but return statement is missing\\.$#" - count: 1 - path: src/Bundle/ChillActivityBundle/Export/Export/StatActivityDuration.php - - - - message: "#^Method Chill\\\\ActivityBundle\\\\Export\\\\Export\\\\StatActivityDuration\\:\\:getTitle\\(\\) should return string but return statement is missing\\.$#" - count: 1 - path: src/Bundle/ChillActivityBundle/Export/Export/StatActivityDuration.php - - message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" count: 1 @@ -330,16 +320,6 @@ parameters: count: 6 path: src/Bundle/ChillPersonBundle/Command/ImportPeopleFromCSVCommand.php - - - message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" - count: 1 - path: src/Bundle/ChillPersonBundle/Export/Aggregator/CountryOfBirthAggregator.php - - - - message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" - count: 1 - path: src/Bundle/ChillPersonBundle/Export/Aggregator/NationalityAggregator.php - - message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" count: 1 diff --git a/src/Bundle/ChillMainBundle/Export/Helper/ExportAddressHelper.php b/src/Bundle/ChillMainBundle/Export/Helper/ExportAddressHelper.php index 268abc3ea..2f9a270ff 100644 --- a/src/Bundle/ChillMainBundle/Export/Helper/ExportAddressHelper.php +++ b/src/Bundle/ChillMainBundle/Export/Helper/ExportAddressHelper.php @@ -58,7 +58,7 @@ class ExportAddressHelper 'country' => ['country'], 'postal_code' => ['postcode_code', 'postcode_name'], 'street' => ['street', 'streetNumber'], - 'building' => ['buildingName', 'corridor', 'distribution', 'extra', 'flat', 'floor'], + 'building' => ['buildingName', 'corridor', 'distribution', 'extra', 'flat', 'floor', 'steps'], 'string' => ['_as_string'], 'attributes' => ['isNoAddress', 'confidential', 'id'], 'geom' => ['_lat', '_lon'], @@ -97,7 +97,6 @@ class ExportAddressHelper case 'street': case 'streetNumber': - case 'building': case 'floor': case 'corridor': case 'steps': @@ -238,10 +237,6 @@ class ExportAddressHelper return $translationPrefix . $sanitizedKey; } - if (null === $value) { - return ''; - } - switch ($value) { case null: return ''; diff --git a/src/Bundle/ChillPersonBundle/Export/Export/ListPerson.php b/src/Bundle/ChillPersonBundle/Export/Export/ListPerson.php index 549fe1c4d..acaeb498c 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/ListPerson.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/ListPerson.php @@ -187,7 +187,7 @@ class ListPerson implements ExportElementValidatedInterface, ListInterface, Grou } /** - * param array{fields: string[], address_date: DateTimeImmutable} $data + * param array{fields: string[], address_date: DateTimeImmutable} $data. */ public function initiateQuery(array $requiredModifiers, array $acl, array $data = []) { diff --git a/src/Bundle/ChillPersonBundle/Export/Export/ListPersonWithAccompanyingPeriod.php b/src/Bundle/ChillPersonBundle/Export/Export/ListPersonWithAccompanyingPeriod.php index 7ddc6c9d3..bab67fb39 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/ListPersonWithAccompanyingPeriod.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/ListPersonWithAccompanyingPeriod.php @@ -155,7 +155,7 @@ class ListPersonWithAccompanyingPeriod implements ExportElementValidatedInterfac } /** - * param array{fields: string[], address_date: DateTimeImmutable} $data + * param array{fields: string[], address_date: DateTimeImmutable} $data. */ public function initiateQuery(array $requiredModifiers, array $acl, array $data = []) {