clarify trait use as

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@339838 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Karoly Negyesi 2016-08-10 09:42:52 +00:00
parent 6937b29491
commit 31e3e09380

View file

@ -20,7 +20,7 @@
composition of behavior; that is, the application of class members without
requiring inheritance.
</para>
<example xml:id="language.oop5.traits.basicexample">
<title>Trait example</title>
<programlisting role="php">
@ -44,7 +44,7 @@ class ezcReflectionFunction extends ReflectionFunction {
]]>
</programlisting>
</example>
<sect2 xml:id="language.oop5.traits.precedence">
<title>Precedence</title>
<para>
@ -124,7 +124,7 @@ Hello Universe!
</screen>
</example>
</sect2>
<sect2 xml:id="language.oop5.traits.multiple">
<title>Multiple Traits</title>
<para>
@ -170,7 +170,7 @@ Hello World!
</screen>
</example>
</sect2>
<sect2 xml:id="language.oop5.traits.conflict">
<title>Conflict Resolution</title>
<para>
@ -184,8 +184,9 @@ Hello World!
</para>
<para>
Since this only allows one to exclude methods, the <literal>as</literal>
operator can be used to allow the inclusion of one of the conflicting
methods under another name.
operator can be used to add an alias to one of the methods. Note the
<literal>as</literal> operator does not rename the method and it does not
affect any other method either.
</para>
<example xml:id="language.oop5.traits.conflict.ex1">
<title>Conflict Resolution</title>
@ -199,7 +200,7 @@ Hello World!
The Aliased_Talker makes use of the <literal>as</literal> operator
to be able to use B's bigTalk implementation under an additional alias
<literal>talk</literal>.
</para>
</para>
<programlisting role="php">
<![CDATA[
<?php
@ -240,7 +241,7 @@ class Aliased_Talker {
</programlisting>
</example>
</sect2>
<sect2 xml:id="language.oop5.traits.visibility">
<title>Changing Method Visibility</title>
<para>
@ -273,7 +274,7 @@ class MyClass2 {
</programlisting>
</example>
</sect2>
<sect2 xml:id="language.oop5.traits.composition">
<title>Traits Composed from Traits</title>
<para>
@ -320,7 +321,7 @@ Hello World!
</screen>
</example>
</sect2>
<sect2 xml:id="language.oop5.traits.abstract">
<title>Abstract Trait Members</title>
<para>
@ -354,7 +355,7 @@ class MyHelloWorld {
</programlisting>
</example>
</sect2>
<sect2 xml:id="language.oop5.traits.static">
<title>Static Trait Members</title>
<para>
@ -408,7 +409,7 @@ Example::doSomething();
</programlisting>
</example>
</sect2>
<sect2 xml:id="language.oop5.traits.properties">
<title>Properties</title>
<para>
@ -461,7 +462,7 @@ class PropertiesExample {
</sect2>
</sect1>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml