diff --git a/.changes/unreleased/Feature-20231212-154841.yaml b/.changes/unreleased/Feature-20231212-154841.yaml deleted file mode 100644 index 14e19345b..000000000 --- a/.changes/unreleased/Feature-20231212-154841.yaml +++ /dev/null @@ -1,5 +0,0 @@ -kind: Feature -body: '[DX] move async-upload-bundle features into chill-bundles' -time: 2023-12-12T15:48:41.954970271+01:00 -custom: - Issue: "221" diff --git a/.changes/unreleased/Feature-20240530-160003.yaml b/.changes/unreleased/Feature-20240530-160003.yaml deleted file mode 100644 index 6b6baedc5..000000000 --- a/.changes/unreleased/Feature-20240530-160003.yaml +++ /dev/null @@ -1,6 +0,0 @@ -kind: Feature -body: | - Upgrade import of address list to the last version of compiled addresses of belgian-best-address -time: 2024-05-30T16:00:03.440767606+02:00 -custom: - Issue: "" diff --git a/.changes/unreleased/Feature-20240531-190242.yaml b/.changes/unreleased/Feature-20240531-190242.yaml deleted file mode 100644 index 083298a26..000000000 --- a/.changes/unreleased/Feature-20240531-190242.yaml +++ /dev/null @@ -1,6 +0,0 @@ -kind: Feature -body: | - Upgrade CKEditor and refactor configuration with use of typescript -time: 2024-05-31T19:02:42.776662753+02:00 -custom: - Issue: "" diff --git a/.changes/unreleased/Fixed-20240410-103736.yaml b/.changes/unreleased/Fixed-20240410-103736.yaml deleted file mode 100644 index 355d24b1e..000000000 --- a/.changes/unreleased/Fixed-20240410-103736.yaml +++ /dev/null @@ -1,6 +0,0 @@ -kind: Fixed -body: Fix resolving of centers for an household, which will fix in turn the access - control -time: 2024-04-10T10:37:36.462484988+02:00 -custom: - Issue: "" diff --git a/.changes/v2.22.0.md b/.changes/v2.22.0.md new file mode 100644 index 000000000..fef006fd0 --- /dev/null +++ b/.changes/v2.22.0.md @@ -0,0 +1,6 @@ +## v2.22.0 - 2024-06-25 +### Feature +* ([#216](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/216)) [event bundle] exports added for the event module + +### Traduction francophone +* Exports sont ajoutés pour la module événement. diff --git a/.changes/v2.22.1.md b/.changes/v2.22.1.md new file mode 100644 index 000000000..b856cc95b --- /dev/null +++ b/.changes/v2.22.1.md @@ -0,0 +1,5 @@ +## v2.22.1 - 2024-07-01 +### Fixed +* Remove debug word +### DX +* Add a command for reading official address DB from Luxembourg and update chill addresses diff --git a/.changes/v2.22.2.md b/.changes/v2.22.2.md new file mode 100644 index 000000000..51b3c75da --- /dev/null +++ b/.changes/v2.22.2.md @@ -0,0 +1,3 @@ +## v2.22.2 - 2024-07-03 +### Fixed +* Remove scope required for event participation stats diff --git a/.changes/v2.23.0.md b/.changes/v2.23.0.md new file mode 100644 index 000000000..6b2aea37a --- /dev/null +++ b/.changes/v2.23.0.md @@ -0,0 +1,11 @@ +## v2.23.0 - 2024-07-23 +### Feature +* ([#221](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/221)) [DX] move async-upload-bundle features into chill-bundles +* Add job bundle (module emploi) +* Upgrade import of address list to the last version of compiled addresses of belgian-best-address + +* Upgrade CKEditor and refactor configuration with use of typescript + +### Fixed +* Fix resolving of centers for an household, which will fix in turn the access control +* Resolved type hinting error in activity list export diff --git a/.changes/v3.0.0.md b/.changes/v3.0.0.md new file mode 100644 index 000000000..586e648da --- /dev/null +++ b/.changes/v3.0.0.md @@ -0,0 +1,5 @@ +## v3.0.0 - 2024-08-26 +### Fixed +* Fix delete action for accompanying periods in draft state +* Fix connection to azure when making an calendar event in chill +* CollectionType js fixes for remove button and adding multiple entries diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e355d95de..bb5c8dd5d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -138,4 +138,4 @@ release: - echo "running release_job" release: tag_name: '$CI_COMMIT_TAG' - description: "./.changes/v$CI_COMMIT_TAG.md" + description: "./.changes/$CI_COMMIT_TAG.md" diff --git a/CHANGELOG.md b/CHANGELOG.md index dc8f2305a..3aa0c490d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,41 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html), and is generated by [Changie](https://github.com/miniscruff/changie). +## v3.0.0 - 2024-08-26 +### Fixed +* Fix delete action for accompanying periods in draft state +* Fix connection to azure when making an calendar event in chill +* CollectionType js fixes for remove button and adding multiple entries + +## v2.23.0 - 2024-07-23 +### Feature +* ([#221](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/221)) [DX] move async-upload-bundle features into chill-bundles +* Add job bundle (module emploi) +* Upgrade import of address list to the last version of compiled addresses of belgian-best-address + +* Upgrade CKEditor and refactor configuration with use of typescript + +### Fixed +* Fix resolving of centers for an household, which will fix in turn the access control +* Resolved type hinting error in activity list export + +## v2.22.2 - 2024-07-03 +### Fixed +* Remove scope required for event participation stats + +## v2.22.1 - 2024-07-01 +### Fixed +* Remove debug word +### DX +* Add a command for reading official address DB from Luxembourg and update chill addresses + +## v2.22.0 - 2024-06-25 +### Feature +* ([#216](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/216)) [event bundle] exports added for the event module + +### Traduction francophone +* Exports sont ajoutés pour la module événement. + ## v2.21.0 - 2024-06-18 ### Feature * Add flash menu buttons in search results, to open directly a new calendar, or a new activity in an accompanying period diff --git a/composer.json b/composer.json index 984e0db60..c65217c13 100644 --- a/composer.json +++ b/composer.json @@ -115,6 +115,8 @@ "Chill\\DocGeneratorBundle\\": "src/Bundle/ChillDocGeneratorBundle", "Chill\\DocStoreBundle\\": "src/Bundle/ChillDocStoreBundle", "Chill\\EventBundle\\": "src/Bundle/ChillEventBundle", + "Chill\\FranceTravailApiBundle\\": "src/Bundle/ChillFranceTravailApiBundle/src", + "Chill\\JobBundle\\": "src/Bundle/ChillJobBundle/src", "Chill\\MainBundle\\": "src/Bundle/ChillMainBundle", "Chill\\PersonBundle\\": "src/Bundle/ChillPersonBundle", "Chill\\ReportBundle\\": "src/Bundle/ChillReportBundle", diff --git a/docs/source/_static/code/exports/BirthdateFilter.php b/docs/source/_static/code/exports/BirthdateFilter.php index e25d8b42f..fca768ab3 100644 --- a/docs/source/_static/code/exports/BirthdateFilter.php +++ b/docs/source/_static/code/exports/BirthdateFilter.php @@ -21,7 +21,7 @@ use Symfony\Component\Validator\Context\ExecutionContextInterface; class BirthdateFilter implements ExportElementValidatedInterface, FilterInterface { // add specific role for this filter - public function addRole() + public function addRole(): ?string { // we do not need any new role for this filter, so we return null return null; diff --git a/docs/source/installation/index.rst b/docs/source/installation/index.rst index 072a32ffb..a9a4ea0c6 100644 --- a/docs/source/installation/index.rst +++ b/docs/source/installation/index.rst @@ -56,7 +56,7 @@ We strongly encourage you to initialize a git repository at this step, to track cat <<< "$(jq '.extra.symfony += {"endpoint": ["flex://defaults", "https://gitlab.com/api/v4/projects/57371968/repository/files/index.json/raw?ref=main"]}' composer.json)" > composer.json # install chill and some dependencies # TODO fix the suffix "alpha1" and replace by ^3.0.0 when version 3.0.0 will be released - symfony composer require chill-project/chill-bundles v3.0.0-alpha1 champs-libres/wopi-lib dev-master@dev champs-libres/wopi-bundle dev-master@dev + symfony composer require chill-project/chill-bundles v3.0.0-RC3 champs-libres/wopi-lib dev-master@dev champs-libres/wopi-bundle dev-master@dev We encourage you to accept the inclusion of the "Docker configuration from recipes": this is the documented way to run the database. You must also accept to configure recipes from the contrib repository, unless you want to configure the bundles manually). @@ -110,15 +110,14 @@ you can either: .. code-block:: env ADMIN_PASSWORD=\$2y\$13\$iyvJLuT4YEa6iWXyQV4/N.hNHpNG8kXlYDkkt5MkYy4FXcSwYAwmm + # note: if you copy-paste the line above, the password will be "admin". - add the generated password to the secrets manager (**note**: you must add the generated hashed password to the secrets env, not the password in clear text). - set up the jwt authentication bundle -Some environment variables are available for the JWT authentication bundle in the :code:`.env` file. You must also run the command -:code:`symfony console lexik:jwt:generate-keypair` to generate some keys that will be stored in the paths set up in the :code:`JWT_SECRET_KEY` -and the :code:`JWT_PUBLIC_KEY` env variables. This is only required for using the stored documents in Chill. +Some environment variables are available for the JWT authentication bundle in the :code:`.env` file. Prepare migrations and other tools ********************************** @@ -136,6 +135,8 @@ To continue the installation process, you will have to run migrations: symfony console messenger:setup-transports # prepare some views symfony console chill:db:sync-views + # generate jwt token, required for some api features (webdav access, ...) + symfony console lexik:jwt:generate-keypair .. warning:: diff --git a/package.json b/package.json index 09438fe84..e0417cd4f 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "popper.js": "^1.16.1", "postcss-loader": "^7.0.2", "raw-loader": "^4.0.2", - "sass-loader": "^13.0.0", + "sass-loader": "^14.0.0", "select2": "^4.0.13", "select2-bootstrap-theme": "0.1.0-beta.10", "style-loader": "^3.3.1", diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 8af07174d..641bb5dcd 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -1,34 +1,29 @@ parameters: ignoreErrors: + - + message: "#^Foreach overwrites \\$key with its key variable\\.$#" + count: 1 + path: src/Bundle/ChillCustomFieldsBundle/Controller/CustomFieldsGroupController.php + - message: "#^Only booleans are allowed in an if condition, mixed given\\.$#" count: 1 path: src/Bundle/ChillCustomFieldsBundle/Entity/CustomField.php - - message: "#^Only booleans are allowed in an if condition, mixed given\\.$#" + message: "#^Property Chill\\\\CustomFieldsBundle\\\\Entity\\\\CustomField\\:\\:\\$required \\(false\\) does not accept bool\\.$#" count: 1 - path: src/Bundle/ChillPersonBundle/Form/PersonType.php + path: src/Bundle/ChillCustomFieldsBundle/Entity/CustomField.php - - message: "#^Only booleans are allowed in an if condition, mixed given\\.$#" - count: 1 - path: src/Bundle/ChillMainBundle/Templating/ChillTwigRoutingHelper.php - - - - message: "#^Only booleans are allowed in an if condition, mixed given\\.$#" - count: 1 - path: src/Bundle/ChillCustomFieldsBundle/Entity/CustomFieldsGroup.php - - - - message: "#^Only booleans are allowed in an if condition, mixed given\\.$#" + message: "#^Parameter \\#1 \\$user of method Chill\\\\DocStoreBundle\\\\Entity\\\\Document\\:\\:setUser\\(\\) expects Chill\\\\MainBundle\\\\Entity\\\\User\\|null, Symfony\\\\Component\\\\Security\\\\Core\\\\User\\\\UserInterface\\|null given\\.$#" count: 2 - path: src/Bundle/ChillMainBundle/Repository/NotificationRepository.php + path: src/Bundle/ChillDocStoreBundle/Controller/DocumentAccompanyingCourseController.php - - message: "#^Foreach overwrites \\$key with its key variable\\.$#" - count: 1 - path: src/Bundle/ChillCustomFieldsBundle/Controller/CustomFieldsGroupController.php + message: "#^Parameter \\#1 \\$user of method Chill\\\\DocStoreBundle\\\\Entity\\\\Document\\:\\:setUser\\(\\) expects Chill\\\\MainBundle\\\\Entity\\\\User\\|null, Symfony\\\\Component\\\\Security\\\\Core\\\\User\\\\UserInterface\\|null given\\.$#" + count: 2 + path: src/Bundle/ChillDocStoreBundle/Controller/DocumentPersonController.php - message: "#^Variable \\$participation might not be defined\\.$#" @@ -40,6 +35,106 @@ parameters: count: 1 path: src/Bundle/ChillEventBundle/Form/ChoiceLoader/EventChoiceLoader.php + - + message: "#^Comparison operation \"\\>\" between \\(bool\\|int\\|Redis\\) and 0 results in an error\\.$#" + count: 1 + path: src/Bundle/ChillFranceTravailApiBundle/src/ApiHelper/ApiWrapper.php + + - + message: "#^Variable \\$response might not be defined\\.$#" + count: 1 + path: src/Bundle/ChillFranceTravailApiBundle/src/ApiHelper/ApiWrapper.php + + - + message: "#^Function GuzzleHttp\\\\Psr7\\\\get not found\\.$#" + count: 1 + path: src/Bundle/ChillFranceTravailApiBundle/src/ApiHelper/PartenaireRomeAppellation.php + + - + message: "#^Function GuzzleHttp\\\\Psr7\\\\str not found\\.$#" + count: 2 + path: src/Bundle/ChillFranceTravailApiBundle/src/ApiHelper/PartenaireRomeAppellation.php + + - + message: "#^Parameter \\#1 \\$seconds of function sleep expects int, string given\\.$#" + count: 1 + path: src/Bundle/ChillFranceTravailApiBundle/src/ApiHelper/PartenaireRomeAppellation.php + + - + message: "#^Unreachable statement \\- code above always terminates\\.$#" + count: 1 + path: src/Bundle/ChillJobBundle/src/Controller/CSPersonController.php + + - + message: "#^Parameter \\#1 \\$interval of method DateTimeImmutable\\:\\:add\\(\\) expects DateInterval, string\\|null given\\.$#" + count: 1 + path: src/Bundle/ChillJobBundle/src/Entity/Immersion.php + + - + message: "#^Parameter \\#1 \\$object of static method DateTimeImmutable\\:\\:createFromMutable\\(\\) expects DateTime, DateTimeInterface given\\.$#" + count: 1 + path: src/Bundle/ChillJobBundle/src/Entity/Immersion.php + + - + message: "#^Property Chill\\\\JobBundle\\\\Entity\\\\Rome\\\\Metier\\:\\:\\$appellations is never read, only written\\.$#" + count: 1 + path: src/Bundle/ChillJobBundle/src/Entity/Rome/Metier.php + + - + message: "#^Method Chill\\\\JobBundle\\\\Export\\\\ListCSPerson\\:\\:splitArrayToColumns\\(\\) never returns Closure so it can be removed from the return type\\.$#" + count: 1 + path: src/Bundle/ChillJobBundle/src/Export/ListCSPerson.php + + - + message: "#^Variable \\$f might not be defined\\.$#" + count: 1 + path: src/Bundle/ChillJobBundle/src/Export/ListCSPerson.php + + - + message: "#^Method Chill\\\\JobBundle\\\\Export\\\\ListFrein\\:\\:splitArrayToColumns\\(\\) never returns Closure so it can be removed from the return type\\.$#" + count: 1 + path: src/Bundle/ChillJobBundle/src/Export/ListFrein.php + + - + message: "#^Method Chill\\\\JobBundle\\\\Export\\\\ListProjetProfessionnel\\:\\:splitArrayToColumns\\(\\) never returns Closure so it can be removed from the return type\\.$#" + count: 1 + path: src/Bundle/ChillJobBundle/src/Export/ListProjetProfessionnel.php + + - + message: "#^Property Chill\\\\JobBundle\\\\Form\\\\ChoiceLoader\\\\RomeAppellationChoiceLoader\\:\\:\\$appellationRepository \\(Chill\\\\JobBundle\\\\Repository\\\\Rome\\\\AppellationRepository\\) does not accept Doctrine\\\\ORM\\\\EntityRepository\\\\.$#" + count: 1 + path: src/Bundle/ChillJobBundle/src/Form/ChoiceLoader/RomeAppellationChoiceLoader.php + + - + message: "#^Result of && is always false\\.$#" + count: 1 + path: src/Bundle/ChillJobBundle/src/Form/ChoiceLoader/RomeAppellationChoiceLoader.php + + - + message: "#^Strict comparison using \\=\\=\\= between array\\{\\} and Symfony\\\\Component\\\\Validator\\\\ConstraintViolationListInterface will always evaluate to false\\.$#" + count: 2 + path: src/Bundle/ChillJobBundle/src/Form/ChoiceLoader/RomeAppellationChoiceLoader.php + + - + message: "#^Strict comparison using \\=\\=\\= between null and string will always evaluate to false\\.$#" + count: 1 + path: src/Bundle/ChillJobBundle/src/Form/ChoiceLoader/RomeAppellationChoiceLoader.php + + - + message: "#^Variable \\$metier might not be defined\\.$#" + count: 1 + path: src/Bundle/ChillJobBundle/src/Form/ChoiceLoader/RomeAppellationChoiceLoader.php + + - + message: "#^Parameter \\#1 \\$interval of method DateTimeImmutable\\:\\:add\\(\\) expects DateInterval, string\\|null given\\.$#" + count: 1 + path: src/Bundle/ChillJobBundle/src/Security/Authorization/CSConnectesVoter.php + + - + message: "#^Parameter \\#1 \\$object of static method DateTimeImmutable\\:\\:createFromMutable\\(\\) expects DateTime, DateTimeInterface given\\.$#" + count: 1 + path: src/Bundle/ChillJobBundle/src/Security/Authorization/CSConnectesVoter.php + - message: "#^Cannot unset offset '_token' on array\\{formatter\\: mixed, export\\: mixed, centers\\: mixed, alias\\: string\\}\\.$#" count: 1 @@ -65,11 +160,31 @@ parameters: count: 1 path: src/Bundle/ChillMainBundle/Form/ChoiceLoader/PostalCodeChoiceLoader.php + - + message: "#^Only booleans are allowed in an if condition, mixed given\\.$#" + count: 2 + path: src/Bundle/ChillMainBundle/Repository/NotificationRepository.php + + - + message: "#^Parameter \\#1 \\$user of method Chill\\\\MainBundle\\\\Security\\\\Authorization\\\\AuthorizationHelper\\:\\:userHasAccessForCenter\\(\\) expects Chill\\\\MainBundle\\\\Entity\\\\User, Symfony\\\\Component\\\\Security\\\\Core\\\\User\\\\UserInterface given\\.$#" + count: 1 + path: src/Bundle/ChillMainBundle/Security/Authorization/AuthorizationHelper.php + + - + message: "#^Only booleans are allowed in an if condition, mixed given\\.$#" + count: 1 + path: src/Bundle/ChillMainBundle/Templating/ChillTwigRoutingHelper.php + - message: "#^Foreach overwrites \\$value with its value variable\\.$#" count: 1 path: src/Bundle/ChillPersonBundle/Form/ChoiceLoader/PersonChoiceLoader.php + - + message: "#^Only booleans are allowed in an if condition, mixed given\\.$#" + count: 1 + path: src/Bundle/ChillPersonBundle/Form/PersonType.php + - message: "#^Foreach overwrites \\$value with its value variable\\.$#" count: 1 diff --git a/rector.php b/rector.php index 7604667ea..126c814e9 100644 --- a/rector.php +++ b/rector.php @@ -28,6 +28,9 @@ return static function (RectorConfig $rectorConfig): void { // register a single rule $rectorConfig->rule(InlineConstructorDefaultToPropertyRector::class); + $rectorConfig->rule(Rector\TypeDeclaration\Rector\ClassMethod\AddParamTypeFromPropertyTypeRector::class); + $rectorConfig->rule(Rector\TypeDeclaration\Rector\Class_\MergeDateTimePropertyTypeDeclarationRector::class); + $rectorConfig->rule(Rector\TypeDeclaration\Rector\ClassMethod\AddReturnTypeDeclarationBasedOnParentClassMethodRector::class); // part of the symfony 54 rules $rectorConfig->rule(\Rector\Symfony\Symfony53\Rector\StaticPropertyFetch\KernelTestCaseContainerPropertyDeprecationRector::class); @@ -36,14 +39,14 @@ return static function (RectorConfig $rectorConfig): void { //define sets of rules $rectorConfig->sets([ - \Rector\Symfony\Set\SymfonySetList::SYMFONY_50, - \Rector\Symfony\Set\SymfonySetList::SYMFONY_50_TYPES, - \Rector\Symfony\Set\SymfonySetList::SYMFONY_51, - \Rector\Symfony\Set\SymfonySetList::SYMFONY_52, - \Rector\Symfony\Set\SymfonySetList::SYMFONY_53, - \Rector\Symfony\Set\SymfonySetList::SYMFONY_54, + LevelSetList::UP_TO_PHP_82, + \Rector\Symfony\Set\SymfonySetList::SYMFONY_40, + \Rector\Symfony\Set\SymfonySetList::SYMFONY_41, + \Rector\Symfony\Set\SymfonySetList::SYMFONY_42, + \Rector\Symfony\Set\SymfonySetList::SYMFONY_43, + \Rector\Symfony\Set\SymfonySetList::SYMFONY_44, \Rector\Doctrine\Set\DoctrineSetList::DOCTRINE_CODE_QUALITY, - \Rector\Doctrine\Set\DoctrineSetList::ANNOTATIONS_TO_ATTRIBUTES, + \Rector\PHPUnit\Set\PHPUnitSetList::PHPUNIT_90, ]); $rectorConfig->ruleWithConfiguration(\Rector\Php80\Rector\Class_\AnnotationToAttributeRector::class, [ @@ -66,9 +69,8 @@ return static function (RectorConfig $rectorConfig): void { // skip some path... $rectorConfig->skip([ - // we must adapt service definition - \Rector\Symfony\Symfony28\Rector\MethodCall\GetToConstructorInjectionRector::class, - \Rector\Symfony\Symfony34\Rector\Closure\ContainerGetNameToTypeInTestsRector::class, + // waiting for fixing this bug: https://github.com/rectorphp/rector-doctrine/issues/342 + \Rector\Doctrine\CodeQuality\Rector\Property\ImproveDoctrineCollectionDocTypeInEntityRector::class, ]); $rectorConfig->ruleWithConfiguration(AnnotationToAttributeRector::class, [ diff --git a/src/Bundle/ChillActivityBundle/Controller/ActivityController.php b/src/Bundle/ChillActivityBundle/Controller/ActivityController.php index 2248c54d3..cbfb93400 100644 --- a/src/Bundle/ChillActivityBundle/Controller/ActivityController.php +++ b/src/Bundle/ChillActivityBundle/Controller/ActivityController.php @@ -99,10 +99,10 @@ final class ActivityController extends AbstractController $form = $this->createDeleteForm($activity->getId(), $person, $accompanyingPeriod); - if (Request::METHOD_DELETE === $request->getMethod()) { + if (Request::METHOD_POST === $request->getMethod()) { $form->handleRequest($request); - if ($form->isValid()) { + if ($form->isSubmitted() && $form->isValid()) { $this->logger->notice('An activity has been removed', [ 'by_user' => $this->getUser()->getUsername(), 'activity_id' => $activity->getId(), @@ -640,7 +640,6 @@ final class ActivityController extends AbstractController return $this->createFormBuilder() ->setAction($this->generateUrl('chill_activity_activity_delete', $params)) - ->setMethod('DELETE') ->add('submit', SubmitType::class, ['label' => 'Delete']) ->getForm(); } diff --git a/src/Bundle/ChillActivityBundle/Entity/Activity.php b/src/Bundle/ChillActivityBundle/Entity/Activity.php index 2e7bede57..9f557f9b5 100644 --- a/src/Bundle/ChillActivityBundle/Entity/Activity.php +++ b/src/Bundle/ChillActivityBundle/Entity/Activity.php @@ -80,7 +80,7 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac private \DateTime $date; /** - * @var Collection + * @var Collection */ #[Assert\Valid(traverse: true)] #[ORM\ManyToMany(targetEntity: StoredObject::class, cascade: ['persist'])] @@ -107,7 +107,7 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac private ?Person $person = null; /** - * @var Collection + * @var Collection */ #[Groups(['read', 'docgen:read'])] #[ORM\ManyToMany(targetEntity: Person::class)] @@ -117,7 +117,7 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac private PrivateCommentEmbeddable $privateComment; /** - * @var Collection + * @var Collection */ #[Groups(['docgen:read'])] #[ORM\ManyToMany(targetEntity: ActivityReason::class)] @@ -132,7 +132,7 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac private string $sentReceived = ''; /** - * @var Collection + * @var Collection */ #[Groups(['read', 'docgen:read'])] #[ORM\ManyToMany(targetEntity: SocialAction::class)] @@ -140,7 +140,7 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac private Collection $socialActions; /** - * @var Collection + * @var Collection */ #[Groups(['read', 'docgen:read'])] #[ORM\ManyToMany(targetEntity: SocialIssue::class)] @@ -148,7 +148,7 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac private Collection $socialIssues; /** - * @var Collection + * @var Collection */ #[Groups(['read', 'docgen:read'])] #[ORM\ManyToMany(targetEntity: ThirdParty::class)] @@ -162,7 +162,7 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac private ?User $user = null; /** - * @var Collection + * @var Collection */ #[Groups(['read', 'docgen:read'])] #[ORM\ManyToMany(targetEntity: User::class)] diff --git a/src/Bundle/ChillActivityBundle/Entity/ActivityReason.php b/src/Bundle/ChillActivityBundle/Entity/ActivityReason.php index 5c6576497..bf36ead6c 100644 --- a/src/Bundle/ChillActivityBundle/Entity/ActivityReason.php +++ b/src/Bundle/ChillActivityBundle/Entity/ActivityReason.php @@ -79,11 +79,9 @@ class ActivityReason /** * Set active. * - * @param bool $active - * * @return ActivityReason */ - public function setActive($active) + public function setActive(bool $active) { $this->active = $active; @@ -110,11 +108,9 @@ class ActivityReason /** * Set name. * - * @param array $name - * * @return ActivityReason */ - public function setName($name) + public function setName(array $name) { $this->name = $name; diff --git a/src/Bundle/ChillActivityBundle/Entity/ActivityReasonCategory.php b/src/Bundle/ChillActivityBundle/Entity/ActivityReasonCategory.php index 9346d12a0..b31bb8731 100644 --- a/src/Bundle/ChillActivityBundle/Entity/ActivityReasonCategory.php +++ b/src/Bundle/ChillActivityBundle/Entity/ActivityReasonCategory.php @@ -40,9 +40,9 @@ class ActivityReasonCategory implements \Stringable /** * Array of ActivityReason. * - * @var Collection + * @var Collection */ - #[ORM\OneToMany(targetEntity: ActivityReason::class, mappedBy: 'category')] + #[ORM\OneToMany(mappedBy: 'category', targetEntity: ActivityReason::class)] private Collection $reasons; /** diff --git a/src/Bundle/ChillActivityBundle/Export/Export/ListActivityHelper.php b/src/Bundle/ChillActivityBundle/Export/Export/ListActivityHelper.php index 75d2c3fd0..15137b013 100644 --- a/src/Bundle/ChillActivityBundle/Export/Export/ListActivityHelper.php +++ b/src/Bundle/ChillActivityBundle/Export/Export/ListActivityHelper.php @@ -152,7 +152,7 @@ class ListActivityHelper return ''; } - return $this->translator->trans($value); + return $this->translator->trans((string) $value); }, }; } diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/PeriodHavingActivityBetweenDatesFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/PeriodHavingActivityBetweenDatesFilter.php index 2d3282ad1..1a006ba97 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/PeriodHavingActivityBetweenDatesFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/PeriodHavingActivityBetweenDatesFilter.php @@ -73,7 +73,7 @@ final readonly class PeriodHavingActivityBetweenDatesFilter implements FilterInt $qb->andWhere( $qb->expr()->exists( - 'SELECT 1 FROM '.Activity::class." {$alias} WHERE {$alias}.date >= :{$from} AND {$alias}.date < :{$to} AND {$alias}.accompanyingPeriod = acp" + 'SELECT 1 FROM '.Activity::class." {$alias} WHERE {$alias}.date >= :{$from} AND {$alias}.date < :{$to} AND {$alias}.accompanyingPeriod = activity.accompanyingPeriod" ) ); diff --git a/src/Bundle/ChillActivityBundle/Repository/ActivityTypeRepository.php b/src/Bundle/ChillActivityBundle/Repository/ActivityTypeRepository.php index 99adf4fe0..698c8b370 100644 --- a/src/Bundle/ChillActivityBundle/Repository/ActivityTypeRepository.php +++ b/src/Bundle/ChillActivityBundle/Repository/ActivityTypeRepository.php @@ -15,9 +15,9 @@ use Chill\ActivityBundle\Entity\ActivityType; use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityRepository; -final class ActivityTypeRepository implements ActivityTypeRepositoryInterface +final readonly class ActivityTypeRepository implements ActivityTypeRepositoryInterface { - private readonly EntityRepository $repository; + private EntityRepository $repository; public function __construct(EntityManagerInterface $em) { diff --git a/src/Bundle/ChillActivityBundle/Resources/views/Activity/concernedGroups.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/Activity/concernedGroups.html.twig index 76db92d42..5528ab233 100644 --- a/src/Bundle/ChillActivityBundle/Resources/views/Activity/concernedGroups.html.twig +++ b/src/Bundle/ChillActivityBundle/Resources/views/Activity/concernedGroups.html.twig @@ -87,7 +87,6 @@
  • {% if bloc.type == 'user' %} - hello {{ item|chill_entity_render_box({'render': 'raw', 'addAltNames': false, 'at_date': entity.date }) }} {% else %} diff --git a/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivityCategory.php b/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivityCategory.php index 1758cdd3d..712039c5b 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivityCategory.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivityCategory.php @@ -22,9 +22,9 @@ use Symfony\Component\Validator\Context\ExecutionContextInterface; class AsideActivityCategory { /** - * @var Collection + * @var Collection */ - #[ORM\OneToMany(targetEntity: AsideActivityCategory::class, mappedBy: 'parent')] + #[ORM\OneToMany(mappedBy: 'parent', targetEntity: AsideActivityCategory::class)] private Collection $children; #[ORM\Id] diff --git a/src/Bundle/ChillBudgetBundle/Controller/AbstractElementController.php b/src/Bundle/ChillBudgetBundle/Controller/AbstractElementController.php index d293907f5..bb204c557 100644 --- a/src/Bundle/ChillBudgetBundle/Controller/AbstractElementController.php +++ b/src/Bundle/ChillBudgetBundle/Controller/AbstractElementController.php @@ -54,7 +54,7 @@ abstract class AbstractElementController extends AbstractController $indexPage = 'chill_budget_elements_household_index'; } - if (Request::METHOD_DELETE === $request->getMethod()) { + if (Request::METHOD_POST === $request->getMethod()) { $form->handleRequest($request); if ($form->isSubmitted() && $form->isValid()) { @@ -198,10 +198,9 @@ abstract class AbstractElementController extends AbstractController /** * Creates a form to delete a help request entity by id. */ - private function createDeleteForm(): Form + private function createDeleteForm(): \Symfony\Component\Form\FormInterface { return $this->createFormBuilder() - ->setMethod(Request::METHOD_DELETE) ->add('submit', SubmitType::class, ['label' => 'Delete']) ->getForm(); } diff --git a/src/Bundle/ChillBudgetBundle/Entity/Charge.php b/src/Bundle/ChillBudgetBundle/Entity/Charge.php index 5857b8b67..b4b2918c9 100644 --- a/src/Bundle/ChillBudgetBundle/Entity/Charge.php +++ b/src/Bundle/ChillBudgetBundle/Entity/Charge.php @@ -100,7 +100,7 @@ class Charge extends AbstractElement implements HasCentersInterface return $this; } - public function setHelp($help) + public function setHelp(?string $help) { $this->help = $help; diff --git a/src/Bundle/ChillBudgetBundle/Repository/ChargeKindRepository.php b/src/Bundle/ChillBudgetBundle/Repository/ChargeKindRepository.php index a0c23a4ad..b2bb9e82e 100644 --- a/src/Bundle/ChillBudgetBundle/Repository/ChargeKindRepository.php +++ b/src/Bundle/ChillBudgetBundle/Repository/ChargeKindRepository.php @@ -15,9 +15,9 @@ use Chill\BudgetBundle\Entity\ChargeKind; use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityRepository; -final class ChargeKindRepository implements ChargeKindRepositoryInterface +final readonly class ChargeKindRepository implements ChargeKindRepositoryInterface { - private readonly EntityRepository $repository; + private EntityRepository $repository; public function __construct(EntityManagerInterface $entityManager) { diff --git a/src/Bundle/ChillBudgetBundle/Repository/ResourceKindRepository.php b/src/Bundle/ChillBudgetBundle/Repository/ResourceKindRepository.php index 723f26748..18051f120 100644 --- a/src/Bundle/ChillBudgetBundle/Repository/ResourceKindRepository.php +++ b/src/Bundle/ChillBudgetBundle/Repository/ResourceKindRepository.php @@ -15,9 +15,9 @@ use Chill\BudgetBundle\Entity\ResourceKind; use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityRepository; -final class ResourceKindRepository implements ResourceKindRepositoryInterface +final readonly class ResourceKindRepository implements ResourceKindRepositoryInterface { - private readonly EntityRepository $repository; + private EntityRepository $repository; public function __construct(EntityManagerInterface $entityManager) { diff --git a/src/Bundle/ChillCalendarBundle/Controller/CalendarController.php b/src/Bundle/ChillCalendarBundle/Controller/CalendarController.php index 328b8788f..e57d2743d 100644 --- a/src/Bundle/ChillCalendarBundle/Controller/CalendarController.php +++ b/src/Bundle/ChillCalendarBundle/Controller/CalendarController.php @@ -84,7 +84,7 @@ class CalendarController extends AbstractController $form = $this->createDeleteForm($entity); - if (Request::METHOD_DELETE === $request->getMethod()) { + if (Request::METHOD_POST === $request->getMethod()) { $form->handleRequest($request); if ($form->isValid()) { @@ -512,7 +512,6 @@ class CalendarController extends AbstractController { return $this->createFormBuilder() ->setAction($this->generateUrl('chill_calendar_calendar_delete', ['id' => $calendar->getId()])) - ->setMethod('DELETE') ->add('submit', SubmitType::class, ['label' => 'Delete']) ->getForm(); } diff --git a/src/Bundle/ChillCalendarBundle/Entity/Calendar.php b/src/Bundle/ChillCalendarBundle/Entity/Calendar.php index 53949d1f0..05d75a9bc 100644 --- a/src/Bundle/ChillCalendarBundle/Entity/Calendar.php +++ b/src/Bundle/ChillCalendarBundle/Entity/Calendar.php @@ -103,7 +103,7 @@ class Calendar implements TrackCreationInterface, TrackUpdateInterface, HasCente private int $dateTimeVersion = 0; /** - * @var Collection + * @var Collection */ #[ORM\OneToMany(mappedBy: 'calendar', targetEntity: CalendarDoc::class, orphanRemoval: true)] private Collection $documents; @@ -120,7 +120,7 @@ class Calendar implements TrackCreationInterface, TrackUpdateInterface, HasCente private ?int $id = null; /** - * @var Collection&Selectable + * @var \Doctrine\Common\Collections\Collection&Selectable */ #[Serializer\Groups(['read', 'docgen:read'])] #[ORM\OneToMany(mappedBy: 'calendar', targetEntity: Invite::class, cascade: ['persist', 'remove', 'merge', 'detach'], orphanRemoval: true)] @@ -143,7 +143,7 @@ class Calendar implements TrackCreationInterface, TrackUpdateInterface, HasCente private ?Person $person = null; /** - * @var Collection + * @var Collection */ #[Serializer\Groups(['calendar:read', 'read', 'calendar:light', 'docgen:read'])] #[Assert\Count(min: 1, minMessage: 'calendar.At least {{ limit }} person is required.')] @@ -157,7 +157,7 @@ class Calendar implements TrackCreationInterface, TrackUpdateInterface, HasCente private PrivateCommentEmbeddable $privateComment; /** - * @var Collection + * @var Collection */ #[Serializer\Groups(['calendar:read', 'read', 'calendar:light', 'docgen:read'])] #[ORM\ManyToMany(targetEntity: ThirdParty::class)] diff --git a/src/Bundle/ChillCalendarBundle/Tests/Service/DocGenerator/CalendarContextTest.php b/src/Bundle/ChillCalendarBundle/Tests/Service/DocGenerator/CalendarContextTest.php index 4a4b4f7d4..c06872a66 100644 --- a/src/Bundle/ChillCalendarBundle/Tests/Service/DocGenerator/CalendarContextTest.php +++ b/src/Bundle/ChillCalendarBundle/Tests/Service/DocGenerator/CalendarContextTest.php @@ -47,7 +47,7 @@ final class CalendarContextTest extends TestCase { $expected = [ - 'track_datetime' => true, + 'trackDatetime' => true, 'askMainPerson' => true, 'mainPersonLabel' => 'docgen.calendar.Destinee', 'askThirdParty' => false, @@ -61,7 +61,7 @@ final class CalendarContextTest extends TestCase { $expected = [ - 'track_datetime' => true, + 'trackDatetime' => true, 'askMainPerson' => true, 'mainPersonLabel' => 'docgen.calendar.Destinee', 'askThirdParty' => false, diff --git a/src/Bundle/ChillCustomFieldsBundle/Entity/CustomField.php b/src/Bundle/ChillCustomFieldsBundle/Entity/CustomField.php index 9fddc10b3..06ff658c7 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Entity/CustomField.php +++ b/src/Bundle/ChillCustomFieldsBundle/Entity/CustomField.php @@ -172,11 +172,9 @@ class CustomField /** * Set active. * - * @param bool $active - * * @return CustomField */ - public function setActive($active) + public function setActive(bool $active) { $this->active = $active; @@ -224,18 +222,16 @@ class CustomField /** * Set order. * - * @param float $order - * * @return CustomField */ - public function setOrdering($order) + public function setOrdering(?float $order) { $this->ordering = $order; return $this; } - public function setRequired($required) + public function setRequired(bool $required) { $this->required = $required; @@ -245,7 +241,7 @@ class CustomField /** * @return $this */ - public function setSlug($slug) + public function setSlug(?string $slug) { $this->slug = $slug; @@ -255,11 +251,9 @@ class CustomField /** * Set type. * - * @param string $type - * * @return CustomField */ - public function setType($type) + public function setType(?string $type) { $this->type = $type; diff --git a/src/Bundle/ChillCustomFieldsBundle/Entity/CustomFieldLongChoice/Option.php b/src/Bundle/ChillCustomFieldsBundle/Entity/CustomFieldLongChoice/Option.php index 497cf7150..c8bdc6031 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Entity/CustomFieldLongChoice/Option.php +++ b/src/Bundle/ChillCustomFieldsBundle/Entity/CustomFieldLongChoice/Option.php @@ -23,9 +23,9 @@ class Option private bool $active = true; /** - * @var Collection