<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->

<refentry xml:id="ds-deque.apply" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
 <refnamediv>
  <refname>Ds\Deque::apply</refname>
  <refpurpose>Updates all values by applying a callback function to each value</refpurpose>
 </refnamediv>

 <refsect1 role="description">
  &reftitle.description;
  <methodsynopsis>
   <modifier>public</modifier> <type>void</type><methodname>Ds\Deque::apply</methodname>
   <methodparam><type>callable</type><parameter>callback</parameter></methodparam>
  </methodsynopsis>
  <para>
    Updates all values by applying a <parameter>callback</parameter> function to
    each value in the deque.
  </para>
 </refsect1>

 <refsect1 role="parameters">
  &reftitle.parameters;
  <variablelist>
   <varlistentry>
    <term><parameter>callback</parameter></term>

    <listitem>
        <para>
            <methodsynopsis xmlns="http://docbook.org/ns/docbook">
                <type>mixed</type>
                <methodname><replaceable>callback</replaceable></methodname>
                <methodparam><type>mixed</type><parameter>value</parameter></methodparam>
             </methodsynopsis>
        </para>
        <para>
            A <type>callable</type> to apply to each value in the deque.
        </para>

        <para>
            The callback should return what the value should be replaced by.
        </para>
    </listitem>

   </varlistentry>
  </variablelist>
 </refsect1>

 <refsect1 role="returnvalues">
  &reftitle.returnvalues;
  <para>
    &return.void;
  </para>
 </refsect1>

 <refsect1 role="examples">
  &reftitle.examples;
  <example>
   <title><function>Ds\Deque::apply</function> example</title>
   <programlisting role="php">
<![CDATA[
<?php
$deque = new \Ds\Deque([1, 2, 3]);
$deque->apply(function($value) { return $value * 2; });

print_r($deque);
?>
]]>
   </programlisting>
   &example.outputs.similar;
   <screen>
<![CDATA[
Ds\Deque Object
(
    [0] => 2
    [1] => 4
    [2] => 6
)
]]>
   </screen>
  </example>
 </refsect1>


</refentry>

<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
