Skip to content

Commit

Permalink
Sync domxpath with EN (#2075)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fan2Shrek authored Feb 26, 2025
1 parent f1c0825 commit 2f73e8d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions reference/dom/domxpath/registerphpfunctionns.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 01904e809eaf0aa60e7ce0524400ddd5681c9541 Maintainer: Fan2Shrek Status: ready -->
<!-- EN-Revision: db4a10ffdc22db3b49ea7fc01c36d21180c339b8 Maintainer: Fan2Shrek Status: ready -->
<!-- Reviewed: yes -->
<refentry xml:id="domxpath.registerphpfunctionns" xmlns="http://docbook.org/ns/docbook" xmlns:xi="http://www.w3.org/2001/XInclude">
<refnamediv>
Expand Down Expand Up @@ -97,7 +97,7 @@ $xpath = new DOMXPath($doc);
$xpath->registerNamespace("my", "urn:my.ns");
// Enregistre les fonctions PHP (sans restrictions)
$xpath->registerPHPFunctionNS(
$xpath->registerPhpFunctionNS(
'urn:my.ns',
'substring',
fn (array $arg1, int $start, int $length) => substr($arg1[0]->textContent, $start, $length)
Expand Down
14 changes: 7 additions & 7 deletions reference/dom/domxpath/registerphpfunctions.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 01904e809eaf0aa60e7ce0524400ddd5681c9541 Maintainer: yannick Status: ready -->
<!-- EN-Revision: db4a10ffdc22db3b49ea7fc01c36d21180c339b8 Maintainer: yannick Status: ready -->
<!-- Reviewed: no -->
<refentry xml:id="domxpath.registerphpfunctions" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
Expand Down Expand Up @@ -136,7 +136,7 @@
</para>
<para>
<example>
<title>Exemple avec <methodname>DOMXPath::registerPHPFunctions</methodname>
<title>Exemple avec <methodname>DOMXPath::registerPhpFunctions</methodname>
et <literal>php:functionString</literal></title>
<programlisting role="php">
<![CDATA[
Expand All @@ -150,7 +150,7 @@ $xpath = new DOMXPath($doc);
$xpath->registerNamespace("php", "http://php.net/xpath");
// Enregistre les fonctions PHP (Aucune restriction)
$xpath->registerPHPFunctions();
$xpath->registerPhpFunctions();
// Appèle la fonction substr sur le titre du livre
$nodes = $xpath->query('//book[php:functionString("substr", title, 0, 3) = "PHP"]');
Expand All @@ -177,7 +177,7 @@ PHP Secrets par Jenny Smythe
</para>
<para>
<example>
<title>Exemple avec <methodname>DOMXPath::registerPHPFunctions</methodname>
<title>Exemple avec <methodname>DOMXPath::registerPhpFunctions</methodname>
et <literal>php:function</literal></title>
<programlisting role="php">
<![CDATA[
Expand All @@ -191,7 +191,7 @@ $xpath = new DOMXPath($doc);
$xpath->registerNamespace("php", "http://php.net/xpath");
// Enregistre des fonctions PHP (has_multiple uniquement)
$xpath->registerPHPFunctions("has_multiple");
$xpath->registerPhpFunctions("has_multiple");
function has_multiple($nodes) {
// Retourne true s'il y a plus d'un auteur
Expand Down Expand Up @@ -219,7 +219,7 @@ PHP de base
</para>
<para>
<example>
<title><methodname>DOMXPath::registerPHPFunctions</methodname> avec un <type>callable</type></title>
<title><methodname>DOMXPath::registerPhpFunctions</methodname> avec un <type>callable</type></title>
<programlisting role="php">
<![CDATA[
<?php
Expand All @@ -232,7 +232,7 @@ $xpath = new DOMXPath($doc);
$xpath->registerNamespace("php", "http://php.net/xpath");
// Enregistrer les fonctions PHP (uniquement has_multiple)
$xpath->registerPHPFunctions(["has_multiple" => fn ($nodes) => count($nodes) > 1]);
$xpath->registerPhpFunctions(["has_multiple" => fn ($nodes) => count($nodes) > 1]);
// Filtrer les livres avec plusieurs auteurs
$books = $xpath->query('//book[php:function("has_multiple", author)]');
Expand Down

0 comments on commit 2f73e8d

Please sign in to comment.