language/predefined/closure/bindto.xml
9c74079f12d67cabb52c124d761f48275417d7eb
...
...
@@ -1,6 +1,5 @@
1
1
<?xml version="1.0" encoding="utf-8"?>
2
2
<!-- $Revision$ -->
3
-

4
3
<refentry xml:id="closure.bindto" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
5
4
<refnamediv>
6
5
<refname>Closure::bindTo</refname>
...
...
@@ -11,11 +10,10 @@
11
10

12
11
<refsect1 role="description">
13
12
&reftitle.description;
14
-
<methodsynopsis>
15
-
<modifier>public</modifier> <type>Closure</type><methodname>Closure::bindTo</methodname>
16
-
<methodparam><type>object</type><parameter>newthis</parameter></methodparam>
17
-
<methodparam choice="opt"><type>mixed</type><parameter>newscope</parameter>
18
-
<initializer>"static"</initializer></methodparam>
13
+
<methodsynopsis role="Closure">
14
+
<modifier>public</modifier> <type class="union"><type>Closure</type><type>null</type></type><methodname>Closure::bindTo</methodname>
15
+
<methodparam><type class="union"><type>object</type><type>null</type></type><parameter>newThis</parameter></methodparam>
16
+
<methodparam choice="opt"><type class="union"><type>object</type><type>string</type><type>null</type></type><parameter>newScope</parameter><initializer>"static"</initializer></methodparam>
19
17
</methodsynopsis>
20
18
<para>
21
19
Create and return a new <link linkend="functions.anonymous">anonymous
...
...
@@ -29,13 +27,13 @@
29
27
which determines which private and protected members the anonymous
30
28
function will be able to access. Namely, the members that will be
31
29
visible are the same as if the anonymous function were a method of
32
-
the class given as value of the <parameter>newscope</parameter>
30
+
the class given as value of the <parameter>newScope</parameter>
33
31
parameter.
34
32
</para>
35
33

36
34
<para>
37
35
Static closures cannot have any bound object (the value of the parameter
38
-
<parameter>newthis</parameter> should be &null;), but this function can
36
+
<parameter>newThis</parameter> should be &null;), but this function can
39
37
nevertheless be used to change their class scope.
40
38
</para>
41
39

...
...
@@ -60,7 +58,7 @@
60
58
&reftitle.parameters;
61
59
<variablelist>
62
60
<varlistentry>
63
-
<term><parameter>newthis</parameter></term>
61
+
<term><parameter>newThis</parameter></term>
64
62
<listitem>
65
63
<para>
66
64
The object to which the given anonymous function should be bound, or
...
...
@@ -69,10 +67,10 @@
69
67
</listitem>
70
68
</varlistentry>
71
69
<varlistentry>
72
-
<term><parameter>newscope</parameter></term>
70
+
<term><parameter>newScope</parameter></term>
73
71
<listitem>
74
72
<para>
75
-
The class scope to which associate the closure is to be associated, or
73
+
The class scope to which the closure is to be associated, or
76
74
'static' to keep the current one. If an object is given, the type of the
77
75
object will be used instead. This determines the visibility of protected
78
76
and private methods of the bound object.
...
...
@@ -87,32 +85,7 @@
87
85
&reftitle.returnvalues;
88
86
<para>
89
87
Returns the newly created <classname>Closure</classname> object
90
-
&return.falseforfailure;
91
-
</para>
92
-
</refsect1>
93
-
94
-
<refsect1 role="changelog">
95
-
&reftitle.changelog;
96
-
<para>
97
-
<informaltable>
98
-
<tgroup cols="2">
99
-
<thead>
100
-
<row>
101
-
<entry>&Version;</entry>
102
-
<entry>&Description;</entry>
103
-
</row>
104
-
</thead>
105
-
<tbody>
106
-
<row>
107
-
<entry>7.0.0</entry>
108
-
<entry>
109
-
<parameter>newscope</parameter> can not be (an object of) an internal
110
-
class anymore, what was possible prior to this version.
111
-
</entry>
112
-
</row>
113
-
</tbody>
114
-
</tgroup>
115
-
</informaltable>
88
+
or &null; on failure.
116
89
</para>
117
90
</refsect1>
118
91

...
...
@@ -125,6 +98,7 @@
125
98
<?php
126
99

127
100
class A {
101
+
private $val;
128
102
function __construct($val) {
129
103
$this->val = $val;
130
104
}
...
...
@@ -164,7 +138,6 @@ echo $cl(), "\n";
164
138
</refsect1>
165
139

166
140
</refentry>
167
-

168
141
<!-- Keep this comment at the end of the file
169
142
Local variables:
170
143
mode: sgml
171
144