Olivier Massot vor 7 Monaten
Ursprung
Commit
dfe16878fa
35 geänderte Dateien mit 67 neuen und 70 gelöschten Zeilen
  1. 0 1
      src/ApiResources/Access/AdminAccess.php
  2. 1 1
      src/ApiResources/Dolibarr/DolibarrAccount.php
  3. 1 1
      src/Commands/CronCommand.php
  4. 2 4
      src/Commands/Doctrine/SchemaUpdateCommand.php
  5. 3 3
      src/Commands/PostUpgrade/V0_2/PostUpgradeCommand.php
  6. 0 1
      src/Doctrine/Access/CurrentAccessExtension.php
  7. 2 2
      src/Doctrine/Custom/Search/RestrictToOrganizationIdExtension.php
  8. 2 2
      src/Entity/Awin/Product.php
  9. 1 1
      src/Entity/Booking/AttendanceBookingReason.php
  10. 1 1
      src/Entity/Core/BankAccount.php
  11. 1 1
      src/Entity/Core/Categories.php
  12. 1 1
      src/Entity/Core/City.php
  13. 1 1
      src/Entity/Core/Country.php
  14. 0 1
      src/Entity/Core/Tagg.php
  15. 7 0
      src/Entity/Custom/Search/UserSearchItem.php
  16. 0 1
      src/Entity/Education/Cycle.php
  17. 1 1
      src/Entity/Education/EducationNotationConfig.php
  18. 2 0
      src/Entity/Organization/OnlineRegistrationOpeningPeriod.php
  19. 2 0
      src/Entity/Organization/OnlineRegistrationSettings.php
  20. 2 3
      src/Entity/Organization/Parameters.php
  21. 1 1
      src/Entity/Organization/Subdomain.php
  22. 4 3
      src/Entity/Person/Person.php
  23. 0 1
      src/Entity/Product/EquipmentControl.php
  24. 2 2
      src/Entity/Traits/ActivityYearTrait.php
  25. 0 1
      src/EventListener/OnKernelRequestPreRead.php
  26. 1 1
      src/Service/ApiResourceBuilder/Mobyt/MobytUserStatusBuilder.php
  27. 0 1
      src/Service/Doctrine/SchemaValidation/SchemaSnippetsMaker.php
  28. 3 2
      src/Service/Dolibarr/DolibarrApiService.php
  29. 1 3
      src/Service/Dolibarr/DolibarrSyncService.php
  30. 10 12
      src/Service/Organization/OrganizationFactory.php
  31. 2 2
      src/Service/Organization/OrganizationProfileCreator.php
  32. 9 9
      src/Service/Organization/Trial.php
  33. 2 2
      src/Service/Typo3/BindFileService.php
  34. 1 1
      src/Validator/Organization/Parameters/MobytCredentialsValidator.php
  35. 1 3
      tests/Unit/Service/Dolibarr/DolibarrSyncServiceTest.php

+ 0 - 1
src/ApiResources/Access/AdminAccess.php

@@ -8,7 +8,6 @@ use ApiPlatform\Metadata\ApiProperty;
 use ApiPlatform\Metadata\ApiResource;
 use ApiPlatform\Metadata\Get;
 use ApiPlatform\Metadata\Patch;
-use ApiPlatform\Metadata\Put;
 use App\ApiResources\ApiResourcesInterface;
 use App\State\Processor\Access\AdminAccessProcessor;
 use App\State\Provider\Access\AdminAccessProvider;

+ 1 - 1
src/ApiResources/Dolibarr/DolibarrAccount.php

@@ -65,7 +65,6 @@ class DolibarrAccount implements ApiResourcesInterface
 
     /**
      * Last order of the society.
-     * @var DolibarrOrder|null
      */
     #[Groups('dolibarr_get')]
     private ?DolibarrOrder $order = null;
@@ -150,6 +149,7 @@ class DolibarrAccount implements ApiResourcesInterface
     public function setOrder(?DolibarrOrder $order): self
     {
         $this->order = $order;
+
         return $this;
     }
 

+ 1 - 1
src/Commands/CronCommand.php

