DX: fix phstan & cs

This commit is contained in:
Julien Fastré 2023-03-05 17:43:44 +01:00
parent 4dbb195b45
commit 8695099819
Signed by: julienfastre
GPG Key ID: BDE2190974723FCB
25 changed files with 119 additions and 349 deletions

View File

@ -235,11 +235,6 @@ parameters:
count: 1 count: 1
path: src/Bundle/ChillMainBundle/Serializer/Normalizer/DoctrineExistingEntityNormalizer.php path: src/Bundle/ChillMainBundle/Serializer/Normalizer/DoctrineExistingEntityNormalizer.php
-
message: "#^Call to method Chill\\\\MainBundle\\\\Entity\\\\Address\\:\\:getPostcode\\(\\) with incorrect case\\: getPostCode$#"
count: 6
path: src/Bundle/ChillMainBundle/Templating/Entity/AddressRender.php
- -
message: "#^Only booleans are allowed in a negated boolean, null given\\.$#" message: "#^Only booleans are allowed in a negated boolean, null given\\.$#"
count: 1 count: 1

View File

@ -10,31 +10,11 @@ parameters:
count: 1 count: 1
path: src/Bundle/ChillActivityBundle/Repository/ActivityReasonRepository.php path: src/Bundle/ChillActivityBundle/Repository/ActivityReasonRepository.php
-
message: "#^Parameter \\#1 \\$entity \\(Chill\\\\ActivityBundle\\\\Entity\\\\ActivityReason\\) of method Chill\\\\ActivityBundle\\\\Templating\\\\Entity\\\\ActivityReasonRender\\:\\:renderString\\(\\) should be contravariant with parameter \\$entity \\(object\\) of method Chill\\\\MainBundle\\\\Templating\\\\Entity\\\\ChillEntityRenderInterface\\:\\:renderString\\(\\)$#"
count: 2
path: src/Bundle/ChillActivityBundle/Templating/Entity/ActivityReasonRender.php
- -
message: "#^Return type \\(array\\<array\\<string\\>\\>\\) of method Chill\\\\AsideActivityBundle\\\\Security\\\\AsideActivityVoter\\:\\:getRolesWithHierarchy\\(\\) should be covariant with return type \\(array\\<string, array\\<int, string\\>\\>\\) of method Chill\\\\MainBundle\\\\Security\\\\ProvideRoleHierarchyInterface\\:\\:getRolesWithHierarchy\\(\\)$#" message: "#^Return type \\(array\\<array\\<string\\>\\>\\) of method Chill\\\\AsideActivityBundle\\\\Security\\\\AsideActivityVoter\\:\\:getRolesWithHierarchy\\(\\) should be covariant with return type \\(array\\<string, array\\<int, string\\>\\>\\) of method Chill\\\\MainBundle\\\\Security\\\\ProvideRoleHierarchyInterface\\:\\:getRolesWithHierarchy\\(\\)$#"
count: 1 count: 1
path: src/Bundle/ChillAsideActivityBundle/src/Security/AsideActivityVoter.php path: src/Bundle/ChillAsideActivityBundle/src/Security/AsideActivityVoter.php
-
message: "#^Parameter \\#1 \\$asideActivityCategory \\(Chill\\\\AsideActivityBundle\\\\Entity\\\\AsideActivityCategory\\) of method Chill\\\\AsideActivityBundle\\\\Templating\\\\Entity\\\\CategoryRender\\:\\:renderBox\\(\\) should be contravariant with parameter \\$entity \\(Chill\\\\MainBundle\\\\Templating\\\\Entity\\\\type\\) of method Chill\\\\MainBundle\\\\Templating\\\\Entity\\\\ChillEntityRenderInterface\\:\\:renderBox\\(\\)$#"
count: 1
path: src/Bundle/ChillAsideActivityBundle/src/Templating/Entity/CategoryRender.php
-
message: "#^Parameter \\#1 \\$asideActivityCategory \\(Chill\\\\AsideActivityBundle\\\\Entity\\\\AsideActivityCategory\\) of method Chill\\\\AsideActivityBundle\\\\Templating\\\\Entity\\\\CategoryRender\\:\\:renderString\\(\\) should be contravariant with parameter \\$entity \\(object\\) of method Chill\\\\MainBundle\\\\Templating\\\\Entity\\\\ChillEntityRenderInterface\\:\\:renderString\\(\\)$#"
count: 1
path: src/Bundle/ChillAsideActivityBundle/src/Templating/Entity/CategoryRender.php
-
message: "#^Parameter \\#1 \\$asideActivityCategory \\(Chill\\\\AsideActivityBundle\\\\Entity\\\\AsideActivityCategory\\) of method Chill\\\\AsideActivityBundle\\\\Templating\\\\Entity\\\\CategoryRender\\:\\:supports\\(\\) should be contravariant with parameter \\$entity \\(object\\) of method Chill\\\\MainBundle\\\\Templating\\\\Entity\\\\ChillEntityRenderInterface\\:\\:supports\\(\\)$#"
count: 1
path: src/Bundle/ChillAsideActivityBundle/src/Templating/Entity/CategoryRender.php
- -
message: "#^Parameter \\#1 \\$criteria \\(array\\<string, mixed\\>\\) of method Chill\\\\CalendarBundle\\\\Repository\\\\CalendarDocRepository\\:\\:findBy\\(\\) should be contravariant with parameter \\$criteria \\(array\\) of method Chill\\\\CalendarBundle\\\\Repository\\\\CalendarDocRepositoryInterface\\:\\:findBy\\(\\)$#" message: "#^Parameter \\#1 \\$criteria \\(array\\<string, mixed\\>\\) of method Chill\\\\CalendarBundle\\\\Repository\\\\CalendarDocRepository\\:\\:findBy\\(\\) should be contravariant with parameter \\$criteria \\(array\\) of method Chill\\\\CalendarBundle\\\\Repository\\\\CalendarDocRepositoryInterface\\:\\:findBy\\(\\)$#"
count: 1 count: 1
@ -431,20 +411,6 @@ parameters:
count: 1 count: 1
path: src/Bundle/ChillMainBundle/Serializer/Normalizer/UserNormalizer.php path: src/Bundle/ChillMainBundle/Serializer/Normalizer/UserNormalizer.php
-
message: "#^Parameter \\#1 \\$entity \\(Chill\\\\MainBundle\\\\Entity\\\\Embeddable\\\\CommentEmbeddable\\) of method Chill\\\\MainBundle\\\\Templating\\\\Entity\\\\CommentRender\\:\\:renderBox\\(\\) should be contravariant with parameter \\$entity \\(Chill\\\\MainBundle\\\\Templating\\\\Entity\\\\type\\) of method Chill\\\\MainBundle\\\\Templating\\\\Entity\\\\ChillEntityRenderInterface\\:\\:renderBox\\(\\)$#"
count: 2
path: src/Bundle/ChillMainBundle/Templating/Entity/CommentRender.php
-
message: "#^Parameter \\#1 \\$entity \\(Chill\\\\MainBundle\\\\Entity\\\\Embeddable\\\\CommentEmbeddable\\) of method Chill\\\\MainBundle\\\\Templating\\\\Entity\\\\CommentRender\\:\\:renderString\\(\\) should be contravariant with parameter \\$entity \\(object\\) of method Chill\\\\MainBundle\\\\Templating\\\\Entity\\\\ChillEntityRenderInterface\\:\\:renderString\\(\\)$#"
count: 2
path: src/Bundle/ChillMainBundle/Templating/Entity/CommentRender.php
-
message: "#^Parameter \\#1 \\$entity \\(Chill\\\\MainBundle\\\\Entity\\\\User\\) of method Chill\\\\MainBundle\\\\Templating\\\\Entity\\\\UserRender\\:\\:renderString\\(\\) should be contravariant with parameter \\$entity \\(object\\) of method Chill\\\\MainBundle\\\\Templating\\\\Entity\\\\ChillEntityRenderInterface\\:\\:renderString\\(\\)$#"
count: 1
path: src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php
- -
message: "#^Parameter \\#1 \\$value \\(string\\) of method Chill\\\\MainBundle\\\\Validation\\\\Validator\\\\ValidPhonenumber\\:\\:validate\\(\\) should be contravariant with parameter \\$value \\(mixed\\) of method Symfony\\\\Component\\\\Validator\\\\ConstraintValidatorInterface\\:\\:validate\\(\\)$#" message: "#^Parameter \\#1 \\$value \\(string\\) of method Chill\\\\MainBundle\\\\Validation\\\\Validator\\\\ValidPhonenumber\\:\\:validate\\(\\) should be contravariant with parameter \\$value \\(mixed\\) of method Symfony\\\\Component\\\\Validator\\\\ConstraintValidatorInterface\\:\\:validate\\(\\)$#"
@ -767,31 +733,6 @@ parameters:
path: src/Bundle/ChillPersonBundle/Serializer/Normalizer/WorkflowNormalizer.php path: src/Bundle/ChillPersonBundle/Serializer/Normalizer/WorkflowNormalizer.php
-
message: "#^Parameter \\#1 \\$entity \\(Chill\\\\PersonBundle\\\\Entity\\\\AccompanyingPeriod\\\\ClosingMotive\\) of method Chill\\\\PersonBundle\\\\Templating\\\\Entity\\\\ClosingMotiveRender\\:\\:renderString\\(\\) should be contravariant with parameter \\$entity \\(object\\) of method Chill\\\\MainBundle\\\\Templating\\\\Entity\\\\ChillEntityRenderInterface\\:\\:renderString\\(\\)$#"
count: 2
path: src/Bundle/ChillPersonBundle/Templating/Entity/ClosingMotiveRender.php
-
message: "#^Parameter \\#1 \\$person \\(Chill\\\\PersonBundle\\\\Entity\\\\Person\\) of method Chill\\\\PersonBundle\\\\Templating\\\\Entity\\\\PersonRender\\:\\:renderBox\\(\\) should be contravariant with parameter \\$entity \\(Chill\\\\MainBundle\\\\Templating\\\\Entity\\\\type\\) of method Chill\\\\MainBundle\\\\Templating\\\\Entity\\\\ChillEntityRenderInterface\\:\\:renderBox\\(\\)$#"
count: 3
path: src/Bundle/ChillPersonBundle/Templating/Entity/PersonRender.php
-
message: "#^Parameter \\#1 \\$person \\(Chill\\\\PersonBundle\\\\Entity\\\\Person\\) of method Chill\\\\PersonBundle\\\\Templating\\\\Entity\\\\PersonRender\\:\\:renderString\\(\\) should be contravariant with parameter \\$entity \\(object\\) of method Chill\\\\MainBundle\\\\Templating\\\\Entity\\\\ChillEntityRenderInterface\\:\\:renderString\\(\\)$#"
count: 3
path: src/Bundle/ChillPersonBundle/Templating/Entity/PersonRender.php
-
message: "#^Parameter \\#1 \\$socialIssue \\(Chill\\\\PersonBundle\\\\Entity\\\\SocialWork\\\\SocialIssue\\) of method Chill\\\\PersonBundle\\\\Templating\\\\Entity\\\\SocialIssueRender\\:\\:renderBox\\(\\) should be contravariant with parameter \\$entity \\(Chill\\\\MainBundle\\\\Templating\\\\Entity\\\\type\\) of method Chill\\\\MainBundle\\\\Templating\\\\Entity\\\\ChillEntityRenderInterface\\:\\:renderBox\\(\\)$#"
count: 1
path: src/Bundle/ChillPersonBundle/Templating/Entity/SocialIssueRender.php
-
message: "#^Parameter \\#1 \\$socialIssue \\(Chill\\\\PersonBundle\\\\Entity\\\\SocialWork\\\\SocialIssue\\) of method Chill\\\\PersonBundle\\\\Templating\\\\Entity\\\\SocialIssueRender\\:\\:renderString\\(\\) should be contravariant with parameter \\$entity \\(object\\) of method Chill\\\\MainBundle\\\\Templating\\\\Entity\\\\ChillEntityRenderInterface\\:\\:renderString\\(\\)$#"
count: 1
path: src/Bundle/ChillPersonBundle/Templating/Entity/SocialIssueRender.php
- -
message: "#^Parameter \\#1 \\$object \\(Chill\\\\PersonBundle\\\\Entity\\\\AccompanyingPeriod\\\\AccompanyingPeriodWorkEvaluationDocument\\) of method Chill\\\\PersonBundle\\\\Workflow\\\\AccompanyingPeriodWorkEvaluationDocumentWorkflowHandler\\:\\:getRelatedObjects\\(\\) should be contravariant with parameter \\$object \\(object\\) of method Chill\\\\MainBundle\\\\Workflow\\\\EntityWorkflowHandlerInterface\\:\\:getRelatedObjects\\(\\)$#" message: "#^Parameter \\#1 \\$object \\(Chill\\\\PersonBundle\\\\Entity\\\\AccompanyingPeriod\\\\AccompanyingPeriodWorkEvaluationDocument\\) of method Chill\\\\PersonBundle\\\\Workflow\\\\AccompanyingPeriodWorkEvaluationDocumentWorkflowHandler\\:\\:getRelatedObjects\\(\\) should be contravariant with parameter \\$object \\(object\\) of method Chill\\\\MainBundle\\\\Workflow\\\\EntityWorkflowHandlerInterface\\:\\:getRelatedObjects\\(\\)$#"
count: 1 count: 1
@ -857,16 +798,6 @@ parameters:
count: 1 count: 1
path: src/Bundle/ChillThirdPartyBundle/Serializer/Normalizer/ThirdPartyNormalizer.php path: src/Bundle/ChillThirdPartyBundle/Serializer/Normalizer/ThirdPartyNormalizer.php
-
message: "#^Parameter \\#1 \\$entity \\(Chill\\\\ThirdPartyBundle\\\\Entity\\\\ThirdParty\\) of method Chill\\\\ThirdPartyBundle\\\\Templating\\\\Entity\\\\ThirdPartyRender\\:\\:renderBox\\(\\) should be contravariant with parameter \\$entity \\(Chill\\\\MainBundle\\\\Templating\\\\Entity\\\\type\\) of method Chill\\\\MainBundle\\\\Templating\\\\Entity\\\\ChillEntityRenderInterface\\:\\:renderBox\\(\\)$#"
count: 2
path: src/Bundle/ChillThirdPartyBundle/Templating/Entity/ThirdPartyRender.php
-
message: "#^Parameter \\#1 \\$entity \\(Chill\\\\ThirdPartyBundle\\\\Entity\\\\ThirdParty\\) of method Chill\\\\ThirdPartyBundle\\\\Templating\\\\Entity\\\\ThirdPartyRender\\:\\:renderString\\(\\) should be contravariant with parameter \\$entity \\(object\\) of method Chill\\\\MainBundle\\\\Templating\\\\Entity\\\\ChillEntityRenderInterface\\:\\:renderString\\(\\)$#"
count: 2
path: src/Bundle/ChillThirdPartyBundle/Templating/Entity/ThirdPartyRender.php
- -
message: "#^Parameter \\#1 \\$document \\(Chill\\\\DocStoreBundle\\\\Entity\\\\StoredObject\\) of method Chill\\\\WopiBundle\\\\Service\\\\Wopi\\\\ChillDocumentManager\\:\\:getBasename\\(\\) should be contravariant with parameter \\$document \\(ChampsLibres\\\\WopiLib\\\\Contract\\\\Entity\\\\Document\\) of method ChampsLibres\\\\WopiLib\\\\Contract\\\\Service\\\\DocumentManagerInterface\\:\\:getBasename\\(\\)$#" message: "#^Parameter \\#1 \\$document \\(Chill\\\\DocStoreBundle\\\\Entity\\\\StoredObject\\) of method Chill\\\\WopiBundle\\\\Service\\\\Wopi\\\\ChillDocumentManager\\:\\:getBasename\\(\\) should be contravariant with parameter \\$document \\(ChampsLibres\\\\WopiLib\\\\Contract\\\\Entity\\\\Document\\) of method ChampsLibres\\\\WopiLib\\\\Contract\\\\Service\\\\DocumentManagerInterface\\:\\:getBasename\\(\\)$#"
count: 1 count: 1

