reference/runkit7/functions/runkit7-method-rename.xml
917c06eac884740ef9285f59387a3f5259d66722
...
...
@@ -0,0 +1,125 @@
1
+
<?xml version="1.0" encoding="utf-8"?>
2
+
<!-- $Revision$ -->
3
+

4
+
<refentry xml:id="function.runkit7-method-rename" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
5
+
<refnamediv>
6
+
<refname>runkit7_method_rename</refname>
7
+
<refpurpose>Dynamically changes the name of the given method</refpurpose>
8
+
</refnamediv>
9
+

10
+
<refsect1 role="description">
11
+
&reftitle.description;
12
+
<methodsynopsis>
13
+
<type>bool</type><methodname>runkit7_method_rename</methodname>
14
+
<methodparam><type>string</type><parameter>class_name</parameter></methodparam>
15
+
<methodparam><type>string</type><parameter>source_method_name</parameter></methodparam>
16
+
<methodparam><type>string</type><parameter>target_method_name</parameter></methodparam>
17
+
</methodsynopsis>
18
+
&note.runkit.selfmanipulation;
19
+
</refsect1>
20
+

21
+
<refsect1 role="parameters">
22
+
&reftitle.parameters;
23
+
<variablelist>
24
+
<varlistentry>
25
+
<term><parameter>class_name</parameter></term>
26
+
<listitem>
27
+
<para>
28
+
The class in which to rename the method
29
+
</para>
30
+
</listitem>
31
+
</varlistentry>
32
+
<varlistentry>
33
+
<term><parameter>source_method_name</parameter></term>
34
+
<listitem>
35
+
<para>
36
+
The name of the method to rename
37
+
</para>
38
+
</listitem>
39
+
</varlistentry>
40
+
<varlistentry>
41
+
<term><parameter>target_method_name</parameter></term>
42
+
<listitem>
43
+
<para>
44
+
The new name to give to the renamed method
45
+
</para>
46
+
</listitem>
47
+
</varlistentry>
48
+
</variablelist>
49
+
</refsect1>
50
+

51
+
<refsect1 role="returnvalues">
52
+
&reftitle.returnvalues;
53
+
<para>
54
+
&return.success;
55
+
</para>
56
+
</refsect1>
57
+
<refsect1 role="examples">
58
+
&reftitle.examples;
59
+
<para>
60
+
<example>
61
+
<title><function>runkit7_method_rename</function> example</title>
62
+
<programlisting role="php">
63
+
<![CDATA[
64
+
<?php
65
+
class Example {
66
+
function foo() {
67
+
return "foo!\n";
68
+
}
69
+
}
70
+

71
+
// Rename the 'foo' method to 'bar'
72
+
runkit7_method_rename(
73
+
'Example',
74
+
'foo',
75
+
'bar'
76
+
);
77
+

78
+
// output renamed function
79
+
echo (new Example)->bar();
80
+
?>
81
+
]]>
82
+
</programlisting>
83
+
&example.outputs;
84
+
<screen>
85
+
<![CDATA[
86
+
foo!
87
+
]]>
88
+
</screen>
89
+
</example>
90
+
</para>
91
+
</refsect1>
92
+
<refsect1 role="seealso">
93
+
&reftitle.seealso;
94
+
<para>
95
+
<simplelist>
96
+
<member><function>runkit7_method_add</function></member>
97
+
<member><function>runkit7_method_copy</function></member>
98
+
<member><function>runkit7_method_redefine</function></member>
99
+
<member><function>runkit7_method_remove</function></member>
100
+
<member><function>runkit7_function_rename</function></member>
101
+
</simplelist>
102
+
</para>
103
+
</refsect1>
104
+
</refentry>
105
+

106
+
<!-- Keep this comment at the end of the file
107
+
Local variables:
108
+
mode: sgml
109
+
sgml-omittag:t
110
+
sgml-shorttag:t
111
+
sgml-minimize-attributes:nil
112
+
sgml-always-quote-attributes:t
113
+
sgml-indent-step:1
114
+
sgml-indent-data:t
115
+
indent-tabs-mode:nil
116
+
sgml-parent-document:nil
117
+
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
118
+
sgml-exposed-tags:nil
119
+
sgml-local-catalogs:nil
120
+
sgml-local-ecat-files:nil
121
+
End:
122
+
vim600: syn=xml fen fdm=syntax fdl=2 si
123
+
vim: et tw=78 syn=sgml
124
+
vi: ts=1 sw=1
125
+
-->
0
126