@@ -223,7 +223,7 @@ class CronCommand extends Command
             $this->output->writeln($formatter->formatSection($job->name(), $msg));
             $this->logger->info($job->name().' - '.$msg);
         } catch (\Throwable $e) {
-            $this->logger->critical((string)$e);
+            $this->logger->critical((string) $e);
             $this->output->write('An error happened while running the process : '.$e);
 
             return Command::FAILURE;

+ 2 - 4
src/Commands/Doctrine/SchemaUpdateCommand.php

@@ -6,7 +6,6 @@ declare(strict_types=1);
 
 namespace App\Commands\Doctrine;
 
-use App\Service\Utils\FileUtils;
 use App\Service\Utils\PathUtils;
 use Doctrine\ORM\Tools\Console\Command\SchemaTool\UpdateCommand;
 use Doctrine\ORM\Tools\Console\EntityManagerProvider;
@@ -27,9 +26,8 @@ class SchemaUpdateCommand extends UpdateCommand
     }
 
     public function __construct(
-        private readonly EntityManagerProvider $entityManagerProvider
-    )
-    {
+        private readonly EntityManagerProvider $entityManagerProvider,
+    ) {
         parent::__construct($this->entityManagerProvider);
     }
 

+ 3 - 3
src/Commands/PostUpgrade/V0_2/PostUpgradeCommand.php

@@ -156,7 +156,7 @@ class PostUpgradeCommand extends Command
             $this->logger->info('Subdomain table was successfully populated');
         } catch (\Exception $e) {
             $opentalentCnn->rollBack();
-            $this->logger->error((string)$e);
+            $this->logger->error((string) $e);
             $this->logger->critical('Error while populating the subdomains, abort and rollback');
         }
     }
@@ -181,7 +181,7 @@ class PostUpgradeCommand extends Command
             $this->logger->info('Events uuid were successfully generated');
         } catch (\Exception $e) {
             $opentalentCnn->rollBack();
-            $this->logger->error((string)$e);
+            $this->logger->error((string) $e);
             $this->logger->critical('Error while generating events uuids, abort and rollback');
         }
     }
@@ -202,7 +202,7 @@ class PostUpgradeCommand extends Command
             $this->logger->info('Files statuses were successfully updated');
         } catch (\Exception $e) {
             $opentalentCnn->rollBack();
-            $this->logger->error((string)$e);
+            $this->logger->error((string) $e);
             $this->logger->critical('Error while updating file statuses, abort and rollback');
         }
     }

+ 0 - 1
src/Doctrine/Access/CurrentAccessExtension.php

@@ -7,7 +7,6 @@ namespace App\Doctrine\Access;
 use ApiPlatform\Metadata\Operation;
 use App\Doctrine\AbstractExtension;
 use App\Entity\Access\Access;
-use App\Entity\Custom\Search\UserSearchItem;
 use App\Service\ServiceIterator\CurrentAccessExtensionIterator;
 use Doctrine\ORM\QueryBuilder;
 use Symfony\Bundle\SecurityBundle\Security;

+ 2 - 2
src/Doctrine/Custom/Search/RestrictToOrganizationIdExtension.php

@@ -8,7 +8,6 @@ use ApiPlatform\Metadata\Operation;
 use App\Doctrine\AbstractExtension;
 use App\Entity\Access\Access;
 use App\Entity\Custom\Search\UserSearchItem;
-use App\Service\ServiceIterator\CurrentAccessExtensionIterator;
 use Doctrine\ORM\QueryBuilder;
 use Symfony\Bundle\SecurityBundle\Security;
 
@@ -20,7 +19,8 @@ final class RestrictToOrganizationIdExtension extends AbstractExtension
 {
     public function __construct(
         private readonly Security $security,
-    ) {}
+    ) {
+    }
 
     public function supports(string $resourceClass, ?Operation $operation): bool
     {

+ 2 - 2
src/Entity/Awin/Product.php

@@ -15,8 +15,8 @@ use Doctrine\ORM\Mapping as ORM;
 #[ORM\Table(
     name: 'AwinProduct',
     indexes: [
-        new ORM\Index(columns: ["name"], name: "name_idx"),
-        new ORM\Index(columns: ["slug"], name: "slug_idx"),
+        new ORM\Index(columns: ['name'], name: 'name_idx'),
+        new ORM\Index(columns: ['slug'], name: 'slug_idx'),
     ]
 )]
 class Product