View File

@ -175,21 +175,6 @@ parameters:
count: 1 count: 1
path: src/Bundle/ChillActivityBundle/Service/DocGenerator/ActivityContext.php path: src/Bundle/ChillActivityBundle/Service/DocGenerator/ActivityContext.php
-
message: "#^Call to method getCategory\\(\\) on an unknown class Chill\\\\MainBundle\\\\Templating\\\\Entity\\\\type\\.$#"
count: 1
path: src/Bundle/ChillActivityBundle/Templating/Entity/ActivityReasonRender.php
-
message: "#^Call to method getName\\(\\) on an unknown class Chill\\\\MainBundle\\\\Templating\\\\Entity\\\\type\\.$#"
count: 1
path: src/Bundle/ChillActivityBundle/Templating/Entity/ActivityReasonRender.php
-
message: "#^Parameter \\$entity of method Chill\\\\ActivityBundle\\\\Templating\\\\Entity\\\\ActivityReasonRender\\:\\:renderBox\\(\\) has invalid type Chill\\\\MainBundle\\\\Templating\\\\Entity\\\\type\\.$#"
count: 1
path: src/Bundle/ChillActivityBundle/Templating/Entity/ActivityReasonRender.php
- -
message: "#^Parameter \\$context of method Chill\\\\ActivityBundle\\\\Timeline\\\\TimelineActivityProvider\\:\\:getEntityTemplate\\(\\) has invalid type Chill\\\\MainBundle\\\\Timeline\\\\type\\.$#" message: "#^Parameter \\$context of method Chill\\\\ActivityBundle\\\\Timeline\\\\TimelineActivityProvider\\:\\:getEntityTemplate\\(\\) has invalid type Chill\\\\MainBundle\\\\Timeline\\\\type\\.$#"
count: 1 count: 1
@ -255,11 +240,6 @@ parameters:
count: 1 count: 1
path: src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivityCategory.php path: src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivityCategory.php
-
message: "#^Call to an undefined method Chill\\\\AsideActivityBundle\\\\Entity\\\\AsideActivityCategory\\:\\:getName\\(\\)\\.$#"
count: 1
path: src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByActivityTypeFilter.php
- -
message: "#^Call to method DateTimeImmutable\\:\\:add\\(\\) on a separate line has no effect\\.$#" message: "#^Call to method DateTimeImmutable\\:\\:add\\(\\) on a separate line has no effect\\.$#"
count: 1 count: 1
@ -275,11 +255,6 @@ parameters:
count: 1 count: 1
path: src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityFormType.php path: src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityFormType.php
-
message: "#^Instanceof between Chill\\\\AsideActivityBundle\\\\Entity\\\\AsideActivityCategory and Chill\\\\AsideActivityBundle\\\\Entity\\\\AsideActivityCategory will always evaluate to true\\.$#"
count: 1
path: src/Bundle/ChillAsideActivityBundle/src/Templating/Entity/CategoryRender.php
- -
message: "#^Static call to instance method Chill\\\\BudgetBundle\\\\Calculator\\\\CalculatorInterface\\:\\:getAlias\\(\\)\\.$#" message: "#^Static call to instance method Chill\\\\BudgetBundle\\\\Calculator\\\\CalculatorInterface\\:\\:getAlias\\(\\)\\.$#"
count: 3 count: 3
@ -430,11 +405,6 @@ parameters:
count: 1 count: 1
path: src/Bundle/ChillBudgetBundle/Service/Summary/SummaryBudget.php path: src/Bundle/ChillBudgetBundle/Service/Summary/SummaryBudget.php
-
message: "#^Parameter \\$entity of method Chill\\\\BudgetBundle\\\\Templating\\\\BudgetElementTypeRender\\:\\:renderBox\\(\\) has invalid type Chill\\\\MainBundle\\\\Templating\\\\Entity\\\\type\\.$#"
count: 1
path: src/Bundle/ChillBudgetBundle/Templating/BudgetElementTypeRender.php
- -
message: "#^Property Chill\\\\CalendarBundle\\\\Command\\\\AzureGrantAdminConsentAndAcquireToken\\:\\:\\$clientRegistry is never read, only written\\.$#" message: "#^Property Chill\\\\CalendarBundle\\\\Command\\\\AzureGrantAdminConsentAndAcquireToken\\:\\:\\$clientRegistry is never read, only written\\.$#"
count: 1 count: 1
@ -565,16 +535,6 @@ parameters:
count: 1 count: 1
path: src/Bundle/ChillCalendarBundle/Security/Voter/CalendarVoter.php path: src/Bundle/ChillCalendarBundle/Security/Voter/CalendarVoter.php
-
message: "#^Default value of the parameter \\#3 \\$contextGenerationData \\(array\\{\\}\\) of method Chill\\\\CalendarBundle\\\\Service\\\\DocGenerator\\\\CalendarContext\\:\\:getData\\(\\) is incompatible with type array\\{mainPerson\\?\\: Chill\\\\PersonBundle\\\\Entity\\\\Person, thirdParty\\?\\: Chill\\\\ThirdPartyBundle\\\\Entity\\\\ThirdParty, title\\: string\\}\\.$#"
count: 1
path: src/Bundle/ChillCalendarBundle/Service/DocGenerator/CalendarContext.php
-
message: "#^Offset 'trackDatetime' does not exist on array\\{askMainPerson\\: bool, mainPersonLabel\\: string\\|null, askThirdParty\\: bool, thirdPartyLabel\\: string\\|null, trackDateTime\\: bool\\}\\.$#"
count: 1
path: src/Bundle/ChillCalendarBundle/Service/DocGenerator/CalendarContext.php
- -
message: "#^Call to an undefined method Symfony\\\\Component\\\\Console\\\\Helper\\\\HelperInterface\\:\\:ask\\(\\)\\.$#" message: "#^Call to an undefined method Symfony\\\\Component\\\\Console\\\\Helper\\\\HelperInterface\\:\\:ask\\(\\)\\.$#"
count: 1 count: 1
@ -2105,15 +2065,6 @@ parameters:
count: 1 count: 1
path: src/Bundle/ChillMainBundle/Entity/Country.php path: src/Bundle/ChillMainBundle/Entity/Country.php
-
message: "#^Method Chill\\\\MainBundle\\\\Entity\\\\Embeddable\\\\CommentEmbeddable\\:\\:getUserId\\(\\) has invalid return type Chill\\\\MainBundle\\\\Entity\\\\Embeddable\\\\interger\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Entity/Embeddable/CommentEmbeddable.php
-
message: "#^Method Chill\\\\MainBundle\\\\Entity\\\\Embeddable\\\\CommentEmbeddable\\:\\:getUserId\\(\\) should return Chill\\\\MainBundle\\\\Entity\\\\Embeddable\\\\interger but returns int\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Entity/Embeddable/CommentEmbeddable.php
- -
message: "#^Property Chill\\\\MainBundle\\\\Entity\\\\GeographicalUnit\\:\\:\\$geom is unused\\.$#" message: "#^Property Chill\\\\MainBundle\\\\Entity\\\\GeographicalUnit\\:\\:\\$geom is unused\\.$#"
@ -2515,11 +2466,6 @@ parameters:
count: 2 count: 2
path: src/Bundle/ChillMainBundle/Form/Type/Export/ExportType.php path: src/Bundle/ChillMainBundle/Form/Type/Export/ExportType.php
-
message: "#^Call to an undefined method Chill\\\\MainBundle\\\\Center\\\\GroupingCenterInterface\\:\\:getName\\(\\)\\.$#"
count: 2
path: src/Bundle/ChillMainBundle/Form/Type/Export/PickCenterType.php
- -
message: "#^Property Chill\\\\MainBundle\\\\Form\\\\Type\\\\Select2CountryType\\:\\:\\$requestStack is never read, only written\\.$#" message: "#^Property Chill\\\\MainBundle\\\\Form\\\\Type\\\\Select2CountryType\\:\\:\\$requestStack is never read, only written\\.$#"
count: 1 count: 1
@ -2845,11 +2791,6 @@ parameters:
count: 1 count: 1
path: src/Bundle/ChillMainBundle/Serializer/Normalizer/CommentEmbeddableDocGenNormalizer.php path: src/Bundle/ChillMainBundle/Serializer/Normalizer/CommentEmbeddableDocGenNormalizer.php
-
message: "#^Strict comparison using \\=\\=\\= between null and Chill\\\\MainBundle\\\\Entity\\\\Embeddable\\\\interger will always evaluate to false\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Serializer/Normalizer/CommentEmbeddableDocGenNormalizer.php
- -
message: "#^Method Chill\\\\MainBundle\\\\Serializer\\\\Normalizer\\\\DateNormalizer\\:\\:normalize\\(\\) should return array\\|ArrayObject\\|bool\\|float\\|int\\|string\\|null but return statement is missing\\.$#" message: "#^Method Chill\\\\MainBundle\\\\Serializer\\\\Normalizer\\\\DateNormalizer\\:\\:normalize\\(\\) should return array\\|ArrayObject\\|bool\\|float\\|int\\|string\\|null but return statement is missing\\.$#"
count: 1 count: 1
@ -2915,46 +2856,6 @@ parameters:
count: 1 count: 1
path: src/Bundle/ChillMainBundle/Templating/ChillTwigHelper.php path: src/Bundle/ChillMainBundle/Templating/ChillTwigHelper.php
-
message: "#^PHPDoc tag @param for parameter \\$addr with type mixed is not subtype of native type Chill\\\\MainBundle\\\\Entity\\\\Address\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Templating/Entity/AddressRender.php
-
message: "#^PHPDoc tag @param has invalid value \\(Address addr\\)\\: Unexpected token \"addr\", expected variable at offset 26$#"
count: 3
path: src/Bundle/ChillMainBundle/Templating/Entity/AddressRender.php
-
message: "#^Strict comparison using \\!\\=\\= between null and Chill\\\\MainBundle\\\\Entity\\\\the will always evaluate to true\\.$#"
count: 2
path: src/Bundle/ChillMainBundle/Templating/Entity/AddressRender.php
-
message: "#^Strict comparison using \\=\\=\\= between Chill\\\\MainBundle\\\\Entity\\\\the and 'FR' will always evaluate to false\\.$#"
count: 3
path: src/Bundle/ChillMainBundle/Templating/Entity/AddressRender.php
-
message: "#^Parameter \\$entity of method Chill\\\\MainBundle\\\\Templating\\\\Entity\\\\ChillEntityRender\\:\\:renderBox\\(\\) has invalid type Chill\\\\MainBundle\\\\Templating\\\\Entity\\\\type\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Templating/Entity/ChillEntityRender.php
-
message: "#^Parameter \\$entity of method Chill\\\\MainBundle\\\\Templating\\\\Entity\\\\ChillEntityRenderInterface\\:\\:renderBox\\(\\) has invalid type Chill\\\\MainBundle\\\\Templating\\\\Entity\\\\type\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Templating/Entity/ChillEntityRenderInterface.php
-
message: "#^If condition is always true\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Templating/Entity/CommentRender.php
-
message: "#^Parameter \\$entity of method Chill\\\\MainBundle\\\\Templating\\\\Entity\\\\UserRender\\:\\:renderBox\\(\\) has invalid type Chill\\\\MainBundle\\\\Templating\\\\Entity\\\\type\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php
- -
message: "#^PHPDoc tag @return has invalid value \\(array\\<'to'\\: DateTimeImmutable, 'from'\\: DateTimeImmutable\\>\\)\\: Unexpected token \"\\:\", expected '\\>' at offset 29$#" message: "#^PHPDoc tag @return has invalid value \\(array\\<'to'\\: DateTimeImmutable, 'from'\\: DateTimeImmutable\\>\\)\\: Unexpected token \"\\:\", expected '\\>' at offset 29$#"
count: 1 count: 1
@ -4301,26 +4202,6 @@ parameters:
count: 1 count: 1
path: src/Bundle/ChillPersonBundle/Service/Import/SocialWorkMetadata.php path: src/Bundle/ChillPersonBundle/Service/Import/SocialWorkMetadata.php
-
message: "#^Parameter \\$entity of method Chill\\\\PersonBundle\\\\Templating\\\\Entity\\\\ClosingMotiveRender\\:\\:renderBox\\(\\) has invalid type Chill\\\\MainBundle\\\\Templating\\\\Entity\\\\type\\.$#"
count: 1
path: src/Bundle/ChillPersonBundle/Templating/Entity/ClosingMotiveRender.php
-
message: "#^Call to method getTitle\\(\\) on an unknown class Chill\\\\MainBundle\\\\Templating\\\\Entity\\\\type\\.$#"
count: 1
path: src/Bundle/ChillPersonBundle/Templating/Entity/ResourceKindRender.php
-
message: "#^Parameter \\$entity of method Chill\\\\PersonBundle\\\\Templating\\\\Entity\\\\ResourceKindRender\\:\\:renderBox\\(\\) has invalid type Chill\\\\MainBundle\\\\Templating\\\\Entity\\\\type\\.$#"
count: 1
path: src/Bundle/ChillPersonBundle/Templating/Entity/ResourceKindRender.php
-
message: "#^Parameter \\$socialAction of method Chill\\\\PersonBundle\\\\Templating\\\\Entity\\\\SocialActionRender\\:\\:renderBox\\(\\) has invalid type Chill\\\\MainBundle\\\\Templating\\\\Entity\\\\type\\.$#"
count: 1
path: src/Bundle/ChillPersonBundle/Templating/Entity/SocialActionRender.php
- -
message: "#^Call to method getId\\(\\) on an unknown class ChillPersonBundle\\:AccompanyingPeriod\\.$#" message: "#^Call to method getId\\(\\) on an unknown class ChillPersonBundle\\:AccompanyingPeriod\\.$#"
count: 1 count: 1

