mirror of
https://github.com/php/doc-fr.git
synced 2026-03-24 23:22:18 +01:00
* CI: add French style checker based on TRADUCTIONS.txt
Checks changed XML files in PRs for:
- Direct address forms (vous/votre/vos) → warnings
- French grammar errors (etc..., comme par exemple, si il) → errors
- Incorrect terminology (librairie, chiffrage, encryption) → warnings
Inspired by doc-ja's textlint+prh approach but simpler:
runs directly on XML sources, no PhD render needed.
Only errors (grammar/spelling) fail the CI.
Style warnings appear as PR annotations without blocking.
* test: introduce style errors to validate CI check
* Revert "test: introduce style errors to validate CI check"
This reverts commit 7c1d523c6bbef116f54fc6dad7b61a45ee4f7ddd.
* Corriger toutes les violations de style TRADUCTIONS.txt
- 174x "Notez que" → "Il est à noter que"
- 50x "depuis PHP X" → "à partir de PHP X"
- 50x "votre" → le/la/du
- 15x "si il" → "s'il"
- 14x "Vous pouvez" → "Il est possible de"
- 14x "encryption" (faux positifs entity refs exclus)
- 12x "assurez-vous" → "il faut s'assurer"
- 12x "Vous devez" → "Il faut"
- 11x "vos" → les/des
- 9x "comme par exemple" → "par exemple"
- 6x "Vous devriez" → "Il est recommandé de"
- 2x "optionel" → "optionnel"
- 2x "reportez-vous" → "se reporter"
Toutes les règles passent désormais en erreur dans la CI.
* Harmoniser les noms de workflows GitHub Actions
- integrate.yaml → build.yml (extension + nom cohérent)
- check-style-fr.yml → check-style.yml ("-fr" redondant)
- Aligner les noms de workflow et job
* Lire les règles dynamiquement depuis TRADUCTIONS.txt
Le script parse TRADUCTIONS.txt au démarrage et génère les règles
de vérification automatiquement. Plus aucune règle en dur.
* Règles dynamiques depuis TRADUCTIONS.txt
Le script CI lit les lignes INTERDIT de TRADUCTIONS.txt pour générer
les règles de vérification. Plus aucune règle en dur dans le script.
Corrige les 27 violations restantes (Depuis PHP → À partir de PHP).
* Corriger les trailing whitespace
248 lines
5.3 KiB
XML
248 lines
5.3 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: 0987e913fcaed76897aeb239c6ed83d765a895e1 Maintainer: yannick Status: ready -->
|
|
<!-- Reviewed: no -->
|
|
|
|
<refentry xml:id="function.array-unshift" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>array_unshift</refname>
|
|
<refpurpose>Empile un ou plusieurs éléments au début d'un tableau</refpurpose>
|
|
</refnamediv>
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>int</type><methodname>array_unshift</methodname>
|
|
<methodparam><type>array</type><parameter role="reference">array</parameter></methodparam>
|
|
<methodparam rep="repeat"><type>mixed</type><parameter>values</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>array_unshift</function> ajoute les éléments <parameter>value1</parameter>,
|
|
<parameter>...</parameter>, passés
|
|
en argument au début du tableau <parameter>array</parameter>. Il est à noter que
|
|
les éléments sont ajoutés comme un tout, et qu'ils restent
|
|
dans le même ordre. Toutes les clés numériques seront modifiées afin
|
|
de commencer à partir de zéro, tandis que les clés littérales ne seront
|
|
pas touchées.
|
|
</para>
|
|
¬e.reset-index;
|
|
</refsect1>
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>array</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Le tableau d'entrée.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>values</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Valeur à empiler.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Retourne le nouveau nombre d'éléments du tableau
|
|
<parameter>array</parameter>.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="changelog">
|
|
&reftitle.changelog;
|
|
<para>
|
|
<informaltable>
|
|
<tgroup cols="2">
|
|
<thead>
|
|
<row>
|
|
<entry>&Version;</entry>
|
|
<entry>&Description;</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
<row>
|
|
<entry>7.3.0</entry>
|
|
<entry>
|
|
Cette fonction peut désormais être appelée avec un seul paramètre.
|
|
Auparavant, au moins deux paramètres étaient requis.
|
|
</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</informaltable>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Exemple avec <function>array_unshift</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
|
|
$queue = [
|
|
"orange",
|
|
"banana"
|
|
];
|
|
|
|
array_unshift($queue, "apple", "raspberry");
|
|
|
|
var_dump($queue);
|
|
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs;
|
|
<screen role="php">
|
|
<![CDATA[
|
|
array(4) {
|
|
[0] =>
|
|
string(5) "apple"
|
|
[1] =>
|
|
string(9) "raspberry"
|
|
[2] =>
|
|
string(6) "orange"
|
|
[3] =>
|
|
string(6) "banana"
|
|
}
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</para>
|
|
<para>
|
|
<example>
|
|
<title>Utilisation avec des tableaux associatifs</title>
|
|
<para>
|
|
Si un tableau associatif est ajouté en préfixe à un autre tableau
|
|
associatif, le tableau ajouté est indexé numériquement dans le tableau
|
|
précédent
|
|
</para>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
|
|
$foods = [
|
|
'apples' => [
|
|
'McIntosh' => 'red',
|
|
'Granny Smith' => 'green',
|
|
],
|
|
'oranges' => [
|
|
'Navel' => 'orange',
|
|
'Valencia' => 'orange',
|
|
],
|
|
];
|
|
|
|
$vegetables = [
|
|
'lettuce' => [
|
|
'Iceberg' => 'green',
|
|
'Butterhead' => 'green',
|
|
],
|
|
'carrots' => [
|
|
'Deep Purple Hybrid' => 'purple',
|
|
'Imperator' => 'orange',
|
|
],
|
|
'cucumber' => [
|
|
'Kirby' => 'green',
|
|
'Gherkin' => 'green',
|
|
],
|
|
];
|
|
|
|
array_unshift($foods, $vegetables);
|
|
|
|
var_dump($foods);
|
|
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs;
|
|
<screen role="php">
|
|
<![CDATA[
|
|
array(3) {
|
|
[0]=>
|
|
array(3) {
|
|
["lettuce"]=>
|
|
array(2) {
|
|
["Iceberg"]=>
|
|
string(5) "green"
|
|
["Butterhead"]=>
|
|
string(5) "green"
|
|
}
|
|
["carrots"]=>
|
|
array(2) {
|
|
["Deep Purple Hybrid"]=>
|
|
string(6) "purple"
|
|
["Imperator"]=>
|
|
string(6) "orange"
|
|
}
|
|
["cucumber"]=>
|
|
array(2) {
|
|
["Kirby"]=>
|
|
string(5) "green"
|
|
["Gherkin"]=>
|
|
string(5) "green"
|
|
}
|
|
}
|
|
["apples"]=>
|
|
array(2) {
|
|
["McIntosh"]=>
|
|
string(3) "red"
|
|
["Granny Smith"]=>
|
|
string(5) "green"
|
|
}
|
|
["oranges"]=>
|
|
array(2) {
|
|
["Navel"]=>
|
|
string(6) "orange"
|
|
["Valencia"]=>
|
|
string(6) "orange"
|
|
}
|
|
}
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>array_merge</function></member>
|
|
<member><function>array_shift</function></member>
|
|
<member><function>array_push</function></member>
|
|
<member><function>array_pop</function></member>
|
|
</simplelist>
|
|
</para>
|
|
</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
|
|
-->
|