reference/reflection/reflectionparameter/getclass.xml
ec2fe9a592f794978114ef5021db9f1d00c2e05d
...
...
@@ -1,20 +1,28 @@
1
1
<?xml version="1.0" encoding="utf-8"?>
2
2
<!-- $Revision$ -->
3
-

4
3
<refentry xml:id="reflectionparameter.getclass" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
5
4
<refnamediv>
6
5
<refname>ReflectionParameter::getClass</refname>
7
-
<refpurpose>Get the type hinted class</refpurpose>
6
+
<refpurpose>Get a <classname>ReflectionClass</classname> object for the parameter being reflected or &null;</refpurpose>
8
7
</refnamediv>
9
8

9
+
<refsynopsisdiv>
10
+
&warn.deprecated.function-8-0-0;
11
+
</refsynopsisdiv>
12
+

10
13
<refsect1 role="description">
11
14
&reftitle.description;
12
-
<methodsynopsis>
13
-
<modifier>public</modifier> <type>ReflectionClass</type><methodname>ReflectionParameter::getClass</methodname>
14
-
<void />
15
+
<methodsynopsis role="ReflectionParameter">
16
+
<modifier>public</modifier> <type class="union"><type>ReflectionClass</type><type>null</type></type><methodname>ReflectionParameter::getClass</methodname>
17
+
<void/>
15
18
</methodsynopsis>
16
19
<para>
17
-
Gets the class type hinted for the parameter as a <classname>ReflectionClass</classname> object.
20
+
Gets a <classname>ReflectionClass</classname> object for the parameter being reflected or &null;.
21
+
</para>
22
+
<para>
23
+
As of PHP 8.0.0 this function is deprecated and not recommended. Instead, use
24
+
<methodname>ReflectionParameter::getType</methodname> to get the <classname>ReflectionType</classname>
25
+
of the parameter, then interrogate that object to determine the parameter type.
18
26
</para>
19
27

20
28
&warn.undocumented.func;
...
...
@@ -29,7 +37,8 @@
29
37
<refsect1 role="returnvalues">
30
38
&reftitle.returnvalues;
31
39
<para>
32
-
A <classname>ReflectionClass</classname> object.
40
+
A <classname>ReflectionClass</classname> object, or &null; if no type is declared,
41
+
or the declared type is not a class or interface.
33
42
</para>
34
43
</refsect1>
35
44

...
...
@@ -51,12 +60,6 @@ echo $aParameter->getClass()->name;
51
60
?>
52
61
]]>
53
62
</programlisting>
54
-
&example.outputs;
55
-
<screen>
56
-
<![CDATA[
57
-
Exception
58
-
]]>
59
-
</screen>
60
63
</example>
61
64
</para>
62
65
</refsect1>
...
...
@@ -71,7 +74,6 @@ Exception
71
74
</refsect1>
72
75

73
76
</refentry>
74
-

75
77
<!-- Keep this comment at the end of the file
76
78
Local variables:
77
79
mode: sgml
78
80