Clarify purpose of ReflectionParameter::getClass().

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@332198 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Justin Martin 2013-11-26 06:54:14 +00:00
parent 50315de7d3
commit 9f1bc3cef4

View file

@ -4,7 +4,7 @@
<refentry xml:id="reflectionparameter.getclass" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>ReflectionParameter::getClass</refname>
<refpurpose>Get class</refpurpose>
<refpurpose>Get the type hinted class</refpurpose>
</refnamediv>
<refsect1 role="description">
@ -14,7 +14,7 @@
<void />
</methodsynopsis>
<para>
Gets a class.
Gets the class type hinted for the parameter as a <classname>ReflectionClass</classname> object.
</para>
&warn.undocumented.func;
@ -32,6 +32,34 @@
A <classname>ReflectionClass</classname> object.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Using the <classname>ReflectionParameter</classname> class</title>
<programlisting role="php">
<![CDATA[
<?php
function foo(Exception $a) { }
$functionReflection = new ReflectionFunction('foo');
$parameters = $functionReflection->getParameters();
$aParameter = $parameters[0];
echo $aParameter->getClass()->name;
?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
Exception
]]>
</screen>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;