Olivier Massot 1 år sedan
förälder
incheckning
023f5ac90c

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

@@ -32,12 +32,6 @@ use libphonenumber\PhoneNumberFormat;
 use libphonenumber\PhoneNumberUtil;
 use Psr\Log\LoggerInterface;
 use Symfony\Component\HttpKernel\Exception\HttpException;
-use Symfony\Contracts\HttpClient\Exception\ClientExceptionInterface;
-use Symfony\Contracts\HttpClient\Exception\DecodingExceptionInterface;
-use Symfony\Contracts\HttpClient\Exception\RedirectionExceptionInterface;
-use Symfony\Contracts\HttpClient\Exception\ServerExceptionInterface;
-use Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface;
-use Symfony\Contracts\HttpClient\ResponseInterface;
 use Symfony\Contracts\Service\Attribute\Required;
 use Symfony\Contracts\Translation\TranslatorInterface;
 
@@ -329,9 +323,9 @@ class DolibarrSyncService
             // Update Billing service contact (if existing)
             foreach ($dolibarrSocietyContacts as $contactData) {
                 if (
-                    strtolower($contactData['lastname']) === 'service facturation' &&
-                    empty($contactData['name']) &&
-                    empty($contactData['array_options']['options_2iopen_person_id'])
+                    'service facturation' === strtolower($contactData['lastname'])
+                    && empty($contactData['name'])
+                    && empty($contactData['array_options']['options_2iopen_person_id'])
                 ) {
                     $billingAddress = $this->getOrganizationBillingPostalAddress($organization);
                     $newContactData = $contactData;

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

@@ -40,7 +40,6 @@ use libphonenumber\PhoneNumberUtil;
 use PHPUnit\Framework\MockObject\MockObject;
 use PHPUnit\Framework\TestCase;
 use Psr\Log\LoggerInterface;
-use Symfony\Component\HttpClient\Exception\ServerException;
 use Symfony\Contracts\HttpClient\ResponseInterface;
 use Symfony\Contracts\Translation\TranslatorInterface;