+ 1 - 1
src/Entity/Booking/AttendanceBookingReason.php

@@ -13,10 +13,10 @@ use ApiPlatform\Metadata\Post;
 use ApiPlatform\Metadata\Put;
 use App\Attribute\OrganizationDefaultValue;
 use App\Entity\Organization\Organization;
+use DH\Auditor\Provider\Doctrine\Auditing\Annotation\Auditable;
 use Doctrine\Common\Collections\ArrayCollection;
 use Doctrine\Common\Collections\Collection;
 use Doctrine\ORM\Mapping as ORM;
-use DH\Auditor\Provider\Doctrine\Auditing\Annotation\Auditable;
 
 /**
  * Motif d'absence ou de retard.

+ 1 - 1
src/Entity/Core/BankAccount.php

@@ -55,7 +55,7 @@ class BankAccount
     /**
      * 0 => jamais facturé, 1 => facturé 1 fois, 2 => facturé plusieurs fois.
      */
-    #[ORM\Column(columnDefinition: "TINYINT DEFAULT 0 NOT NULL")]
+    #[ORM\Column(columnDefinition: 'TINYINT DEFAULT 0 NOT NULL')]
     private int $countInvoiced = 0;
 
     #[ORM\Column(length: 255, nullable: true)]

+ 1 - 1
src/Entity/Core/Categories.php

@@ -17,7 +17,7 @@ use Doctrine\ORM\Mapping as ORM;
 class Categories
 {
     #[ORM\Id]
-    #[ORM\Column(type: "mediumint", options: ["unsigned" => true])]
+    #[ORM\Column(type: 'mediumint', options: ['unsigned' => true])]
     #[ORM\GeneratedValue]
     private ?int $id = null;
 

+ 1 - 1
src/Entity/Core/City.php

@@ -18,7 +18,7 @@ use Doctrine\ORM\Mapping as ORM;
 class City
 {
     #[ORM\Id]
-    #[ORM\Column(type: "mediumint", options: ["unsigned" => true])]
+    #[ORM\Column(type: 'mediumint', options: ['unsigned' => true])]
     #[ORM\GeneratedValue]
     private ?int $id = null;
 

+ 1 - 1
src/Entity/Core/Country.php

@@ -23,7 +23,7 @@ use Doctrine\ORM\Mapping as ORM;
 )]
 // #[Auditable]
 #[ORM\Entity(repositoryClass: CountryRepository::class)]