View File

@ -25,21 +25,6 @@ parameters:
count: 1 count: 1
path: src/Bundle/ChillCalendarBundle/Controller/InviteApiController.php path: src/Bundle/ChillCalendarBundle/Controller/InviteApiController.php
-
message: "#^Parameter \\#1 \\$name of method Chill\\\\MainBundle\\\\Entity\\\\Country\\:\\:setName\\(\\) expects string, array\\<string, string\\> given\\.$#"
count: 1
path: src/Bundle/ChillCalendarBundle/DataFixtures/ORM/LoadCalendarRange.php
-
message: "#^Parameter \\#1 \\$title of method Chill\\\\MainBundle\\\\Entity\\\\LocationType\\:\\:setTitle\\(\\) expects array, string given\\.$#"
count: 1
path: src/Bundle/ChillCalendarBundle/DataFixtures/ORM/LoadCalendarRange.php
-
message: "#^Parameter \\#1 \\$status of method Chill\\\\CalendarBundle\\\\Entity\\\\Invite\\:\\:setStatus\\(\\) expects string, array\\<string, string\\> given\\.$#"
count: 1
path: src/Bundle/ChillCalendarBundle/DataFixtures/ORM/LoadInvite.php
- -
message: "#^Parameter \\#2 \\$byUser of class Chill\\\\CalendarBundle\\\\Messenger\\\\Message\\\\CalendarRemovedMessage constructor expects Chill\\\\MainBundle\\\\Entity\\\\User\\|null, Symfony\\\\Component\\\\Security\\\\Core\\\\User\\\\UserInterface\\|null given\\.$#" message: "#^Parameter \\#2 \\$byUser of class Chill\\\\CalendarBundle\\\\Messenger\\\\Message\\\\CalendarRemovedMessage constructor expects Chill\\\\MainBundle\\\\Entity\\\\User\\|null, Symfony\\\\Component\\\\Security\\\\Core\\\\User\\\\UserInterface\\|null given\\.$#"
count: 1 count: 1
@ -570,11 +555,6 @@ parameters:
count: 2 count: 2
path: src/Bundle/ChillPersonBundle/Form/ChoiceLoader/PersonChoiceLoader.php path: src/Bundle/ChillPersonBundle/Form/ChoiceLoader/PersonChoiceLoader.php
-
message: "#^Parameter \\#1 \\$entity of method Chill\\\\PersonBundle\\\\Templating\\\\Entity\\\\ClosingMotiveRender\\:\\:renderString\\(\\) expects Chill\\\\PersonBundle\\\\Entity\\\\AccompanyingPeriod\\\\ClosingMotive, Chill\\\\MainBundle\\\\Templating\\\\Entity\\\\type given\\.$#"
count: 1
path: src/Bundle/ChillPersonBundle/Templating/Entity/ClosingMotiveRender.php
- -
message: "#^Parameter \\#1 \\$entityName of method Doctrine\\\\ORM\\\\EntityManager\\:\\:getRepository\\(\\) expects class\\-string\\<ChillPersonBundle\\:AccompanyingPeriod\\>, string given\\.$#" message: "#^Parameter \\#1 \\$entityName of method Doctrine\\\\ORM\\\\EntityManager\\:\\:getRepository\\(\\) expects class\\-string\\<ChillPersonBundle\\:AccompanyingPeriod\\>, string given\\.$#"
count: 1 count: 1

View File

@ -340,11 +340,6 @@ parameters:
count: 1 count: 1
path: src/Bundle/ChillPersonBundle/Search/PersonSearch.php path: src/Bundle/ChillPersonBundle/Search/PersonSearch.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 2
path: src/Bundle/ChillPersonBundle/Templating/Entity/ClosingMotiveRender.php
- -
message: "#^Method Chill\\\\ReportBundle\\\\DataFixtures\\\\ORM\\\\LoadReports\\:\\:getRandomChoice\\(\\) should return array\\<string\\>\\|string but return statement is missing\\.$#" message: "#^Method Chill\\\\ReportBundle\\\\DataFixtures\\\\ORM\\\\LoadReports\\:\\:getRandomChoice\\(\\) should return array\\<string\\>\\|string but return statement is missing\\.$#"
count: 1 count: 1

View File

@ -13,13 +13,18 @@ namespace Chill\ActivityBundle\Templating\Entity;
use Chill\ActivityBundle\Entity\ActivityReason; use Chill\ActivityBundle\Entity\ActivityReason;
use Chill\MainBundle\Templating\Entity\AbstractChillEntityRender; use Chill\MainBundle\Templating\Entity\AbstractChillEntityRender;
use Chill\MainBundle\Templating\Entity\BoxUtilsChillEntityRenderTrait;
use Chill\MainBundle\Templating\Entity\ChillEntityRenderInterface;
use Chill\MainBundle\Templating\TranslatableStringHelper; use Chill\MainBundle\Templating\TranslatableStringHelper;
/** /**
* Render activity reason. * Render activity reason.
*
* @implements ChillEntityRenderInterface<ActivityReason>
*/ */
class ActivityReasonRender extends AbstractChillEntityRender class ActivityReasonRender implements ChillEntityRenderInterface
{ {
use BoxUtilsChillEntityRenderTrait;
/** /**
* @var TranslatableStringHelper * @var TranslatableStringHelper
*/ */
@ -51,9 +56,6 @@ class ActivityReasonRender extends AbstractChillEntityRender
$this->getDefaultClosingBox(); $this->getDefaultClosingBox();
} }
/**
* @param ActivityReason $entity
*/
public function renderString($entity, array $options): string public function renderString($entity, array $options): string
{ {
$category = ''; $category = '';

View File

@ -16,6 +16,9 @@ use Chill\MainBundle\Templating\Entity\ChillEntityRenderInterface;
use Chill\MainBundle\Templating\TranslatableStringHelper; use Chill\MainBundle\Templating\TranslatableStringHelper;
use Symfony\Component\Templating\EngineInterface; use Symfony\Component\Templating\EngineInterface;
/**
* @implements ChillEntityRenderInterface<AsideActivityCategory>
*/
final class CategoryRender implements ChillEntityRenderInterface final class CategoryRender implements ChillEntityRenderInterface
{ {
public const DEFAULT_ARGS = [ public const DEFAULT_ARGS = [
@ -45,9 +48,6 @@ final class CategoryRender implements ChillEntityRenderInterface
return $parents; return $parents;
} }
/**
* @param AsideActivityCategory $asideActivityCategory
*/
public function renderBox($asideActivityCategory, array $options): string public function renderBox($asideActivityCategory, array $options): string
{ {
$options = array_merge(self::DEFAULT_ARGS, $options); $options = array_merge(self::DEFAULT_ARGS, $options);
@ -63,9 +63,6 @@ final class CategoryRender implements ChillEntityRenderInterface
); );
} }
/**
* @param AsideActivityCategory $asideActivityCategory
*/
public function renderString($asideActivityCategory, array $options): string public function renderString($asideActivityCategory, array $options): string
{ {
$options = array_merge(self::DEFAULT_ARGS, $options); $options = array_merge(self::DEFAULT_ARGS, $options);
@ -84,9 +81,6 @@ final class CategoryRender implements ChillEntityRenderInterface
return implode($options[self::SEPERATOR_KEY], $titles); return implode($options[self::SEPERATOR_KEY], $titles);
} }
/**
* @param AsideActivityCategory $asideActivityCategory
*/
public function supports($asideActivityCategory, array $options): bool public function supports($asideActivityCategory, array $options): bool
{ {
return $asideActivityCategory instanceof AsideActivityCategory; return $asideActivityCategory instanceof AsideActivityCategory;

View File

@ -17,6 +17,9 @@ use Chill\MainBundle\Templating\Entity\ChillEntityRenderInterface;
use Chill\MainBundle\Templating\TranslatableStringHelperInterface; use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
use Symfony\Component\Templating\EngineInterface; use Symfony\Component\Templating\EngineInterface;
/**
* @implements ChillEntityRenderInterface<ResourceKind|ChargeKind>
*/
final class BudgetElementTypeRender implements ChillEntityRenderInterface final class BudgetElementTypeRender implements ChillEntityRenderInterface
{ {
private EngineInterface $engine; private EngineInterface $engine;

View File

@ -43,36 +43,20 @@ class Country
private ?int $id = null; private ?int $id = null;
/** /**
* @var string * @var array<string, string>
* *
* @ORM\Column(type="json") * @ORM\Column(type="json")
* @groups({"read", "docgen:read"}) * @groups({"read", "docgen:read"})
* @Context({"is-translatable": true}, groups={"docgen:read"}) * @Context({"is-translatable": true}, groups={"docgen:read"})
*/ */
private $name; private array $name = [];
/** public function getCountryCode(): string
* @return string
*/
public function __toString()
{
return $this->getName();
}
/**
* @return the string
*/
public function getCountryCode()
{ {
return $this->countryCode; return $this->countryCode;
} }
/** public function getId(): ?int
* Get id.
*
* @return int
*/
public function getId()
{ {
return $this->id; return $this->id;
} }
@ -81,29 +65,22 @@ class Country
* Get name. * Get name.
* *
*/ */
public function getName() public function getName(): array
{ {
return $this->name; return $this->name;
} }
/** public function setCountryCode(?string $countryCode): self
* @param string $countryCode
*/
public function setCountryCode($countryCode)
{ {
$this->countryCode = $countryCode; $this->countryCode = (string) $countryCode;
return $this; return $this;
} }
/** /**
* Set name. * @param array<string, string> $name
*
* @param string $name
*
* @return Country
*/ */
public function setName($name) public function setName(array $name): self
{ {
$this->name = $name; $this->name = $name;

View File

@ -51,10 +51,7 @@ class CommentEmbeddable
return $this->date; return $this->date;
} }
/** public function getUserId(): ?int
* @return interger $userId
*/
public function getUserId()
{ {
return $this->userId; return $this->userId;
} }

View File

@ -11,15 +11,10 @@ declare(strict_types=1);
namespace Chill\MainBundle\Templating\Entity; namespace Chill\MainBundle\Templating\Entity;
/**
* @deprecated load @link{BoxUtilsChillEntityRenderTrait} in the render
*/
abstract class AbstractChillEntityRender implements ChillEntityRenderInterface abstract class AbstractChillEntityRender implements ChillEntityRenderInterface
{ {
protected function getDefaultClosingBox(): string use BoxUtilsChillEntityRenderTrait;
{
return '</section>';
}
protected function getDefaultOpeningBox($classSuffix): string
{
return '<section class="chill-entity entity-' . $classSuffix . '">';
}
} }

View File

@ -18,6 +18,9 @@ use Symfony\Component\Templating\EngineInterface;
use function array_merge; use function array_merge;
use function strtr; use function strtr;
/**
* @implements ChillEntityRenderInterface<Address>
*/
class AddressRender implements ChillEntityRenderInterface class AddressRender implements ChillEntityRenderInterface
{ {
public const DEFAULT_OPTIONS = [ public const DEFAULT_OPTIONS = [
@ -41,10 +44,6 @@ class AddressRender implements ChillEntityRenderInterface
$this->translatableStringHelper = $translatableStringHelper; $this->translatableStringHelper = $translatableStringHelper;
} }
/**
* @param Address addr
* @param mixed $addr
*/
public function renderBox($addr, array $options): string public function renderBox($addr, array $options): string
{ {
$options = array_merge(self::DEFAULT_OPTIONS, $options); $options = array_merge(self::DEFAULT_OPTIONS, $options);
@ -59,18 +58,12 @@ class AddressRender implements ChillEntityRenderInterface
]); ]);
} }
/**
* @param Address addr
* @param mixed $addr
*
* @return string[]
*/
public function renderLines(Address $addr, bool $includeCityLine = true, bool $includeCountry = true): array public function renderLines(Address $addr, bool $includeCityLine = true, bool $includeCountry = true): array
{ {
$lines = []; $lines = [];
if (null !== $addr->getPostCode()) { if (null !== $addr->getPostcode()) {
if ($addr->getPostCode()->getCountry()->getCountryCode() === 'FR') { if ($addr->getPostcode()->getCountry()->getCountryCode() === 'FR') {
$lines[] = $this->renderIntraBuildingLine($addr); $lines[] = $this->renderIntraBuildingLine($addr);
$lines[] = $this->renderBuildingLine($addr); $lines[] = $this->renderBuildingLine($addr);
$lines[] = $this->renderStreetLine($addr); $lines[] = $this->renderStreetLine($addr);
@ -117,10 +110,8 @@ class AddressRender implements ChillEntityRenderInterface
$res = trim($street . ', ' . $streetNumber, ', '); $res = trim($street . ', ' . $streetNumber, ', ');
if (null !== $addr->getPostCode()->getCountry()->getCountryCode()) { if ($addr->getPostcode()->getCountry()->getCountryCode() === 'FR') {
if ($addr->getPostCode()->getCountry()->getCountryCode() === 'FR') { $res = trim($streetNumber . ', ' . $street, ', ');
$res = trim($streetNumber . ', ' . $street, ', ');
}
} }
if ((',' === $res) || ('' === $res)) { if ((',' === $res) || ('' === $res)) {
@ -130,10 +121,6 @@ class AddressRender implements ChillEntityRenderInterface
return $res; return $res;
} }
/**
* @param Address addr
* @param mixed $addr
*/
public function renderString($addr, array $options): string public function renderString($addr, array $options): string
{ {
return implode(' — ', $this->renderLines($addr)); return implode(' — ', $this->renderLines($addr));
@ -163,10 +150,8 @@ class AddressRender implements ChillEntityRenderInterface
$res = null; $res = null;
} }
if (null !== $addr->getPostCode()->getCountry()->getCountryCode()) { if ($addr->getPostcode()->getCountry()->getCountryCode() === 'FR') {
if ($addr->getPostCode()->getCountry()->getCountryCode() === 'FR') { $res = $addr->getBuildingName();
$res = $addr->getBuildingName();
}
} }
return $res; return $res;

View File

@ -0,0 +1,25 @@
<?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\MainBundle\Templating\Entity;
trait BoxUtilsChillEntityRenderTrait
{
protected function getDefaultClosingBox(): string
{
return '</section>';
}
protected function getDefaultOpeningBox($classSuffix): string
{
return '<section class="chill-entity entity-' . $classSuffix . '">';
}
}

View File

@ -14,8 +14,10 @@ namespace Chill\MainBundle\Templating\Entity;
/** /**
* Render an entity using `__toString()`. * Render an entity using `__toString()`.
*/ */
class ChillEntityRender extends AbstractChillEntityRender class ChillEntityRender implements ChillEntityRenderInterface
{ {
use BoxUtilsChillEntityRenderTrait;
public function renderBox($entity, array $options): string public function renderBox($entity, array $options): string
{ {
return $this->getDefaultOpeningBox('default') . $entity return $this->getDefaultOpeningBox('default') . $entity

View File

@ -14,6 +14,8 @@ namespace Chill\MainBundle\Templating\Entity;
/** /**
* Interface to implement which will render an entity in template on a custom * Interface to implement which will render an entity in template on a custom
* manner. * manner.
*
* @template T
*/ */
interface ChillEntityRenderInterface interface ChillEntityRenderInterface
{ {
@ -29,7 +31,7 @@ interface ChillEntityRenderInterface
* </span> * </span>
* ``` * ```
* *
* @param type $entity * @param T $entity
*/ */
public function renderBox($entity, array $options): string; public function renderBox($entity, array $options): string;
@ -38,14 +40,12 @@ interface ChillEntityRenderInterface
* *
* Example: returning the name of a person. * Example: returning the name of a person.
* *
* @param object $entity * @param T $entity
*/ */
public function renderString($entity, array $options): string; public function renderString($entity, array $options): string;
/** /**
* Return true if the class support this object for the given options. * Return true if the class support this object for the given options.
*
* @param object $entity
*/ */
public function supports($entity, array $options): bool; public function supports(object $entity, array $options): bool;
} }

View File

@ -13,33 +13,32 @@ namespace Chill\MainBundle\Templating\Entity;
use Chill\MainBundle\Entity\Embeddable\CommentEmbeddable; use Chill\MainBundle\Entity\Embeddable\CommentEmbeddable;
use Chill\MainBundle\Repository\UserRepository; use Chill\MainBundle\Repository\UserRepository;
use Chill\MainBundle\Repository\UserRepositoryInterface;
use Symfony\Component\Templating\EngineInterface; use Symfony\Component\Templating\EngineInterface;
use function array_merge; use function array_merge;
class CommentRender extends AbstractChillEntityRender /**
* @implements ChillEntityRenderInterface<CommentEmbeddable>
*/
class CommentRender implements ChillEntityRenderInterface
{ {
use BoxUtilsChillEntityRenderTrait;
/** /**
* @var EngineInterface * @var EngineInterface
*/ */
private $engine; private $engine;
/** private UserRepositoryInterface $userRepository;
* @var \Chill\MainBundle\Repository\UserRepository
*/
private $userRepository;
public function __construct( public function __construct(
UserRepository $userRepository, UserRepositoryInterface $userRepository,
EngineInterface $engine EngineInterface $engine
) { ) {
$this->userRepository = $userRepository; $this->userRepository = $userRepository;
$this->engine = $engine; $this->engine = $engine;
} }
/**
* @param CommentEmbeddable $entity
*/
public function renderBox($entity, array $options): string public function renderBox($entity, array $options): string
{ {
// default options // default options
@ -50,7 +49,7 @@ class CommentRender extends AbstractChillEntityRender
'metadata' => true, 'metadata' => true,
], $options); ], $options);
if ($entity->getUserId()) { if (null !== $entity->getUserId()) {
$user = $this->userRepository->find($entity->getUserId()); $user = $this->userRepository->find($entity->getUserId());
} }
@ -67,9 +66,6 @@ class CommentRender extends AbstractChillEntityRender
); );
} }
/**
* @param CommentEmbeddable $entity
*/
public function renderString($entity, array $options): string public function renderString($entity, array $options): string
{ {
return $entity->getComment(); return $entity->getComment();

View File

@ -19,6 +19,9 @@ use Symfony\Component\Templating\EngineInterface;
use Symfony\Contracts\Translation\TranslatorInterface; use Symfony\Contracts\Translation\TranslatorInterface;
use function array_merge; use function array_merge;
/**
* @implements ChillEntityRenderInterface<User>
*/
class UserRender implements ChillEntityRenderInterface class UserRender implements ChillEntityRenderInterface
{ {
public const DEFAULT_OPTIONS = [ public const DEFAULT_OPTIONS = [
@ -50,9 +53,6 @@ class UserRender implements ChillEntityRenderInterface
]); ]);
} }
/**
* @param User $entity
*/
public function renderString($entity, array $options): string public function renderString($entity, array $options): string
{ {
$opts = array_merge(self::DEFAULT_OPTIONS, $options); $opts = array_merge(self::DEFAULT_OPTIONS, $options);

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\Main; namespace Chill\Migrations\Main;
use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\Schema;

View File

@ -12,14 +12,19 @@ declare(strict_types=1);
namespace Chill\PersonBundle\Templating\Entity; namespace Chill\PersonBundle\Templating\Entity;
use Chill\MainBundle\Templating\Entity\AbstractChillEntityRender; use Chill\MainBundle\Templating\Entity\AbstractChillEntityRender;
use Chill\MainBundle\Templating\Entity\BoxUtilsChillEntityRenderTrait;
use Chill\MainBundle\Templating\Entity\ChillEntityRenderInterface;
use Chill\MainBundle\Templating\TranslatableStringHelper; use Chill\MainBundle\Templating\TranslatableStringHelper;
use Chill\PersonBundle\Entity\AccompanyingPeriod\ClosingMotive; use Chill\PersonBundle\Entity\AccompanyingPeriod\ClosingMotive;
/** /**
* Render closing motive. * Render closing motive.
*
* @implements ChillEntityRenderInterface<ClosingMotive>
*/ */
class ClosingMotiveRender extends AbstractChillEntityRender class ClosingMotiveRender implements ChillEntityRenderInterface
{ {
use BoxUtilsChillEntityRenderTrait;
private const SEPARATOR = ' > '; private const SEPARATOR = ' > ';
/** /**
@ -40,9 +45,6 @@ class ClosingMotiveRender extends AbstractChillEntityRender
$this->getDefaultClosingBox(); $this->getDefaultClosingBox();
} }
/**
* @param ClosingMotive $entity
*/
public function renderString($entity, array $options): string public function renderString($entity, array $options): string
{ {
return $this->renderStringRecursive( return $this->renderStringRecursive(
@ -57,12 +59,12 @@ class ClosingMotiveRender extends AbstractChillEntityRender
return $entity instanceof ClosingMotive; return $entity instanceof ClosingMotive;
} }
protected function renderStringRecursive(ClosingMotive $motive, $existing, array $options) private function renderStringRecursive(ClosingMotive $motive, string $existing, array $options)
{ {
$newExisting = $this->translatableStringHelper->localize($motive->getName()); $newExisting = $this->translatableStringHelper->localize($motive->getName());
if ($motive->hasParent()) { if ($motive->hasParent()) {
if (!empty($existing)) { if ('' !== $existing) {
$newExisting = $newExisting . self::SEPARATOR . $existing; $newExisting = $newExisting . self::SEPARATOR . $existing;
} }
@ -73,7 +75,7 @@ class ClosingMotiveRender extends AbstractChillEntityRender
); );
} }
if (!empty($existing)) { if ('' !== $existing) {
return $newExisting . self::SEPARATOR . $existing; return $newExisting . self::SEPARATOR . $existing;
} }

View File

@ -12,6 +12,8 @@ declare(strict_types=1);
namespace Chill\PersonBundle\Templating\Entity; namespace Chill\PersonBundle\Templating\Entity;
use Chill\MainBundle\Templating\Entity\AbstractChillEntityRender; use Chill\MainBundle\Templating\Entity\AbstractChillEntityRender;
use Chill\MainBundle\Templating\Entity\BoxUtilsChillEntityRenderTrait;
use Chill\MainBundle\Templating\Entity\ChillEntityRenderInterface;
use Chill\PersonBundle\Config\ConfigPersonAltNamesHelper; use Chill\PersonBundle\Config\ConfigPersonAltNamesHelper;
use Chill\PersonBundle\Entity\Person; use Chill\PersonBundle\Entity\Person;
use Symfony\Component\Templating\EngineInterface; use Symfony\Component\Templating\EngineInterface;
@ -22,8 +24,9 @@ use function array_key_exists;
/** /**
* Render a Person. * Render a Person.
*/ */
class PersonRender extends AbstractChillEntityRender implements PersonRenderInterface class PersonRender implements PersonRenderInterface
{ {
use BoxUtilsChillEntityRenderTrait;
private ConfigPersonAltNamesHelper $configAltNamesHelper; private ConfigPersonAltNamesHelper $configAltNamesHelper;
private EngineInterface $engine; private EngineInterface $engine;
@ -40,9 +43,6 @@ class PersonRender extends AbstractChillEntityRender implements PersonRenderInte
$this->translator = $translator; $this->translator = $translator;
} }
/**
* @param Person $person
*/
public function renderBox($person, array $options): string public function renderBox($person, array $options): string
{ {
$params = [ $params = [
@ -72,9 +72,6 @@ class PersonRender extends AbstractChillEntityRender implements PersonRenderInte
$this->getDefaultClosingBox(); $this->getDefaultClosingBox();
} }
/**
* @param Person $person
*/
public function renderString($person, array $options): string public function renderString($person, array $options): string
{ {
$options = array_merge(['addAge' => true], $options); $options = array_merge(['addAge' => true], $options);

View File

@ -12,9 +12,12 @@ declare(strict_types=1);
namespace Chill\PersonBundle\Templating\Entity; namespace Chill\PersonBundle\Templating\Entity;
use Chill\MainBundle\Templating\Entity\ChillEntityRenderInterface; use Chill\MainBundle\Templating\Entity\ChillEntityRenderInterface;
use Chill\PersonBundle\Entity\Person;
/** /**
* Render a Person. * Render a Person.
*
* @extends ChillEntityRenderInterface<Person>
*/ */
interface PersonRenderInterface extends ChillEntityRenderInterface interface PersonRenderInterface extends ChillEntityRenderInterface
{ {

View File

@ -15,6 +15,9 @@ use Chill\MainBundle\Templating\Entity\ChillEntityRenderInterface;
use Chill\MainBundle\Templating\TranslatableStringHelper; use Chill\MainBundle\Templating\TranslatableStringHelper;
use Chill\PersonBundle\Entity\Person\PersonResourceKind; use Chill\PersonBundle\Entity\Person\PersonResourceKind;
/**
* @implements ChillEntityRenderInterface<PersonResourceKind>
*/
final class ResourceKindRender implements ChillEntityRenderInterface final class ResourceKindRender implements ChillEntityRenderInterface
{ {
private TranslatableStringHelper $translatableStringHelper; private TranslatableStringHelper $translatableStringHelper;

View File

@ -20,6 +20,9 @@ use function array_merge;
use function array_reverse; use function array_reverse;
use function implode; use function implode;
/**
* @implements ChillEntityRenderInterface<SocialAction>
*/
class SocialActionRender implements ChillEntityRenderInterface class SocialActionRender implements ChillEntityRenderInterface
{ {
public const AND_CHILDREN_MENTION = 'show_and_children_mention'; public const AND_CHILDREN_MENTION = 'show_and_children_mention';

View File

@ -19,6 +19,9 @@ use Symfony\Contracts\Translation\TranslatorInterface;
use function array_reverse; use function array_reverse;
use function implode; use function implode;
/**
* @implements ChillEntityRenderInterface<SocialIssue>
*/
final class SocialIssueRender implements ChillEntityRenderInterface final class SocialIssueRender implements ChillEntityRenderInterface
{ {
public const AND_CHILDREN_MENTION = 'show_and_children_mention'; public const AND_CHILDREN_MENTION = 'show_and_children_mention';
@ -53,9 +56,6 @@ final class SocialIssueRender implements ChillEntityRenderInterface
$this->translator = $translator; $this->translator = $translator;
} }
/**
* @param SocialIssue $socialIssue
*/
public function renderBox($socialIssue, array $options): string public function renderBox($socialIssue, array $options): string
{ {
$options = array_merge(self::DEFAULT_ARGS, $options); $options = array_merge(self::DEFAULT_ARGS, $options);
@ -74,9 +74,6 @@ final class SocialIssueRender implements ChillEntityRenderInterface
); );
} }
/**
* @param SocialIssue $socialIssue
*/
public function renderString($socialIssue, array $options): string public function renderString($socialIssue, array $options): string
{ {
/** @var SocialIssue $socialIssue */ /** @var SocialIssue $socialIssue */

View File

@ -12,12 +12,18 @@ declare(strict_types=1);
namespace Chill\ThirdPartyBundle\Templating\Entity; namespace Chill\ThirdPartyBundle\Templating\Entity;
use Chill\MainBundle\Templating\Entity\AbstractChillEntityRender; use Chill\MainBundle\Templating\Entity\AbstractChillEntityRender;
use Chill\MainBundle\Templating\Entity\BoxUtilsChillEntityRenderTrait;
use Chill\MainBundle\Templating\Entity\ChillEntityRenderInterface;
use Chill\MainBundle\Templating\TranslatableStringHelper; use Chill\MainBundle\Templating\TranslatableStringHelper;
use Chill\ThirdPartyBundle\Entity\ThirdParty; use Chill\ThirdPartyBundle\Entity\ThirdParty;
use Symfony\Component\Templating\EngineInterface; use Symfony\Component\Templating\EngineInterface;
class ThirdPartyRender extends AbstractChillEntityRender /**
* @implements ChillEntityRenderInterface<ThirdParty>
*/
class ThirdPartyRender implements ChillEntityRenderInterface
{ {
use BoxUtilsChillEntityRenderTrait;
protected EngineInterface $engine; protected EngineInterface $engine;
protected TranslatableStringHelper $translatableStringHelper; protected TranslatableStringHelper $translatableStringHelper;
@ -30,9 +36,6 @@ class ThirdPartyRender extends AbstractChillEntityRender
$this->translatableStringHelper = $translatableStringHelper; $this->translatableStringHelper = $translatableStringHelper;
} }
/**
* @param ThirdParty $entity
*/
public function renderBox($entity, array $options): string public function renderBox($entity, array $options): string
{ {
$params = [ $params = [
@ -59,9 +62,6 @@ class ThirdPartyRender extends AbstractChillEntityRender
$this->getDefaultClosingBox(); $this->getDefaultClosingBox();
} }
/**
* @param ThirdParty $entity
*/
public function renderString($entity, array $options): string public function renderString($entity, array $options): string
{ {
if ($entity->getCivility() !== null) { if ($entity->getCivility() !== null) {