Skip to content

Commit

Permalink
More nit picks.
Browse files Browse the repository at this point in the history
Co-authored-by: Gina Peter Banyard <girgias@php.net>
  • Loading branch information
Crell and Girgias authored Nov 20, 2024
1 parent d10697d commit e97e8e9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
10 changes: 5 additions & 5 deletions language/oop5/abstract.xml
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ class C extends A
// This would NOT satisfy the requirement, as it is not publicly readable.
protected string $readable;
// This satisfies the requirement exactly, so is sufficient. It may only
// be written to, and only from protected scope.
// This satisfies the requirement exactly, so is sufficient.
// It may only be written to, and only from protected scope.
protected string $writeable {
set => $value;
}
Expand All @@ -173,7 +173,7 @@ class C extends A
</example>
<para>
An abstract property on an abstract class may provide implementations for any hook,
but must have either get or set declared but not defined (as in the example above).
but must have either <literal>get</literal> or <literal>set</literal> declared but not defined (as in the example above).
</para>
<example>
<title>Abstract property example</title>
Expand All @@ -182,8 +182,8 @@ class C extends A
<?php
abstract class A
{
// This provides a default (but overridable) set implementation, and requires
// child classes to provide a get implementation.
// This provides a default (but overridable) set implementation,
// and requires child classes to provide a get implementation.
abstract public string $foo {
get;
set { $this->foo = $value };
Expand Down
5 changes: 3 additions & 2 deletions language/oop5/property-hooks.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
Property hooks are incompatible with <literal>readonly</literal> properties.
If there is a need to restrict access to a <literal>get</literal> or <literal>set</literal>
operation in addition to altering its behavior, use
<link linkend="language.oop5.visibility-members-aviz">Asymmetric Property Visibility</link>.
<link linkend="language.oop5.visibility-members-aviz">asymmetric property visibility</link>.
</simpara>
<sect2>
<title>Basic Hook Syntax</title>
Expand Down Expand Up @@ -321,7 +321,8 @@ class Person {
<sect3>
<title>Final hooks</title>
<simpara>
Hooks may also be declared final, in which case they may not be overridden.
Hooks may also be declared <link linkend="language.oop5.final">final</link>,
in which case they may not be overridden.
</simpara>
<example>
<title>Final hooks</title>
Expand Down

0 comments on commit e97e8e9

Please sign in to comment.