reference/reflection/reflectionproperty/construct.xml
c1aba02c4753e56b4ab5053a0ab5be8584cbf8bc
...
...
@@ -1,6 +1,5 @@
1
1
<?xml version="1.0" encoding="utf-8"?>
2
2
<!-- $Revision$ -->
3
-

4
3
<refentry xml:id="reflectionproperty.construct" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
5
4
<refnamediv>
6
5
<refname>ReflectionProperty::__construct</refname>
...
...
@@ -9,17 +8,11 @@
9
8

10
9
<refsect1 role="description">
11
10
&reftitle.description;
12
-
<methodsynopsis>
11
+
<constructorsynopsis role="ReflectionProperty">
13
12
<modifier>public</modifier> <methodname>ReflectionProperty::__construct</methodname>
14
-
<methodparam><type>mixed</type><parameter>class</parameter></methodparam>
15
-
<methodparam><type>string</type><parameter>name</parameter></methodparam>
16
-
</methodsynopsis>
17
-
<para>
18
-
19
-
</para>
20
-

21
-
&warn.undocumented.func;
22
-

13
+
<methodparam><type class="union"><type>object</type><type>string</type></type><parameter>class</parameter></methodparam>
14
+
<methodparam><type>string</type><parameter>property</parameter></methodparam>
15
+
</constructorsynopsis>
23
16
</refsect1>
24
17

25
18
<refsect1 role="parameters">
...
...
@@ -30,12 +23,12 @@
30
23
<term><parameter>class</parameter></term>
31
24
<listitem>
32
25
<para>
33
-
The class name, that contains the property.
26
+
Either a string containing the name of the class to reflect, or an object.
34
27
</para>
35
28
</listitem>
36
29
</varlistentry>
37
30
<varlistentry>
38
-
<term><parameter>name</parameter></term>
31
+
<term><parameter>property</parameter></term>
39
32
<listitem>
40
33
<para>
41
34
The name of the property being reflected.
...
...
@@ -46,13 +39,6 @@
46
39
</para>
47
40
</refsect1>
48
41

49
-
<refsect1 role="returnvalues">
50
-
&reftitle.returnvalues;
51
-
<para>
52
-
&return.void;
53
-
</para>
54
-
</refsect1>
55
-

56
42
<refsect1 role="errors">
57
43
&reftitle.errors;
58
44
<para>
...
...
@@ -69,6 +55,7 @@
69
55
<programlisting role="php">
70
56
<![CDATA[
71
57
<?php
58
+

72
59
class Str
73
60
{
74
61
public $length = 5;
...
...
@@ -87,7 +74,7 @@ printf(
87
74
$prop->isStatic() ? ' static' : '',
88
75
$prop->getName(),
89
76
$prop->isDefault() ? 'declared at compile-time' : 'created at run-time',
90
-
var_export(Reflection::getModifierNames($prop->getModifiers()), 1)
77
+
var_export(Reflection::getModifierNames($prop->getModifiers()), true)
91
78
);
92
79

93
80
// Create an instance of Str
...
...
@@ -104,6 +91,7 @@ var_dump($prop->getValue($obj));
104
91

105
92
// Dump object
106
93
var_dump($obj);
94
+

107
95
?>
108
96
]]>
109
97
</programlisting>
...
...
@@ -129,7 +117,8 @@ object(Str)#2 (1) {
129
117
<![CDATA[
130
118
<?php
131
119

132
-
class Foo {
120
+
class Foo
121
+
{
133
122
public $x = 1;
134
123
protected $y = 2;
135
124
private $z = 3;
...
...
@@ -138,11 +127,11 @@ class Foo {
138
127
$obj = new Foo;
139
128

140
129
$prop = new ReflectionProperty('Foo', 'y');
141
-
$prop->setAccessible(true); /* As of PHP 5.3.0 */
130
+
$prop->setAccessible(true);
142
131
var_dump($prop->getValue($obj)); // int(2)
143
132

144
133
$prop = new ReflectionProperty('Foo', 'z');
145
-
$prop->setAccessible(true); /* As of PHP 5.3.0 */
134
+
$prop->setAccessible(true);
146
135
var_dump($prop->getValue($obj)); // int(2)
147
136

148
137
?>
...
...
@@ -170,7 +159,6 @@ int(3)
170
159
</refsect1>
171
160

172
161
</refentry>
173
-

174
162
<!-- Keep this comment at the end of the file
175
163
Local variables:
176
164
mode: sgml
177
165