chore: pint pass

This commit is contained in:
Jérémy Munsch 2026-08-26 10:20:49 +02:00
parent 1da093ebd2
commit 8db44cdd53
No known key found for this signature in database
GPG key ID: 2AAECDA6B7330F91
3 changed files with 31 additions and 33 deletions

View file

@ -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.',

View file

@ -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();

View file

@ -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