-#[ORM\Table(indexes: [new ORM\Index(name: "name_idx", columns: ["name"])])]
+#[ORM\Table(indexes: [new ORM\Index(name: 'name_idx', columns: ['name'])])]
 class Country
 {
     #[ORM\Id]

+ 0 - 1
src/Entity/Core/Tagg.php

@@ -190,7 +190,6 @@ class Tagg
     #[ORM\OneToMany(targetEntity: AbstractControl::class, mappedBy: 'tags', cascade: [], orphanRemoval: false)]
     private Collection $controls;
 
-
     public function __construct()
     {
         $this->accesses = new ArrayCollection();

+ 7 - 0
src/Entity/Custom/Search/UserSearchItem.php

@@ -71,6 +71,7 @@ class UserSearchItem
     public function setId(int $id): self
     {
         $this->id = $id;
+
         return $this;
     }
 
@@ -82,6 +83,7 @@ class UserSearchItem
     public function setOrganizationId(?int $organizationId): self
     {
         $this->organizationId = $organizationId;
+
         return $this;
     }
 
@@ -93,6 +95,7 @@ class UserSearchItem
     public function setPersonId(?int $personId): self
     {
         $this->personId = $personId;
+
         return $this;
     }
 
@@ -104,6 +107,7 @@ class UserSearchItem
     public function setUsername(?string $username): self
     {
         $this->username = $username;
+
         return $this;
     }
 
@@ -115,6 +119,7 @@ class UserSearchItem
     public function setName(?string $name): self
     {
         $this->name = $name;
+
         return $this;
     }
 
@@ -126,6 +131,7 @@ class UserSearchItem
     public function setGivenName(?string $givenName): self
     {
         $this->givenName = $givenName;
+
         return $this;
     }
 
@@ -137,6 +143,7 @@ class UserSearchItem
     public function setFullName(?string $fullName): self
     {
         $this->fullName = $fullName;
+
         return $this;
     }
 }

+ 0 - 1
src/Entity/Education/Cycle.php

@@ -8,7 +8,6 @@ use ApiPlatform\Metadata\ApiResource;
 use ApiPlatform\Metadata\Get;
 use ApiPlatform\Metadata\GetCollection;
 use ApiPlatform\Metadata\Patch;
-use ApiPlatform\Metadata\Put;
 use App\Entity\Organization\Organization;
 use App\Enum\Education\CycleEnum;
 use App\Repository\Education\CycleRepository;

+ 1 - 1
src/Entity/Education/EducationNotationConfig.php

@@ -47,7 +47,7 @@ class EducationNotationConfig
     #[ORM\Column(type: 'text', nullable: true)]
     private ?string $description;
 
-    #[ORM\Column(columnDefinition: "TINYINT DEFAULT 1 NOT NULL")]
+    #[ORM\Column(columnDefinition: 'TINYINT DEFAULT 1 NOT NULL')]
     #[Assert\Range(notInRangeMessage: 'between_{{ min }}_and_{{ max }}', min: 1, max: 10)]
     private int $coefficient = 1;
 

+ 2 - 0
src/Entity/Organization/OnlineRegistrationOpeningPeriod.php

@@ -78,6 +78,7 @@ class OnlineRegistrationOpeningPeriod
     public function setStartDate(\DateTimeInterface $startDate): self
     {
         $this->startDate = $startDate;
+
         return $this;
     }
 
@@ -89,6 +90,7 @@ class OnlineRegistrationOpeningPeriod
     public function setEndDate(\DateTimeInterface $endDate): self
     {
         $this->endDate = $endDate;
+
         return $this;
     }
 }

+ 2 - 0
src/Entity/Organization/OnlineRegistrationSettings.php

@@ -289,6 +289,7 @@ class OnlineRegistrationSettings
     public function setAddNewStudents(bool $addNewStudents): self
     {
         $this->addNewStudents = $addNewStudents;
+
         return $this;
     }
 
@@ -300,6 +301,7 @@ class OnlineRegistrationSettings
     public function setAddNewEducations(bool $addNewEducations): self
     {
         $this->addNewEducations = $addNewEducations;
+
         return $this;
     }
 

+ 2 - 3
src/Entity/Organization/Parameters.php

@@ -7,7 +7,6 @@ namespace App\Entity\Organization;
 use ApiPlatform\Metadata\ApiResource;
 use ApiPlatform\Metadata\Get;
 use ApiPlatform\Metadata\Patch;
-use ApiPlatform\Metadata\Put;
 use App\Entity\Access\Access;
 use App\Entity\Core\File;
 use App\Enum\Core\TimeZoneEnum;
@@ -66,7 +65,7 @@ class Parameters
     #[ORM\Column(type: 'date', nullable: true)]
     private ?\DateTimeInterface $endCourseDate = null;
 
-    #[ORM\Column(columnDefinition: "TINYINT DEFAULT 20 NOT NULL")]
+    #[ORM\Column(columnDefinition: 'TINYINT DEFAULT 20 NOT NULL')]
     #[Assert\Range(notInRangeMessage: 'between_{{ min }}_and_{{ max }}', min: 0, max: 100)]
     private int $average = 20;
 
@@ -187,7 +186,7 @@ class Parameters
     #[ORM\Column(type: 'boolean', options: ['default' => false])]
     private bool $notifyAdministrationAbsence = false;
 
