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,13 +67,14 @@
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.
77
+
It is not allowed to pass (an object of) an internal class as this parameter.
79
78
</para>
80
79
</listitem>
81
80
</varlistentry>
...
...
@@ -86,7 +85,7 @@
86
85
&reftitle.returnvalues;
87
86
<para>
88
87
Returns the newly created <classname>Closure</classname> object
89
-
&return.falseforfailure;
88
+
or &null; on failure.
90
89
</para>
91
90
</refsect1>
92
91

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

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

140
140
</refentry>
141
-

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