From 63365247e23c206bc9eea63a224447543f1ec9b5 Mon Sep 17 00:00:00 2001 From: polo Date: Mon, 12 Oct 2026 21:42:42 +0200 Subject: =?UTF-8?q?pr=C3=A9paration=20date=20bulletin=20de=20paie=20des=20?= =?UTF-8?q?CESU,=20relecture?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/model/entities/Location.php | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'src/model/entities/Location.php') diff --git a/src/model/entities/Location.php b/src/model/entities/Location.php index b3c2f8a..66c3385 100644 --- a/src/model/entities/Location.php +++ b/src/model/entities/Location.php @@ -41,12 +41,8 @@ class Location public static EntityManager $entityManager; - public function __construct(Prestation $presta = null) - { - if($presta != null) - { - $this->setPresta($presta); - } + public function __construct(?Prestation $presta = null){ + $this->setPresta($presta); } // getters @@ -191,17 +187,16 @@ class Location return str_replace($search, '', $data); } // à mettre plus tard dans une classe mère - public function hydrate(string $answers) + public function hydrate(string $answers): void { $answers = $this->cleanSpecialChars($answers); // possibilité que $answers devienne une chaine vide if($answers == '') { echo "erreur de Location::hydrate(), la chaine \$answers est vide.\n"; - return false; + return; } $data_array = explode('|', $answers); // array - $check = false; if(count($data_array) === 8) { $this->getPresta()->setModePaiement(''); // sécurité, doctrine plante si "null" @@ -210,7 +205,7 @@ class Location else { echo "erreur de Location::hydrate(), le tableau \$data_array n'a pas la taille attendue.\n"; - return false; + return; } //self::$entityManager->persist('Prestation'); -- cgit v1.2.3