reference/reflection/reflectionparameter/getclass.xml
9b1673cf114a1e10c4563ab9223cb56aed552b89
9b1673cf114a1e10c4563ab9223cb56aed552b89
...
...
@@ -1,20 +1,29 @@
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 role="attribute">#[\Deprecated]</modifier>
17
+
<modifier>public</modifier> <type class="union"><type>ReflectionClass</type><type>null</type></type><methodname>ReflectionParameter::getClass</methodname>
18
+
<void/>
15
19
</methodsynopsis>
16
20
<para>
17
-
Gets the class type hinted for the parameter as a <classname>ReflectionClass</classname> object.
21
+
Gets a <classname>ReflectionClass</classname> object for the parameter being reflected or &null;.
22
+
</para>
23
+
<para>
24
+
As of PHP 8.0.0 this function is deprecated and not recommended. Instead, use
25
+
<methodname>ReflectionParameter::getType</methodname> to get the <classname>ReflectionType</classname>
26
+
of the parameter, then interrogate that object to determine the parameter type.
18
27
</para>
19
28
20
29
&warn.undocumented.func;
...
...
@@ -29,7 +38,8 @@
29
38
<refsect1 role="returnvalues">
30
39
&reftitle.returnvalues;
31
40
<para>
32
-
A <classname>ReflectionClass</classname> object.
41
+
A <classname>ReflectionClass</classname> object, or &null; if no type is declared,
42
+
or the declared type is not a class or interface.
33
43
</para>
34
44
</refsect1>
35
45
...
...
@@ -51,16 +61,33 @@ echo $aParameter->getClass()->name;
51
61
?>
52
62
]]>
53
63
</programlisting>
54
-
&example.outputs;
55
-
<screen>
56
-
<![CDATA[
57
-
Exception
58
-
]]>
59
-
</screen>
60
64
</example>
61
65
</para>
62
66
</refsect1>
63
67
68
+
<refsect1 role="changelog">
69
+
&reftitle.changelog;
70
+
<informaltable>
71
+
<tgroup cols="2">
72
+
<thead>
73
+
<row>
74
+
<entry>&Version;</entry>
75
+
<entry>&Description;</entry>
76
+
</row>
77
+
</thead>
78
+
<tbody>
79
+
<row>
80
+
<entry>8.0.0</entry>
81
+
<entry>
82
+
This function has been deprecated in favor of
83
+
<methodname>ReflectionParameter::getType</methodname> instead.
84
+
</entry>
85
+
</row>
86
+
</tbody>
87
+
</tgroup>
88
+
</informaltable>
89
+
</refsect1>
90
+
64
91
<refsect1 role="seealso">
65
92
&reftitle.seealso;
66
93
<para>
...
...
@@ -71,7 +98,6 @@ Exception
71
98
</refsect1>
72
99
73
100
</refentry>
74
-
75
101
<!-- Keep this comment at the end of the file
76
102
Local variables:
77
103
mode: sgml
78
104