Skip to content

Commit

Permalink
Sync property hooks with EN
Browse files Browse the repository at this point in the history
  • Loading branch information
Fan2Shrek committed Jan 28, 2025
1 parent aa63937 commit 824a96e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions language/oop5/property-hooks.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 38ee859fa546db84a0a439420941a94ae49351fb Maintainer: Fan2Shrek Status: ready -->
<!-- EN-Revision: 8c80c20688aa99cbd919f45595d4c689ff2337b9 Maintainer: Fan2Shrek Status: ready -->
<!-- Reviewed: yes -->
<sect1 xml:id="language.oop5.property-hooks" xmlns="http://docbook.org/ns/docbook">
<title>Hooks de propriété</title>
Expand Down Expand Up @@ -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é.
</simpara>
<simpara>
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 <literal>Point</literal> d'ajouter son propre hook <literal>set</literal>
à l'avenir sans problème. (Dans l'exemple précédent, un hook ajouté à la
classe parente serait ignoré dans la classe enfant.)
</simpara>
<example>
<title>Accès aux hooks parentaux (set)</title>
Expand All @@ -519,7 +522,7 @@ class PositivePoint extends Point
if ($value < 0) {
throw new \InvalidArgumentException('Too small');
}
$this->x = $value;
parent::$x::set($value);
}
}
}
Expand Down

0 comments on commit 824a96e

Please sign in to comment.