tweaked example code comments, [method|interface] links.

This commit is contained in:
Yoshinari Takaoka 2021-10-31 14:53:32 +09:00
parent 7ad83bb05b
commit 90f5f73e9b
No known key found for this signature in database
GPG key ID: 66AFA0246DF21547

View file

@ -299,7 +299,7 @@ function paint(Colorful $c) { ... }
paint(Suit::Clubs); // Works
print Suit::Diamonds->shape(); // prints "rectangle"
print Suit::Diamonds->shape(); // prints "Rectangle"
?>
]]>
</programlisting>
@ -612,7 +612,7 @@ $x = Direction::Up['short'];
<para>
Additionally, enum cases may not be instantiated directly with <literal>new</literal>, nor with
<literal>newInstanceWithoutConstructor</literal> in reflection. Both will result in an error.
<methodname>ReflectionClass::newInstanceWithoutConstructor</methodname> in reflection. Both will result in an error.
</para>
<programlisting role="php">
@ -632,7 +632,7 @@ $horseshoes = (new ReflectionClass(Suit::class))->newInstanceWithoutConstructor(
<para>
Both Pure Enums and Backed Enums implement an internal interface named
<literal>UnitEnum</literal>. <literal>UnitEnum</literal> includes a static method
<interfacename>UnitEnum</interfacename>. <literal>UnitEnum</literal> includes a static method
<literal>cases()</literal>. <literal>cases()</literal> returns a packed array of
all defined Cases in the order of declaration.
</para>