-    #[ORM\Column(columnDefinition: "TINYINT DEFAULT 2 NOT NULL")]
+    #[ORM\Column(columnDefinition: 'TINYINT DEFAULT 2 NOT NULL')]
     #[Assert\Range(notInRangeMessage: 'between_{{ min }}_and_{{ max }}', min: 2, max: 100)]
     private int $numberConsecutiveAbsences = 2;
 

+ 1 - 1
src/Entity/Organization/Subdomain.php

@@ -45,7 +45,7 @@ use Symfony\Component\Validator\Constraints as Assert;
 #[OrganizationDefaultValue(fieldName: 'organization')]
 #[UniqueEntity('subdomain')]
 #[ApiFilter(filterClass: SearchFilter::class, properties: ['subdomain' => 'exact'])]
-#[ORM\Table(indexes: [new ORM\Index(name: "subdomain_idx", columns: ["subdomain"])])]
+#[ORM\Table(indexes: [new ORM\Index(name: 'subdomain_idx', columns: ['subdomain'])])]
 class Subdomain
 {
     #[ORM\Id]

+ 4 - 3
src/Entity/Person/Person.php

@@ -31,9 +31,9 @@ use Symfony\Component\Serializer\Annotation\Groups;
 #[ORM\Entity(repositoryClass: PersonRepository::class)]
 #[ORM\Table(
     indexes: [
-        new ORM\Index(columns: ["username"], name: "username_idx"),
-        new ORM\Index(columns: ["name"], name: "name_idx"),
-        new ORM\Index(columns: ["givenName"], name: "givenName_idx"),
+        new ORM\Index(columns: ['username'], name: 'username_idx'),
+        new ORM\Index(columns: ['name'], name: 'name_idx'),
+        new ORM\Index(columns: ['givenName'], name: 'givenName_idx'),
     ]
 )]
 class Person implements UserInterface, PasswordAuthenticatedUserInterface
@@ -183,6 +183,7 @@ class Person implements UserInterface, PasswordAuthenticatedUserInterface
     public function setUsernameCanonical(?string $usernameCanonical): self
     {
         $this->usernameCanonical = $usernameCanonical;
+
         return $this;
     }
 

+ 0 - 1
src/Entity/Product/EquipmentControl.php

@@ -57,5 +57,4 @@ class EquipmentControl extends AbstractControl
 
         return $this;
     }
-
 }

+ 2 - 2
src/Entity/Traits/ActivityYearTrait.php

