Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync property hooks with EN #2021

Merged
merged 1 commit into from
Jan 28, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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