Document callback signatures

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@330240 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Jakub Vrana 2013-05-16 18:24:33 +00:00
parent 5b2f7f1f44
commit f68abbe82c
4 changed files with 39 additions and 6 deletions

View file

@ -75,7 +75,7 @@
</para>
<para>
<methodsynopsis>
<methodname><replaceable>handler</replaceable></methodname>
<type>bool</type><methodname><replaceable>handler</replaceable></methodname>
<methodparam><type>int</type><parameter>errno</parameter></methodparam>
<methodparam><type>string</type><parameter>errstr</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>errfile</parameter></methodparam>

View file

@ -33,7 +33,13 @@
This function must be defined before calling
<function>set_exception_handler</function>. This handler function
needs to accept one parameter, which will be the exception object that
was thrown.
was thrown. This is the handler signature:
</para>
<para>
<methodsynopsis>
<type>void</type><methodname><replaceable>handler</replaceable></methodname>
<methodparam><type>Exception</type><parameter>$ex</parameter></methodparam>
</methodsynopsis>
</para>
<note>
<para>

View file

@ -65,11 +65,32 @@
return a new output buffer as a result, which will be sent to the
browser. If the <parameter>output_callback</parameter> is not a
callable function, this function will return &false;.
This is the callback signature:
</para>
<para>
If the callback function has two parameters, the second parameter is
filled with a bit-field consisting of
<constant>PHP_OUTPUT_HANDLER_*</constant> constants.
<methodsynopsis>
<type>bool</type><methodname><replaceable>handler</replaceable></methodname>
<methodparam><type>string</type><parameter>buffer</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>phase</parameter></methodparam>
</methodsynopsis>
<variablelist>
<varlistentry>
<term><parameter>buffer</parameter></term>
<listitem>
<simpara>
Contents of the output buffer.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>phase</parameter></term>
<listitem>
<simpara>
Bitmask of <constant>PHP_OUTPUT_HANDLER_*</constant> constants.
</simpara>
</listitem>
</varlistentry>
</variablelist>
</para>
<para>
If <parameter>output_callback</parameter> returns &false; original

View file

@ -43,7 +43,13 @@
<para>
A callback that will be called and passed an array of matched elements
in the <parameter>subject</parameter> string. The callback should
return the replacement string.
return the replacement string. This is the callback signature:
</para>
<para>
<methodsynopsis>
<type>string</type><methodname><replaceable>handler</replaceable></methodname>
<methodparam><type>array</type><parameter>matches</parameter></methodparam>
</methodsynopsis>
</para>
<para>
You'll often need the <parameter>callback</parameter> function