@@ -11,10 +11,10 @@ use Doctrine\ORM\Mapping as ORM;
  */
 trait ActivityYearTrait
 {
-    #[ORM\Column(type: "smallint", nullable: true)]
+    #[ORM\Column(type: 'smallint', nullable: true)]
     private ?int $startYear = null;
 
-    #[ORM\Column(type: "smallint", nullable: true)]
+    #[ORM\Column(type: 'smallint', nullable: true)]
     private ?int $endYear = null;
 
     public function getStartYear(): ?int

+ 0 - 1
src/EventListener/OnKernelRequestPreRead.php

@@ -8,7 +8,6 @@ use ApiPlatform\Symfony\EventListener\EventPriorities;
 use App\Entity\Access\Access;
 use App\Service\Doctrine\FiltersConfigurationService;
 use App\Service\Utils\ObjectUtils;
-use App\Service\Utils\StringsUtils;
 use Symfony\Bundle\SecurityBundle\Security;
 use Symfony\Component\EventDispatcher\EventSubscriberInterface;
 use Symfony\Component\HttpFoundation\RequestStack;

+ 1 - 1
src/Service/ApiResourceBuilder/Mobyt/MobytUserStatusBuilder.php

@@ -45,7 +45,7 @@ class MobytUserStatusBuilder
         foreach ($userStatusData['sms'] as $_ => $smsTypeData) {
             // we only retrieve the 'top quality sms', which are identified by the letter N in the mobyt api
             if ($smsTypeData['type'] === 'N') {
-                $topQualitySmsAmount = (int)$smsTypeData['quantity'];
+                $topQualitySmsAmount = (int) $smsTypeData['quantity'];
             }
         }
         $userStatus->setAmount($topQualitySmsAmount);

+ 0 - 1
src/Service/Doctrine/SchemaValidation/SchemaSnippetsMaker.php

@@ -7,7 +7,6 @@ namespace App\Service\Doctrine\SchemaValidation;
 use ApiPlatform\Metadata\ApiResource;
 use App\Service\Utils\EntityUtils;
 use App\Service\Utils\FileUtils;
-use App\Service\Utils\Path;
 use App\Service\Utils\PathUtils;
 use Doctrine\Common\Collections\Collection;
 use Doctrine\ORM\Mapping\ClassMetadata;

+ 3 - 2
src/Service/Dolibarr/DolibarrApiService.php

@@ -99,11 +99,12 @@ class DolibarrApiService extends ApiRequestService
     /**
      * Get the last order of the given society.
      *
-     * @param int $socId
      * @return array<string, mixed>|null
+     *
      * @throws \JsonException
      */
-    public function getLastOrder(int $socId): ?array {
+    public function getLastOrder(int $socId): ?array
+    {
         try {
             $results = $this->getJsonContent(
                 'orders',

+ 1 - 3
src/Service/Dolibarr/DolibarrSyncService.php

@@ -9,7 +9,6 @@ use App\Entity\Core\ContactPoint;
 use App\Entity\Organization\Organization;
 use App\Entity\Person\Person;
 use App\Enum\Access\FunctionEnum;
-use App\Enum\Access\RoleEnum;
 use App\Enum\Core\ContactPointTypeEnum;
 use App\Enum\Network\NetworkEnum;
 use App\Enum\Organization\AddressPostalOrganizationTypeEnum;
@@ -18,7 +17,6 @@ use App\Enum\Organization\OrganizationIdsEnum;
 use App\Enum\Organization\SettingsProductEnum;
 use App\Enum\Person\GenderEnum;
 use App\Repository\Access\AccessRepository;
-use App\Repository\Access\FunctionTypeRepository;
 use App\Repository\Organization\OrganizationRepository;
 use App\Service\Core\AddressPostalUtils;
 use App\Service\Organization\Utils;
@@ -193,7 +191,7 @@ class DolibarrSyncService
                         FunctionEnum::MEMBER_OF_THE_BOARD->value, FunctionEnum::PRESIDENT->value, FunctionEnum::PRESIDENT_ASSISTANT->value, FunctionEnum::SECRETARY->value,
                         FunctionEnum::ASSISTANT_SECRETARY->value, FunctionEnum::TREASURER->value, FunctionEnum::TREASURER_ASSISTANT->value,
                         FunctionEnum::VICE_PRESIDENT->value, FunctionEnum::ARTISTIC_DIRECTOR->value, FunctionEnum::ARTISTIC_DIRECTOR_ASSISTANT->value,
-                        FunctionEnum::DIRECTOR->value, FunctionEnum::DIRECTOR_ASSISTANT->value
+                        FunctionEnum::DIRECTOR->value, FunctionEnum::DIRECTOR_ASSISTANT->value,
                     ],
                     $organizationMembers
                 );

+ 10 - 12
src/Service/Organization/OrganizationFactory.php

@@ -138,7 +138,7 @@ class OrganizationFactory
             $this->logger->info('New dolibarr structure created (uid : '.$dolibarrId.')');
         } catch (\Throwable $e) {
             $this->logger->critical('An error happened while creating the dolibarr society, please proceed manually.');
-            $this->logger->debug((string)$e);
+            $this->logger->debug((string) $e);
             $withError = true;
         }
 
@@ -148,7 +148,7 @@ class OrganizationFactory
             $this->logger->info('Subdomain registered');
         } catch (\Throwable $e) {
             $this->logger->critical('An error happened while updating the bind file, please proceed manually.');
-            $this->logger->debug((string)$e);
+            $this->logger->debug((string) $e);
             $withError = true;
         }
 
@@ -159,7 +159,7 @@ class OrganizationFactory
                 $this->logger->info('Typo3 website created (root uid: '.$rootUid.')');
             } catch (\Throwable $e) {
                 $this->logger->critical('An error happened while creating the typo3 website, please proceed manually.');
-                $this->logger->debug((string)$e);
+                $this->logger->debug((string) $e);
                 $withError = true;
             }
         } else {
@@ -172,7 +172,7 @@ class OrganizationFactory
             $this->logger->info('Adminassos db updated');
         } catch (\Throwable $e) {
             $this->logger->critical('An error happened while updating the adminassos db, please proceed manually.');
-            $this->logger->debug((string)$e);
+            $this->logger->debug((string) $e);
             $withError = true;
         }
 
