Skip to content

Commit dff848b

Browse files
Fix grammar in oop5 (#5728)
1 parent 631587d commit dff848b

19 files changed

Lines changed: 74 additions & 75 deletions

language/oop5/anonymous.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,11 @@ same class
153153
</informalexample>
154154

155155
<note>
156-
<para>
156+
<simpara>
157157
Note that anonymous classes are assigned a name by the engine, as
158-
demonstrated in the following example. This name has to be regarded an
158+
demonstrated in the following example. This name has to be regarded as an
159159
implementation detail, which should not be relied upon.
160-
</para>
160+
</simpara>
161161
<informalexample>
162162
<programlisting role="php">
163163
<![CDATA[

language/oop5/autoload.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,24 @@
88
annoyances is having to write a long list of needed includes
99
at the beginning of each script (one for each class).
1010
</para>
11-
<para>
11+
<simpara>
1212
The <function>spl_autoload_register</function> function registers any number of
13-
autoloaders, enabling for classes and interfaces to be automatically loaded
13+
autoloaders, enabling classes and interfaces to be automatically loaded
1414
if they are currently not defined. By registering autoloaders, PHP is given
1515
a last chance to load the class or interface before it fails with an error.
16-
</para>
16+
</simpara>
1717
<para>
1818
Any class-like construct may be autoloaded the same way. That includes classes,
1919
interfaces, traits, and enumerations.
2020
</para>
2121
<caution>
22-
<para>
22+
<simpara>
2323
Prior to PHP 8.0.0, it was possible to use <function>__autoload</function>
2424
to autoload classes and interfaces. However, it is a less flexible
2525
alternative to <function>spl_autoload_register</function> and
2626
<function>__autoload</function> is deprecated as of PHP 7.2.0, and removed
2727
as of PHP 8.0.0.
28-
</para>
28+
</simpara>
2929
</caution>
3030
<note>
3131
<para>

language/oop5/changelog.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
<row>
4444
<entry>7.4.0</entry>
4545
<entry>
46-
Changed: It is now possible to throw exception within
46+
Changed: It is now possible to throw an exception within
4747
<function>__toString</function>.
4848
</entry>
4949
</row>
@@ -299,7 +299,7 @@
299299
<function>echo</function> or <function>print</function>.
300300
But now, it is called in any &string; context (e.g. in
301301
<function>printf</function> with <literal>%s</literal> modifier) but not
302-
in other types contexts (e.g. with <literal>%d</literal> modifier).
302+
in other type contexts (e.g. with <literal>%d</literal> modifier).
303303
As of PHP 5.2.0, converting &object;s without a
304304
<link linkend="object.tostring">__toString</link> method to &string;
305305
emits a <constant>E_RECOVERABLE_ERROR</constant> level error.

language/oop5/cloning.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@
33
<sect1 xml:id="language.oop5.cloning" xmlns="http://docbook.org/ns/docbook">
44
<title>Object Cloning</title>
55

6-
<para>
6+
<simpara>
77
Creating a copy of an object with fully replicated properties is not
88
always the wanted behavior. A good example of the need for copy
9-
constructors, is if you have an object which represents a GTK window and the
9+
constructors is if you have an object which represents a GTK window and the
1010
object holds the resource of this GTK window, when you create a duplicate
1111
you might want to create a new window with the same properties and have the
1212
new object hold the resource of the new window. Another example is if your
1313
object holds a reference to another object which it uses and when you
1414
replicate the parent object you want to create a new instance of this other
1515
object so that the replica has its own separate copy.
16-
</para>
16+
</simpara>
1717

1818
<para>
1919
An object copy is created by using the <literal>clone</literal> keyword
@@ -40,11 +40,11 @@ $copy_of_object = clone $object;
4040
<void/>
4141
</methodsynopsis>
4242

43-
<para>
43+
<simpara>
4444
Once the cloning is complete, if a <link linkend="object.clone">__clone()</link> method is defined, then
4545
the newly created object's <link linkend="object.clone">__clone()</link> method will be called, to allow any
46-
necessary properties that need to be changed.
47-
</para>
46+
necessary properties to be changed.
47+
</simpara>
4848

4949
<example>
5050
<title>Cloning an object</title>

language/oop5/constants.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
<!-- $Revision$ -->
33
<sect1 xml:id="language.oop5.constants" xmlns="http://docbook.org/ns/docbook">
44
<title>Class Constants</title>
5-
<para>
5+
<simpara>
66
It is possible to define <link linkend="language.constants">constants</link>
7-
on a per-class basis remaining the same and unchangeable.
7+
on a per-class basis.
88
The default visibility of class constants is <literal>public</literal>.
9-
</para>
9+
</simpara>
1010
<note>
1111
<para>
1212
Class constants can be redefined by a child class.

language/oop5/decon.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,11 @@ class Point {
156156
</para>
157157
</note>
158158
<note>
159-
<para>
160-
Object properties may not be typed <type>callable</type> due to engine ambiguity that would
159+
<simpara>
160+
Object properties may not be typed <type>callable</type> due to engine ambiguity that this would
161161
introduce. Promoted arguments, therefore, may not be typed <type>callable</type> either. Any
162162
other <link linkend="language.types.declarations">type declaration</link> is permitted, however.
163-
</para>
163+
</simpara>
164164
</note>
165165
<note>
166166
<para>
@@ -352,7 +352,7 @@ $obj = new MyDestructableClass();
352352
a second time when the reference count reaches zero again or during the
353353
shutdown sequence.
354354
</para>
355-
<para>
355+
<simpara>
356356
As of PHP 8.4.0, when
357357
<link linkend="features.gc.collecting-cycles">cycle collection</link>
358358
occurs during the execution of a
@@ -364,9 +364,9 @@ $obj = new MyDestructableClass();
364364
The previous <literal>gc_destructor_fiber</literal> will no longer be
365365
referenced by the garbage collector and may be collected if it is not
366366
referenced elsewhere.
367-
Objects whose destructor are suspended will not be collected until the
367+
Objects whose destructor is suspended will not be collected until the
368368
destructor returns or the Fiber itself is collected.
369-
</para>
369+
</simpara>
370370
<note>
371371
<para>
372372
Destructors called during the script shutdown have HTTP headers already

language/oop5/inheritance.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,16 @@
2626
restriction that is enforced is <literal>private final</literal> constructors, as that
2727
is a common way to "disable" the constructor when using static factory methods instead.
2828
</para>
29-
<para>
29+
<simpara>
3030
The <link linkend="language.oop5.visibility">visibility</link>
3131
of methods, properties and constants can be relaxed, e.g. a
3232
<literal>protected</literal> method can be marked as
3333
<literal>public</literal>, but they cannot be restricted, e.g.
3434
marking a <literal>public</literal> property as <literal>private</literal>.
35-
An exception are constructors, whose visibility can be restricted, e.g.
35+
One exception is constructors, whose visibility can be restricted, e.g.
3636
a <literal>public</literal> constructor can be marked as <literal>private</literal>
3737
in a child class.
38-
</para>
38+
</simpara>
3939

4040
<note>
4141
<para>

language/oop5/interfaces.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
To allow a function or method to accept and operate on a parameter that conforms to an
3232
interface, while not caring what else the object may do or how it is implemented. These interfaces
3333
are often named like <literal>Iterable</literal>, <literal>Cacheable</literal>, <literal>Renderable</literal>,
34-
or so on to describe the significance of the behavior.
34+
and so on to describe the significance of the behavior.
3535
</member>
3636
</simplelist>
3737
<para>

language/oop5/iterations.xml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,12 @@
22
<!-- $Revision$ -->
33
<sect1 xml:id="language.oop5.iterations" xmlns="http://docbook.org/ns/docbook">
44
<title>Object Iteration</title>
5-
<para>
6-
5+
<simpara>
76
PHP provides a way for objects to be defined so it is possible to iterate
8-
through a list of items, with, for example a &foreach; statement. By default,
7+
through a list of items with, for example, a &foreach; statement. By default,
98
all <link linkend="language.oop5.visibility">visible</link> properties will be used
109
for the iteration.
11-
12-
</para>
10+
</simpara>
1311

1412
<example>
1513
<title>Simple Object Iteration</title>

language/oop5/late-static-bindings.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
<!-- $Revision$ -->
33
<sect1 xml:id="language.oop5.late-static-bindings" xmlns="http://docbook.org/ns/docbook">
44
<title>Late Static Bindings</title>
5-
<para>
5+
<simpara>
66
PHP implements a feature called late static bindings which
7-
can be used to reference the called class in a context of static inheritance.
8-
</para>
7+
can be used to reference the called class in the context of static inheritance.
8+
</simpara>
99

1010
<para>
1111
More precisely, late static bindings work by storing the class named in the

0 commit comments

Comments
 (0)