From 824a96e26a4fc43112fbc8272b83156e2c76c758 Mon Sep 17 00:00:00 2001 From: Pierre Ambroise Date: Tue, 28 Jan 2025 20:47:59 +0000 Subject: [PATCH] Sync property hooks with EN --- language/oop5/property-hooks.xml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/language/oop5/property-hooks.xml b/language/oop5/property-hooks.xml index a6cc0e3982..490eb56162 100644 --- a/language/oop5/property-hooks.xml +++ b/language/oop5/property-hooks.xml @@ -1,5 +1,5 @@ - + Hooks de propriété @@ -499,7 +499,10 @@ class PositivePoint extends Point Les hooks ne peuvent pas accéder à un autre hook que leur propre parent sur leur propre propriété. - L'exemple ci-dessus pourrait être réécrit de manière plus efficace comme suit. + L'exemple ci-dessus pourrait être réécrit comme suit, ce qui permettrait à la + classe Point d'ajouter son propre hook set + à l'avenir sans problème. (Dans l'exemple précédent, un hook ajouté à la + classe parente serait ignoré dans la classe enfant.) Accès aux hooks parentaux (set) @@ -519,7 +522,7 @@ class PositivePoint extends Point if ($value < 0) { throw new \InvalidArgumentException('Too small'); } - $this->x = $value; + parent::$x::set($value); } } }