@@ -603,8 +603,8 @@ class OrganizationFactory
             $person = new Person();
 
             if (
-                $creationRequestData->getUsername() !== null &&
-                $this->personRepository->findOneBy(['username' => $creationRequestData->getUsername()])
+                $creationRequestData->getUsername() !== null
+                && $this->personRepository->findOneBy(['username' => $creationRequestData->getUsername()])
             ) {
                 throw new \RuntimeException('Username already in use : '.$creationRequestData->getUsername());
             }
@@ -710,8 +710,6 @@ class OrganizationFactory
             throw new \RuntimeException('Mobile phone number is invalid (person: '.$organizationMemberCreationRequest->getUsername().')');
         }
 
-
-
         $contactPoint = new ContactPoint();
         $contactPoint->setContactType(ContactPointTypeEnum::PRINCIPAL);
         $contactPoint->setEmail($organizationMemberCreationRequest->getEmail());
@@ -854,7 +852,7 @@ class OrganizationFactory
             $this->logger->info('Typo3 website deleted');
         } catch (\Exception $e) {
             $this->logger->critical('An error happened while deleting the Typo3 website, please proceed manually.');
-            $this->logger->debug((string)$e);
+            $this->logger->debug((string) $e);
             $withError = true;
         }
 
@@ -863,7 +861,7 @@ class OrganizationFactory
             $this->logger->info('Dolibarr society switched to prospect');
         } catch (\Exception $e) {
             $this->logger->critical('An error happened while updating the Dolibarr society, please proceed manually.');
-            $this->logger->debug((string)$e);
+            $this->logger->debug((string) $e);
             $withError = true;
         }
 
@@ -874,7 +872,7 @@ class OrganizationFactory
             // Nothing to delete
         } catch (\Exception $e) {
             $this->logger->critical("An error happened while deleting the organization's files, please proceed manually.");
-            $this->logger->debug((string)$e);
+            $this->logger->debug((string) $e);
             $withError = true;
         }
 
@@ -885,7 +883,7 @@ class OrganizationFactory
                 // Nothing to delete
             } catch (\Exception $e) {
                 $this->logger->critical("An error happened while deleting the person's files, please proceed manually (id=".$personId.').');
-                $this->logger->debug((string)$e);
+                $this->logger->debug((string) $e);
                 $withError = true;
             }
         }

+ 2 - 2
src/Service/Organization/OrganizationProfileCreator.php

@@ -22,7 +22,7 @@ class OrganizationProfileCreator
         private Module $module,
         private Tree $tree,
         private OrganizationUtils $organizationUtils,
-        private Trial $trialService
+        private Trial $trialService,
     ) {
     }
 
@@ -39,7 +39,7 @@ class OrganizationProfileCreator
         $organizationProfile->setParametersId($organization->getParameters()->getId());
         $organizationProfile->setLegalStatus($organization->getLegalStatus());
         $organizationProfile->setPrincipalType($organization->getPrincipalType());
-        $organizationProfile->setTrialActive($organization->getSettings()->isTrialActive());
+        $organizationProfile->setTrialActive($organization->getSettings()->isTrialActive() ?? false);
         $organizationProfile->setTrialCountDown($this->trialService->getTrialCountdown($organization->getSettings()->getlLastTrialStartDate()));
         $organizationProfile->setProductBeforeTrial($organization->getSettings()->getProductBeforeTrial());
         $organizationProfile->setHasChildren($organization->getNetworkOrganizationChildren()->count() > 1);

+ 9 - 9
src/Service/Organization/Trial.php

