Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document tidyNode::getNextSibling() and tidyNode::getPreviousSibling() #3874

Merged
merged 2 commits into from
Oct 15, 2024
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/tidy/tidy/getoptdoc.xml
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ foreach ($config as $opt => $val) {
&reftitle.seealso;
<para>
<simplelist>
<member><function>tidy::getconfig</function></member>
<member><function>tidy::getopt</function></member>
<member><function>tidy::getConfig</function></member>
<member><function>tidy::getOpt</function></member>
</simplelist>
</para>
</refsect1>
Expand Down
6 changes: 3 additions & 3 deletions reference/tidy/tidy/parsefile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,9 @@ if(!empty($tidy->errorBuffer)) {
<refsect1 role="seealso">
&reftitle.seealso;
<simplelist>
<member><function>tidy::parsestring</function></member>
<member><function>tidy::repairfile</function></member>
<member><function>tidy::repairstring</function></member>
<member><function>tidy::parseString</function></member>
<member><function>tidy::repairFile</function></member>
<member><function>tidy::repairString</function></member>
</simplelist>
</refsect1>

Expand Down
99 changes: 99 additions & 0 deletions reference/tidy/tidynode/getnextsibling.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="tidynode.getnextsibling" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>tidyNode::getNextSibling</refname>
<refpurpose>Returns the next sibling node of the current node</refpurpose>
</refnamediv>

<refsect1 role="description">
&reftitle.description;
<methodsynopsis role="tidyNode">
<modifier>public</modifier> <type class="union"><type>tidyNode</type><type>null</type></type><methodname>tidyNode::getNextSibling</methodname>
<void/>
</methodsynopsis>
<simpara>
Returns the next sibling node of the current node.
</simpara>
</refsect1>

<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
</refsect1>

<refsect1 role="returnvalues">
&reftitle.returnvalues;
<simpara>
Returns a <type>tidyNode</type> if the node has a next sibling, or &null;
otherwise.
</simpara>
</refsect1>

<refsect1 role="examples">
&reftitle.examples;
<example>
<title><function>tidyNode::getNextSibling</function> example</title>
<programlisting role="php">
<![CDATA[
<?php

$html = <<< HTML
<html>
<head>
</head>
<body>
<p>Hello</p><p>World</p>
</body>
</html>

HTML;


$tidy = tidy_parse_string($html);

$node = $tidy->body();
var_dump($node->child[0]->getNextSibling()->value);

?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
string(13) "<p>World</p>
"
]]>
</screen>
</example>
</refsect1>

<refsect1 role="seealso">
&reftitle.seealso;
<simplelist>
<member><function>tidy::getParent</function></member>
<member><function>tidy::getPreviousSibling</function></member>
</simplelist>
</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
-->
8 changes: 8 additions & 0 deletions reference/tidy/tidynode/getparent.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,14 @@ string(4) "head"
</para>
</refsect1>

<refsect1 role="seealso">
&reftitle.seealso;
<simplelist>
<member><function>tidy::getPreviousSibling</function></member>
<member><function>tidy::getNextSibling</function></member>
</simplelist>
</refsect1>

</refentry>
<!-- Keep this comment at the end of the file
Local variables:
Expand Down
99 changes: 99 additions & 0 deletions reference/tidy/tidynode/getprevioussibling.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="tidynode.getprevioussibling" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>tidyNode::getPreviousSibling</refname>
<refpurpose>Returns the previous sibling node of the current node</refpurpose>
</refnamediv>

<refsect1 role="description">
&reftitle.description;
<methodsynopsis role="tidyNode">
<modifier>public</modifier> <type class="union"><type>tidyNode</type><type>null</type></type><methodname>tidyNode::getPreviousSibling</methodname>
<void/>
</methodsynopsis>
<simpara>
Returns the previous sibling node of the current node.
</simpara>
</refsect1>

<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
</refsect1>

<refsect1 role="returnvalues">
&reftitle.returnvalues;
<simpara>
Returns a <type>tidyNode</type> if the node has a previous sibling, or &null;
otherwise.
</simpara>
</refsect1>

<refsect1 role="examples">
&reftitle.examples;
<example>
<title><function>tidyNode::getPreviousSibling</function> example</title>
<programlisting role="php">
<![CDATA[
<?php

$html = <<< HTML
<html>
<head>
</head>
<body>
<p>Hello</p><p>World</p>
</body>
</html>

HTML;


$tidy = tidy_parse_string($html);

$node = $tidy->body();
var_dump($node->child[1]->getPreviousSibling()->value);

?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
string(13) "<p>Hello</p>
"
]]>
</screen>
</example>
</refsect1>

<refsect1 role="seealso">
&reftitle.seealso;
<simplelist>
<member><function>tidy::getParent</function></member>
<member><function>tidy::getNextSibling</function></member>
</simplelist>
</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
-->
3 changes: 3 additions & 0 deletions reference/tidy/versions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@
<function name="tidynode::isphp" from="PHP 5, PHP 7, PHP 8"/>
<function name="tidynode::istext" from="PHP 5, PHP 7, PHP 8"/>
<function name="tidynode::isxhtml" from="PHP 5, PHP 7, PHP 8"/>

<function name="tidynode::getnextsibling" from="PHP 8 &gt;= 8.4.0"/>
<function name="tidynode::getprevioussibling" from="PHP 8 &gt;= 8.4.0"/>
</versions>
<!-- Keep this comment at the end of the file
Local variables:
Expand Down