Normalise SPL sorting docs with array ones (#925)

This commit is contained in:
George Peter Banyard 2021-10-08 15:29:02 +01:00 committed by GitHub
parent 2245d53f61
commit 8dba51217b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 75 additions and 52 deletions

View file

@ -3,7 +3,7 @@
<refentry xml:id="arrayiterator.asort" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>ArrayIterator::asort</refname>
<refpurpose>Sort array by values</refpurpose>
<refpurpose>Sort entries by values</refpurpose>
</refnamediv>
<refsect1 role="description">
@ -13,22 +13,22 @@
<methodparam choice="opt"><type>int</type><parameter>flags</parameter><initializer><constant>SORT_REGULAR</constant></initializer></methodparam>
</methodsynopsis>
<para>
Sorts an array by values.
Sorts entries by their values.
</para>
&warn.undocumented.func;
&note.sort-unstable;
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
<variablelist>
&sort.flags.parameter;
</variablelist>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Always returns &true;.
&return.true.always;
</para>
</refsect1>
@ -39,6 +39,9 @@
<member><methodname>ArrayIterator::ksort</methodname></member>
<member><methodname>ArrayIterator::natcasesort</methodname></member>
<member><methodname>ArrayIterator::natsort</methodname></member>
<member><methodname>ArrayIterator::uasort</methodname></member>
<member><methodname>ArrayIterator::uksort</methodname></member>
<member><function>asort</function></member>
</simplelist>
</para>
</refsect1>

View file

@ -3,7 +3,7 @@
<refentry xml:id="arrayiterator.ksort" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>ArrayIterator::ksort</refname>
<refpurpose>Sort array by keys</refpurpose>
<refpurpose>Sort entries by keys</refpurpose>
</refnamediv>
<refsect1 role="description">
@ -13,22 +13,22 @@
<methodparam choice="opt"><type>int</type><parameter>flags</parameter><initializer><constant>SORT_REGULAR</constant></initializer></methodparam>
</methodsynopsis>
<para>
Sorts an array by the keys.
Sorts entries by their keys.
</para>
&warn.undocumented.func;
&note.sort-unstable;
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
<variablelist>
&sort.flags.parameter;
</variablelist>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Always returns &true;.
&return.true.always;
</para>
</refsect1>
@ -39,6 +39,9 @@
<member><methodname>ArrayIterator::asort</methodname></member>
<member><methodname>ArrayIterator::natcasesort</methodname></member>
<member><methodname>ArrayIterator::natsort</methodname></member>
<member><methodname>ArrayIterator::uasort</methodname></member>
<member><methodname>ArrayIterator::uksort</methodname></member>
<member><function>ksort</function></member>
</simplelist>
</para>
</refsect1>

View file

@ -3,7 +3,7 @@
<refentry xml:id="arrayiterator.natcasesort" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>ArrayIterator::natcasesort</refname>
<refpurpose>Sort an array naturally, case insensitive</refpurpose>
<refpurpose>Sort entries naturally, case insensitive</refpurpose>
</refnamediv>
<refsect1 role="description">
@ -15,9 +15,7 @@
<para>
Sort the entries by values using a case insensitive "natural order" algorithm.
</para>
&warn.undocumented.func;
&note.sort-unstable;
</refsect1>
<refsect1 role="parameters">
@ -28,7 +26,7 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.void;
&return.true.always;
</para>
</refsect1>
@ -39,6 +37,8 @@
<member><methodname>ArrayIterator::asort</methodname></member>
<member><methodname>ArrayIterator::ksort</methodname></member>
<member><methodname>ArrayIterator::natsort</methodname></member>
<member><methodname>ArrayIterator::uasort</methodname></member>
<member><methodname>ArrayIterator::uksort</methodname></member>
<member><function>natcasesort</function></member>
</simplelist>
</para>

View file

@ -3,7 +3,7 @@
<refentry xml:id="arrayiterator.natsort" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>ArrayIterator::natsort</refname>
<refpurpose>Sort an array naturally</refpurpose>
<refpurpose>Sort entries naturally</refpurpose>
</refnamediv>
<refsect1 role="description">
@ -13,11 +13,9 @@
<void/>
</methodsynopsis>
<para>
Sort the entries by values using "natural order" algorithm.
Sort the entries by values using a "natural order" algorithm.
</para>
&warn.undocumented.func;
&note.sort-unstable;
</refsect1>
<refsect1 role="parameters">
@ -28,7 +26,7 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.void;
&return.true.always;
</para>
</refsect1>
@ -38,7 +36,9 @@
<simplelist>
<member><methodname>ArrayIterator::asort</methodname></member>
<member><methodname>ArrayIterator::ksort</methodname></member>
<member><methodname>ArrayIterator::natcasesort</methodname></member>
<member><methodname>ArrayIterator::natsort</methodname></member>
<member><methodname>ArrayIterator::uasort</methodname></member>
<member><methodname>ArrayIterator::uksort</methodname></member>
<member><function>natsort</function></member>
</simplelist>
</para>

View file

@ -40,7 +40,7 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.void;
&return.true.always;
</para>
</refsect1>
@ -49,8 +49,11 @@
<para>
<simplelist>
<member><methodname>ArrayIterator::asort</methodname></member>
<member><methodname>ArrayIterator::ksort</methodname></member>
<member><methodname>ArrayIterator::natcasesort</methodname></member>
<member><methodname>ArrayIterator::natsort</methodname></member>
<member><methodname>ArrayIterator::uksort</methodname></member>
<member><function>usort</function></member>
<member><function>uasort</function></member>
</simplelist>
</para>
</refsect1>

View file

@ -39,7 +39,7 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.void;
&return.true.always;
</para>
</refsect1>
@ -47,8 +47,11 @@
&reftitle.seealso;
<para>
<simplelist>
<member><methodname>ArrayIterator::asort</methodname></member>
<member><methodname>ArrayIterator::ksort</methodname></member>
<member><methodname>ArrayIterator::uasort</methodname></member>
<member><methodname>ArrayIterator::natcasesort</methodname></member>
<member><methodname>ArrayIterator::natsort</methodname></member>
<member><methodname>ArrayIterator::uksort</methodname></member>
<member><function>uksort</function></member>
</simplelist>
</para>

View file

@ -12,11 +12,15 @@
<methodparam choice="opt"><type>int</type><parameter>flags</parameter><initializer><constant>SORT_REGULAR</constant></initializer></methodparam>
</methodsynopsis>
<para>
Sorts the entries such that the keys maintain
their correlation with the entries they are associated
with. This is used mainly when sorting associative arrays where
the actual element order is significant.
Sorts the entries in ascending order,
such that its keys maintain their correlation with the values they
are associated with.
</para>
<para>
This is used mainly when sorting associative arrays where the actual
element order is significant.
</para>
&note.sort-unstable;
</refsect1>
<refsect1 role="parameters">
@ -29,7 +33,7 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.void;
&return.true.always;
</para>
</refsect1>
@ -77,6 +81,7 @@ a = orange
<member><methodname>ArrayObject::natcasesort</methodname></member>
<member><methodname>ArrayObject::uasort</methodname></member>
<member><methodname>ArrayObject::uksort</methodname></member>
<member><function>asort</function></member>
</simplelist>
</para>
</refsect1>

View file

@ -15,6 +15,7 @@
Sorts the entries by key, maintaining key to entry correlations. This is
useful mainly for associative arrays.
</para>
&note.sort-unstable;
</refsect1>
<refsect1 role="parameters">
@ -27,7 +28,7 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.void;
&return.true.always;
</para>
</refsect1>
@ -71,6 +72,7 @@ d = lemon
<member><methodname>ArrayObject::natcasesort</methodname></member>
<member><methodname>ArrayObject::uasort</methodname></member>
<member><methodname>ArrayObject::uksort</methodname></member>
<member><function>ksort</function></member>
</simplelist>
</para>
</refsect1>

View file

@ -20,6 +20,7 @@
alphanumeric strings in the way a human being would while maintaining
key/value associations. This is described as a "natural ordering".
</para>
&note.sort-unstable;
</refsect1>
<refsect1 role="parameters">
@ -100,6 +101,7 @@ ArrayObject Object
<member><methodname>ArrayObject::natsort</methodname></member>
<member><methodname>ArrayObject::uasort</methodname></member>
<member><methodname>ArrayObject::uksort</methodname></member>
<member><function>natcasesort</function></member>
</simplelist>
</para>
</refsect1>

View file

@ -19,6 +19,7 @@
(used in <link linkend="arrayobject.asort">ArrayObject::asort</link>) method
can be seen in the example below.
</para>
&note.sort-unstable;
</refsect1>
<refsect1 role="parameters">
@ -95,6 +96,7 @@ ArrayObject Object
<member><methodname>ArrayObject::natcasesort</methodname></member>
<member><methodname>ArrayObject::uasort</methodname></member>
<member><methodname>ArrayObject::uksort</methodname></member>
<member><function>natsort</function></member>
</simplelist>
</para>
</refsect1>

View file

@ -20,6 +20,7 @@
This is used mainly when sorting associative arrays where the actual
element order is significant.
</para>
&note.sort-unstable;
</refsect1>
<refsect1 role="parameters">
@ -30,19 +31,22 @@
<term><parameter>callback</parameter></term>
<listitem>
<para>
Function <parameter>callback</parameter> should accept two
parameters which will be filled by pairs of entries.
The comparison function must return an integer less than, equal
to, or greater than zero if the first argument is considered to
be respectively less than, equal to, or greater than the
second.
&return.callbacksort;
</para>
&callback.cmp;
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.true.always;
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
@ -117,6 +121,7 @@ Array
<member><methodname>ArrayObject::natsort</methodname></member>
<member><methodname>ArrayObject::natcasesort</methodname></member>
<member><methodname>ArrayObject::uksort</methodname></member>
<member><function>uasort</function></member>
</simplelist>
</para>
</refsect1>

View file

@ -15,6 +15,7 @@
This function sorts the keys of the entries using a user-supplied
comparison function. The key to entry correlations will be maintained.
</para>
&note.sort-unstable;
</refsect1>
<refsect1 role="parameters">
@ -25,16 +26,9 @@
<term><parameter>callback</parameter></term>
<listitem>
<para>
The callback comparison function.
</para>
<para>
Function <parameter>callback</parameter> should accept two
parameters which will be filled by pairs of entry keys.
The comparison function must return an integer less than, equal
to, or greater than zero if the first argument is considered to
be respectively less than, equal to, or greater than the
second.
&return.callbacksort;
</para>
&callback.cmp;
</listitem>
</varlistentry>
</variablelist>
@ -44,7 +38,7 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.void;
&return.true.always;
</para>
</refsect1>
@ -94,6 +88,7 @@ John: 1
<member><methodname>ArrayObject::natsort</methodname></member>
<member><methodname>ArrayObject::natcasesort</methodname></member>
<member><methodname>ArrayObject::uasort</methodname></member>
<member><function>uksort</function></member>
</simplelist>
</para>
</refsect1>