From 8db44cdd53142b29b059bf4ead66a3acedf6231b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Munsch?= Date: Wed, 26 Aug 2026 10:20:49 +0200 Subject: [PATCH] chore: pint pass --- lang/fr/validation.php | 16 +++---- .../EloquentCustomerDirectoryTest.php | 5 --- .../EloquentEmployeeDirectoryTest.php | 43 ++++++++++--------- 3 files changed, 31 insertions(+), 33 deletions(-) diff --git a/lang/fr/validation.php b/lang/fr/validation.php index 276dd397..6f29e67e 100644 --- a/lang/fr/validation.php +++ b/lang/fr/validation.php @@ -20,7 +20,7 @@ return [ 'array' => 'Le tableau :attribute doit contenir entre :min et :max éléments.', 'file' => 'La taille du fichier de :attribute doit être comprise entre :min et :max kilo-octets.', 'numeric' => 'La valeur de :attribute doit être comprise entre :min et :max.', - 'string' => 'Le champ :attribute doit contenir entre :min et :max caractères.', + 'string' => 'Le texte :attribute doit contenir entre :min et :max caractères.', ], 'boolean' => 'Le champ :attribute doit être vrai ou faux.', 'can' => 'Le champ :attribute contient une valeur non autorisée.', @@ -53,13 +53,13 @@ return [ 'array' => 'Le tableau :attribute doit contenir plus de :value éléments.', 'file' => 'La taille du fichier de :attribute doit être supérieure à :value kilo-octets.', 'numeric' => 'La valeur de :attribute doit être supérieure à :value.', - 'string' => 'Le champ :attribute doit contenir plus de :value caractères.', + 'string' => 'Le texte :attribute doit contenir plus de :value caractères.', ], 'gte' => [ 'array' => 'Le tableau :attribute doit contenir au moins :value éléments.', 'file' => 'La taille du fichier de :attribute doit être supérieure ou égale à :value kilo-octets.', 'numeric' => 'La valeur de :attribute doit être supérieure ou égale à :value.', - 'string' => 'Le champ :attribute doit contenir au moins :value caractères.', + 'string' => 'Le texte :attribute doit contenir au moins :value caractères.', ], 'hex_color' => 'Le champ :attribute doit être une couleur hexadécimale valide.', 'image' => 'Le champ :attribute doit être une image.', @@ -78,13 +78,13 @@ return [ 'array' => 'Le tableau :attribute doit contenir moins de :value éléments.', 'file' => 'La taille du fichier de :attribute doit être inférieure à :value kilo-octets.', 'numeric' => 'La valeur de :attribute doit être inférieure à :value.', - 'string' => 'Le champ :attribute doit contenir moins de :value caractères.', + 'string' => 'Le texte :attribute doit contenir moins de :value caractères.', ], 'lte' => [ 'array' => 'Le tableau :attribute doit contenir au plus :value éléments.', 'file' => 'La taille du fichier de :attribute doit être inférieure ou égale à :value kilo-octets.', 'numeric' => 'La valeur de :attribute doit être inférieure ou égale à :value.', - 'string' => 'Le champ :attribute doit contenir au plus :value caractères.', + 'string' => 'Le texte :attribute doit contenir au plus :value caractères.', ], 'mac_address' => 'Le champ :attribute doit être une adresse MAC valide.', 'matricule' => 'Le champ :attribute doit être un matricule valide', @@ -92,7 +92,7 @@ return [ 'array' => 'Le tableau :attribute ne peut pas contenir plus que :max éléments.', 'file' => 'La taille du fichier de :attribute ne peut pas dépasser :max kilo-octets.', 'numeric' => 'La valeur de :attribute ne peut pas être supérieure à :max.', - 'string' => 'Le champ de :attribute ne peut pas contenir plus de :max caractères.', + 'string' => 'Le texte de :attribute ne peut pas contenir plus de :max caractères.', ], 'max_digits' => 'Le champ :attribute ne doit pas avoir plus de :max chiffres.', 'mimes' => 'Le champ :attribute doit être un fichier de type : :values.', @@ -101,7 +101,7 @@ return [ 'array' => 'Le tableau :attribute doit contenir au moins :min éléments.', 'file' => 'La taille du fichier de :attribute doit être supérieure ou égale à :min kilo-octets.', 'numeric' => 'La valeur de :attribute doit être supérieure ou égale à :min.', - 'string' => 'Le champ de :attribute doit contenir au moins :min caractères.', + 'string' => 'Le texte de :attribute doit contenir au moins :min caractères.', ], 'min_digits' => 'Le champ :attribute doit avoir au moins :min chiffres.', 'missing' => 'Le champ :attribute doit être manquant.', @@ -149,7 +149,7 @@ return [ 'array' => 'Le tableau :attribute doit contenir :size éléments.', 'file' => 'La taille du fichier de :attribute doit être de :size kilo-octets.', 'numeric' => 'La valeur de :attribute doit être :size.', - 'string' => 'Le champ de :attribute doit contenir :size caractères.', + 'string' => 'Le texte de :attribute doit contenir :size caractères.', ], 'starts_with' => 'Le champ :attribute doit commencer avec une des valeurs suivantes : :values', 'string' => 'Le champ :attribute doit être une chaîne de caractères.', diff --git a/tests/Integration/WithApp/Directories/EloquentCustomerDirectoryTest.php b/tests/Integration/WithApp/Directories/EloquentCustomerDirectoryTest.php index c6822e28..dc9a7790 100644 --- a/tests/Integration/WithApp/Directories/EloquentCustomerDirectoryTest.php +++ b/tests/Integration/WithApp/Directories/EloquentCustomerDirectoryTest.php @@ -4,11 +4,7 @@ declare(strict_types=1); use App\Directories\EloquentCustomerDirectory; use App\Models\Customer; -use App\Models\Employee; -use Carbon\CarbonImmutable; -use Domain\Models\ValueObjects\Code; use Domain\Models\ValueObjects\Email; -use Domain\Models\ValueObjects\Matricule; use Ramsey\Uuid\Uuid; describe('EloquentCustomerDirectory', function () { @@ -40,7 +36,6 @@ describe('EloquentCustomerDirectory', function () { expect($result)->toBeNull(); }); - it('gets a customer by email', function () { // GIVEN $directory = new EloquentCustomerDirectory(); diff --git a/tests/Integration/WithApp/Directories/EloquentEmployeeDirectoryTest.php b/tests/Integration/WithApp/Directories/EloquentEmployeeDirectoryTest.php index c24175f3..933e3659 100644 --- a/tests/Integration/WithApp/Directories/EloquentEmployeeDirectoryTest.php +++ b/tests/Integration/WithApp/Directories/EloquentEmployeeDirectoryTest.php @@ -3,10 +3,13 @@ declare(strict_types=1); use App\Directories\EloquentEmployeeDirectory; +use App\Models\Customer; use App\Models\Employee; use Carbon\CarbonImmutable; use Domain\Models\ValueObjects\Code; +use Domain\Models\ValueObjects\Email; use Domain\Models\ValueObjects\Matricule; +use Ramsey\Uuid\Uuid; describe('EloquentEmployeeDirectory', function () { it('finds an employee by id', function () { @@ -89,10 +92,10 @@ describe('EloquentEmployeeDirectory', function () { // GIVEN $directory = new EloquentEmployeeDirectory(); - $customer1 = \App\Models\Customer::forceCreate([ - 'id' => \Ramsey\Uuid\Uuid::uuid7()->toString(), - 'hashcode' => \Ramsey\Uuid\Uuid::uuid4()->toString(), - 'email' => new \Domain\Models\ValueObjects\Email('test1_emp@example.com'), + $customer1 = Customer::forceCreate([ + 'id' => Uuid::uuid7()->toString(), + 'hashcode' => Uuid::uuid4()->toString(), + 'email' => new Email('test1_emp@example.com'), 'created_at' => CarbonImmutable::now()->subDays(5), ]); Employee::forceCreate([ @@ -109,10 +112,10 @@ describe('EloquentEmployeeDirectory', function () { 'updated_at' => CarbonImmutable::now()->subDays(5), ]); - $customer2 = \App\Models\Customer::forceCreate([ - 'id' => \Ramsey\Uuid\Uuid::uuid7()->toString(), - 'hashcode' => \Ramsey\Uuid\Uuid::uuid4()->toString(), - 'email' => new \Domain\Models\ValueObjects\Email('test2_emp@example.com'), + $customer2 = Customer::forceCreate([ + 'id' => Uuid::uuid7()->toString(), + 'hashcode' => Uuid::uuid4()->toString(), + 'email' => new Email('test2_emp@example.com'), 'created_at' => CarbonImmutable::now()->subDays(15), ]); Employee::forceCreate([ @@ -130,10 +133,10 @@ describe('EloquentEmployeeDirectory', function () { ]); // Customer without employee - \App\Models\Customer::forceCreate([ - 'id' => \Ramsey\Uuid\Uuid::uuid7()->toString(), - 'hashcode' => \Ramsey\Uuid\Uuid::uuid4()->toString(), - 'email' => new \Domain\Models\ValueObjects\Email('test3_emp@example.com'), + Customer::forceCreate([ + 'id' => Uuid::uuid7()->toString(), + 'hashcode' => Uuid::uuid4()->toString(), + 'email' => new Email('test3_emp@example.com'), 'created_at' => CarbonImmutable::now()->subDays(5), ]); @@ -150,10 +153,10 @@ describe('EloquentEmployeeDirectory', function () { // GIVEN $directory = new EloquentEmployeeDirectory(); - $customer1 = \App\Models\Customer::forceCreate([ - 'id' => \Ramsey\Uuid\Uuid::uuid7()->toString(), - 'hashcode' => \Ramsey\Uuid\Uuid::uuid4()->toString(), - 'email' => new \Domain\Models\ValueObjects\Email('test1t_emp@example.com'), + $customer1 = Customer::forceCreate([ + 'id' => Uuid::uuid7()->toString(), + 'hashcode' => Uuid::uuid4()->toString(), + 'email' => new Email('test1t_emp@example.com'), ]); Employee::forceCreate([ 'id' => 105, @@ -169,10 +172,10 @@ describe('EloquentEmployeeDirectory', function () { 'updated_at' => CarbonImmutable::now(), ]); - $customer2 = \App\Models\Customer::forceCreate([ - 'id' => \Ramsey\Uuid\Uuid::uuid7()->toString(), - 'hashcode' => \Ramsey\Uuid\Uuid::uuid4()->toString(), - 'email' => new \Domain\Models\ValueObjects\Email('test2t_emp@example.com'), + $customer2 = Customer::forceCreate([ + 'id' => Uuid::uuid7()->toString(), + 'hashcode' => Uuid::uuid4()->toString(), + 'email' => new Email('test2t_emp@example.com'), ]); // no employee for customer2