Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions reference/random/book.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 550b9c3c31a66c18c9303794c12260bf5c684fed Maintainer: pierrick Status: ready -->
<!-- EN-Revision: 1bcc40f8134305cbebf6c8378ee7e5fc8c569674 Maintainer: pierrick Status: ready -->
<!-- Reviewed: no -->
<book xml:id="book.random" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<book xml:id="book.random" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" annotations="interactive">
<?phpdoc extension-membership="core" ?>
<title>Générateurs de nombres aléatoires et fonctions liées à l'aléatoire.</title>
<titleabbrev>Random</titleabbrev>
Expand Down
28 changes: 25 additions & 3 deletions reference/random/examples.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 2166824858a40ea664c558f2930b63b8f4fd89c6 Maintainer: pierrick Status: ready -->
<!-- EN-Revision: 1bcc40f8134305cbebf6c8378ee7e5fc8c569674 Maintainer: pierrick Status: ready -->
<!-- Reviewed: no -->
<chapter xml:id="random.examples" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
&reftitle.examples;
Expand All @@ -8,16 +8,38 @@
<programlisting role="php">
<![CDATA[
<?php
$r = new \Random\Randomizer();

/* ... */
// Generating a random domain name
printf(
"%s.example.com\n",
$r->getBytesFromString('abcdefghijklmnopqrstuvwxyz0123456789', 16)
);

// Shuffle array:
$fruits = [ 'red' => '🍎', 'green' => '🥝', 'yellow' => '🍌', 'pink' => '🍑', 'purple' => '🍇' ];
echo "Salad: ", implode(', ', $r->shuffleArray($fruits)), "\n";

// Shuffeling array keys
$fruits = [ 'red' => '🍎', 'green' => '🥝', 'yellow' => '🍌', 'pink' => '🍑', 'purple' => '🍇' ];

$keys = $r->pickArrayKeys($fruits, 2);
// Look up the values for the picked keys.
$selection = array_map(
static fn ($key) => $fruits[$key],
$keys
);

echo "Values: ", implode(', ', $selection), "\n";
?>
]]>
</programlisting>
&example.outputs.similar;
<screen>
<![CDATA[
...
j87fzv1p0daiwmlo.example.com
Salad: 🥝, 🍇, 🍎, 🍌, 🍑
Values: 🍌, 🍑
]]>
</screen>
</example>
Expand Down
7 changes: 2 additions & 5 deletions reference/random/random/engine/mt19937/construct.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: c4f24e2eef1a3c970c491c0ee8cbc1f290ff023a Maintainer: Fan2Shrek Status: ready -->
<!-- EN-Revision: 1bcc40f8134305cbebf6c8378ee7e5fc8c569674 Maintainer: Fan2Shrek Status: ready -->
<!-- Reviewed: yes -->
<refentry xml:id="random-engine-mt19937.construct" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
Expand All @@ -19,9 +19,6 @@
</para>

&caution.mt19937-tiny-seed;

&warn.undocumented.func;

</refsect1>

<refsect1 role="parameters">
Expand Down Expand Up @@ -79,7 +76,7 @@

