Skip to content

Commit 2c50802

Browse files
committed
unit => singleton
1 parent 0704534 commit 2c50802

File tree

4 files changed

+18
-11
lines changed

4 files changed

+18
-11
lines changed

language/types.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ int(16)
131131
&language.types.void;
132132
&language.types.never;
133133
&language.types.relative-class-types;
134-
&language.types.unit;
134+
&language.types.singleton;
135135
&language.types.iterable;
136136
&language.types.declarations;
137137
&language.types.type-juggling;

language/types/declarations.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ Stack trace:
271271
<title>Union types</title>
272272
<warning>
273273
<simpara>
274-
It is not possible to combine the two unit types <type>false</type>
274+
It is not possible to combine the two singleton types <type>false</type>
275275
and <type>true</type> together in a union type.
276276
Use <type>bool</type> instead.
277277
</simpara>

language/types/unit.xml renamed to language/types/singleton.xml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<sect1 xml:id="language.types.unit">
3-
<title>Unit types</title>
2+
<sect1 xml:id="language.types.singleton">
3+
<title>Singleton types</title>
44

55
<para>
6-
Unit types are those which allow only one value.
7-
PHP has support for three unit types:
8-
<type>false</type> as of PHP 8.0.0, <type>true</type>
9-
as of PHP 8.2.0, and <type>null</type>.
6+
Singleton types are those which allow only one value.
7+
PHP has support for two singleton types:
8+
<type>false</type> as of PHP 8.0.0 and <type>true</type>
9+
as of PHP 8.2.0.
1010
</para>
1111

1212
<warning>
1313
<simpara>
14-
Prior to PHP 8.2.0 the <type>false</type> and <type>null</type> type
14+
Prior to PHP 8.2.0 the <type>false</type> type
1515
could only be used as part of a
1616
<link linkend="language.types.type-system.composite.union">union type</link>.
1717
</simpara>
1818
</warning>
1919

2020
<note>
2121
<simpara>
22-
It is not possible to define custom unit types. Consider using an
22+
It is not possible to define custom singleton types. Consider using an
2323
<link linkend="language.types.enumerations">enumerations</link> instead.
2424
</simpara>
2525
</note>

language/types/type-system.xml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
</listitem>
7070
<listitem>
7171
<simpara>
72-
<link linkend="language.types.unit">Unit types</link>
72+
<link linkend="language.types.singleton">Singleton types</link>
7373
</simpara>
7474
<itemizedlist>
7575
<listitem>
@@ -78,6 +78,13 @@
7878
<listitem>
7979
<simpara><type>true</type></simpara>
8080
</listitem>
81+
</itemizedlist>
82+
</listitem>
83+
<listitem>
84+
<simpara>
85+
Unit types
86+
</simpara>
87+
<itemizedlist>
8188
<listitem>
8289
<simpara><type>null</type></simpara>
8390
</listitem>

0 commit comments

Comments
 (0)