@@ -12,26 +12,26 @@ use App\Service\Utils\DatesUtils;
 class Trial
 {
     public function __construct(
-        private DatesUtils $datesUtils
-    )
-    {
+        private DatesUtils $datesUtils,
+    ) {
     }
 
     /**
-     * Retourne le décompte sur 30 jours du dernier lancement d'essai
-     * @param $trialStartDate
+     * Retourne le décompte sur 30 jours du dernier lancement d'essai.
+     *
      * @return int
      */
-    public function getTrialCountdown(?\DateTimeInterface $trialStartDate){
-        if(empty($trialStartDate)){
+    public function getTrialCountdown(?\DateTimeInterface $trialStartDate)
+    {
+        if (empty($trialStartDate)) {
             return 0;
         }
 
         $daysSince = $this->datesUtils::daysSince($trialStartDate);
-        if($daysSince > 30){
+        if ($daysSince > 30) {
             return 0;
         }
 
         return 30 - $daysSince;
     }
-}
+}

+ 2 - 2
src/Service/Typo3/BindFileService.php

@@ -24,13 +24,13 @@ readonly class BindFileService
      * Append the subdomain to the buffer file.
      *
      * A cron consumes this file each 5 minutes to complete the bind file /etc/bind/zones/opentalent.fr.db
-     * @param string $subdomain
+     *
      * @throws FileNotFoundException
      * @throws IOException
      */
     public function registerSubdomain(string $subdomain): void
     {
         $bindFile = new Path($this->bindfileBufferFile);
-        $bindFile->putContent($subdomain . '\n', true);
+        $bindFile->putContent($subdomain.'\n', true);
     }
 }

+ 1 - 1
src/Validator/Organization/Parameters/MobytCredentialsValidator.php

@@ -36,7 +36,7 @@ class MobytCredentialsValidator extends ConstraintValidator
             return $this->mobytService->hasCredentialsCorrect($userNameSms, $passwordSms);
         } catch (\Exception) {
             $this->context
-                ->buildViolation("Invalid Mobyt credentials")
+                ->buildViolation('Invalid Mobyt credentials')
                 ->atPath('passwordSMS')
                 ->addViolation();
 

+ 1 - 3
tests/Unit/Service/Dolibarr/DolibarrSyncServiceTest.php

@@ -15,7 +15,6 @@ use App\Entity\Organization\OrganizationAddressPostal;
 use App\Entity\Organization\Settings;
 use App\Entity\Person\Person;
 use App\Enum\Access\FunctionEnum;
-use App\Enum\Access\RoleEnum;
 use App\Enum\Core\ContactPointTypeEnum;
 use App\Enum\Network\NetworkEnum;
 use App\Enum\Organization\AddressPostalOrganizationTypeEnum;
@@ -23,7 +22,6 @@ use App\Enum\Organization\LegalEnum;
 use App\Enum\Organization\SettingsProductEnum;
 use App\Enum\Person\GenderEnum;
 use App\Repository\Access\AccessRepository;
-use App\Repository\Access\FunctionTypeRepository;
 use App\Repository\Organization\OrganizationRepository;
 use App\Service\Core\AddressPostalUtils;
 use App\Service\Dolibarr\DolibarrApiService;
@@ -499,7 +497,7 @@ class DolibarrSyncServiceTest extends TestCase
             FunctionEnum::MEMBER_OF_THE_BOARD->value, FunctionEnum::PRESIDENT->value, FunctionEnum::PRESIDENT_ASSISTANT->value, FunctionEnum::SECRETARY->value,
             FunctionEnum::ASSISTANT_SECRETARY->value, FunctionEnum::TREASURER->value, FunctionEnum::TREASURER_ASSISTANT->value,
             FunctionEnum::VICE_PRESIDENT->value, FunctionEnum::ARTISTIC_DIRECTOR->value, FunctionEnum::ARTISTIC_DIRECTOR_ASSISTANT->value,
-            FunctionEnum::DIRECTOR->value, FunctionEnum::DIRECTOR_ASSISTANT->value
+            FunctionEnum::DIRECTOR->value, FunctionEnum::DIRECTOR_ASSISTANT->value,
         ];
 
         $dolibarrSyncService->method('countWithMission')->willReturnMap([