<refsect1 role="examples">
&reftitle.examples;
<example>
<example annotations="non-interactive">
<title>Exemple de <function>Random\Engine\Mt19937::__construct</function></title>
<programlisting role="php">
<![CDATA[
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 826073522514072830b63bee2b6135dc675ea45d Maintainer: Fan2Shrek Status: ready -->
<!-- EN-Revision: 1bcc40f8134305cbebf6c8378ee7e5fc8c569674 Maintainer: Fan2Shrek Status: ready -->
<!-- Reviewed: yes -->
<refentry xml:id="random-engine-pcgoneseq128xslrr64.construct" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
Expand All @@ -16,9 +16,6 @@
<para>

</para>

&warn.undocumented.func;

</refsect1>

<refsect1 role="parameters">
Expand Down Expand Up @@ -94,7 +91,7 @@

<refsect1 role="examples">
&reftitle.examples;
<example>
<example annotations="non-interactive">
<title>Exemple de <function>Random\Engine\PcgOneseq128XslRr64::__construct</function></title>
<programlisting role="php">
<![CDATA[
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 826073522514072830b63bee2b6135dc675ea45d Maintainer: Fan2Shrek Status: ready -->
<!-- EN-Revision: 1bcc40f8134305cbebf6c8378ee7e5fc8c569674 Maintainer: Fan2Shrek Status: ready -->
<!-- Reviewed: yes -->
<refentry xml:id="random-engine-xoshiro256starstar.construct" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
Expand All @@ -16,9 +16,6 @@
<para>

</para>

&warn.undocumented.func;

</refsect1>

<refsect1 role="parameters">
Expand Down Expand Up @@ -100,7 +97,7 @@

<refsect1 role="examples">
&reftitle.examples;
<example>
<example annotations="non-interactive">
<title>Exemple de <function>Random\Engine\Xoshiro256StarStar::__construct</function></title>
<programlisting role="php">
<![CDATA[
Expand Down
27 changes: 4 additions & 23 deletions reference/random/random/randomizer/construct.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 5e2031dc70157464c05c1c1e00b3201604a025f1 Maintainer: Fan2Shrek Status: ready -->
<!-- EN-Revision: 1bcc40f8134305cbebf6c8378ee7e5fc8c569674 Maintainer: Fan2Shrek Status: ready -->
<!-- Reviewed: yes -->
<refentry xml:id="random-randomizer.construct" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
Expand Down Expand Up @@ -39,37 +39,18 @@
</variablelist>
</refsect1>

<!-- Return values commented out, as constructors generally don't return a
value. Uncomment this if you do need a return values section (for
example, because there's also a procedural version of the method).
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>

</para>
</refsect1>
-->


<refsect1 role="examples">
&reftitle.examples;
<example>
<example annotations="non-interactive">
<title>Exemple de <function>Random\Randomizer::__construct</function></title>
<programlisting role="php">
<![CDATA[
<?php

/* ... */

$r = new \Random\Randomizer();
$r = new \Random\Randomizer(new \Random\Engine\Mt19937());
?>
]]>
</programlisting>
&example.outputs.similar;
<screen>
<![CDATA[
...
]]>
</screen>
</example>
</refsect1>

Expand Down
5 changes: 1 addition & 4 deletions reference/random/random/randomizer/getint.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 0ec8e36e0f649354b20c714080a903d32df4dbfb Maintainer: Fan2Shrek Status: ready -->
<!-- EN-Revision: 1bcc40f8134305cbebf6c8378ee7e5fc8c569674 Maintainer: Fan2Shrek Status: ready -->
<!-- Reviewed: yes -->
<refentry xml:id="random-randomizer.getint" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
Expand All @@ -17,9 +17,6 @@
<para>

</para>

&warn.undocumented.func;

</refsect1>

<refsect1 role="parameters">
Expand Down
5 changes: 1 addition & 4 deletions reference/random/random/randomizer/nextint.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 788ec8e5e7bdadd182e52d4820959e21765d7ff3 Maintainer: Fan2Shrek Status: ready -->
<!-- EN-Revision: 1bcc40f8134305cbebf6c8378ee7e5fc8c569674 Maintainer: Fan2Shrek Status: ready -->
<!-- Reviewed: yes -->
<refentry xml:id="random-randomizer.nextint" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
Expand All @@ -16,9 +16,6 @@
<para>

</para>

&warn.undocumented.func;

</refsect1>

<refsect1 role="parameters">
Expand Down
4 changes: 2 additions & 2 deletions reference/reflection/book.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: e0e74c05cb704b614ff6925552884fbffb26bb53 Maintainer: yannick Status: ready -->
<!-- EN-Revision: 1bcc40f8134305cbebf6c8378ee7e5fc8c569674 Maintainer: yannick Status: ready -->
<!-- Reviewed: no -->
<book xml:id="book.reflection" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<book xml:id="book.reflection" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" annotations="interactive">
<?phpdoc extension-membership="core" ?>
<title>Réflexion</title>
<titleabbrev>Réflexion</titleabbrev>
Expand Down