Skip to content

Commit 3d4ee5f

Browse files
Document FILTER_THROW_ON_FAILURE and the Filter exception classes (PHP 8.5) (#5607)
* Document FILTER_THROW_ON_FAILURE and Filter exception classes (PHP 8.5) Co-authored-by: Jordi Kroon <jordikroon@php.net>
1 parent df78bd1 commit 3d4ee5f

4 files changed

Lines changed: 156 additions & 0 deletions

File tree

reference/filter/book.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@
5555
&reference.filter.examples;
5656
&reference.filter.reference;
5757

58+
&reference.filter.filter.filterexception;
59+
&reference.filter.filter.filterfailedexception;
60+
5861
</book>
5962
<!-- Keep this comment at the end of the file
6063
Local variables:

reference/filter/constants.xml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,26 @@
156156
</simpara>
157157
</listitem>
158158
</varlistentry>
159+
<varlistentry xml:id="constant.filter-throw-on-failure">
160+
<term>
161+
<constant>FILTER_THROW_ON_FAILURE</constant>
162+
(<type>int</type>)
163+
</term>
164+
<listitem>
165+
<simpara>
166+
Throws a <exceptionname>Filter\FilterFailedException</exceptionname> when a
167+
validation filter fails, instead of returning &false;.
168+
</simpara>
169+
<simpara>
170+
Can be used with any validation
171+
<constant>FILTER_VALIDATE_<replaceable>*</replaceable></constant>
172+
filter.
173+
</simpara>
174+
<simpara>
175+
Available as of PHP 8.5.0.
176+
</simpara>
177+
</listitem>
178+
</varlistentry>
159179
</variablelist>
160180

161181
<variablelist xml:id="filter.constants.flags.sanitization">
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<reference xml:id="class.filter-filterexception" role="class" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">
3+
<title>The Filter\FilterException class</title>
4+
<titleabbrev>Filter\FilterException</titleabbrev>
5+
6+
<partintro>
7+
<section xml:id="filter-filterexception.intro">
8+
&reftitle.intro;
9+
<simpara>
10+
The base class for <type>Exception</type>s thrown by the Filter extension.
11+
</simpara>
12+
</section>
13+
14+
<section xml:id="filter-filterexception.synopsis">
15+
&reftitle.classsynopsis;
16+
17+
<packagesynopsis>
18+
<package>Filter</package>
19+
20+
<classsynopsis class="class">
21+
<ooexception>
22+
<exceptionname>FilterException</exceptionname>
23+
</ooexception>
24+
25+
<ooclass>
26+
<modifier>extends</modifier>
27+
<classname>Exception</classname>
28+
</ooclass>
29+
30+
<classsynopsisinfo role="comment">&InheritedProperties;</classsynopsisinfo>
31+
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.exception')/db:partintro/db:section/db:classsynopsis/db:fieldsynopsis[preceding-sibling::db:classsynopsisinfo[1][@role='comment' and text()='&Properties;']]))">
32+
<xi:fallback/>
33+
</xi:include>
34+
35+
<classsynopsisinfo role="comment">&InheritedMethods;</classsynopsisinfo>
36+
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.exception')/db:refentry/db:refsect1[@role='description']/descendant::db:constructorsynopsis[@role='Exception'])">
37+
<xi:fallback/>
38+
</xi:include>
39+
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.exception')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[@role='Exception'])">
40+
<xi:fallback/>
41+
</xi:include>
42+
</classsynopsis>
43+
</packagesynopsis>
44+
</section>
45+
</partintro>
46+
</reference>
47+
<!-- Keep this comment at the end of the file
48+
Local variables:
49+
mode: sgml
50+
sgml-omittag:t
51+
sgml-shorttag:t
52+
sgml-minimize-attributes:nil
53+
sgml-always-quote-attributes:t
54+
sgml-indent-step:1
55+
sgml-indent-data:t
56+
indent-tabs-mode:nil
57+
sgml-parent-document:nil
58+
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
59+
sgml-exposed-tags:nil
60+
sgml-local-catalogs:nil
61+
sgml-local-ecat-files:nil
62+
End:
63+
vim600: syn=xml fen fdm=syntax fdl=2 si
64+
vim: et tw=78 syn=sgml
65+
vi: ts=1 sw=1
66+
-->
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<reference xml:id="class.filter-filterfailedexception" role="class" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">
3+
<title>The Filter\FilterFailedException class</title>
4+
<titleabbrev>Filter\FilterFailedException</titleabbrev>
5+
6+
<partintro>
7+
<section xml:id="filter-filterfailedexception.intro">
8+
&reftitle.intro;
9+
<simpara>
10+
Thrown when a validation filter fails and the
11+
<constant>FILTER_THROW_ON_FAILURE</constant> flag is set.
12+
</simpara>
13+
</section>
14+
15+
<section xml:id="filter-filterfailedexception.synopsis">
16+
&reftitle.classsynopsis;
17+
18+
<packagesynopsis>
19+
<package>Filter</package>
20+
21+
<classsynopsis class="class">
22+
<ooexception>
23+
<exceptionname>FilterFailedException</exceptionname>
24+
</ooexception>
25+
26+
<ooclass>
27+
<modifier>extends</modifier>
28+
<classname>Filter\FilterException</classname>
29+
</ooclass>
30+
31+
<classsynopsisinfo role="comment">&InheritedProperties;</classsynopsisinfo>
32+
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.exception')/db:partintro/db:section/db:classsynopsis/db:fieldsynopsis[preceding-sibling::db:classsynopsisinfo[1][@role='comment' and text()='&Properties;']]))">
33+
<xi:fallback/>
34+
</xi:include>
35+
36+
<classsynopsisinfo role="comment">&InheritedMethods;</classsynopsisinfo>
37+
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.exception')/db:refentry/db:refsect1[@role='description']/descendant::db:constructorsynopsis[@role='Exception'])">
38+
<xi:fallback/>
39+
</xi:include>
40+
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.exception')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[@role='Exception'])">
41+
<xi:fallback/>
42+
</xi:include>
43+
</classsynopsis>
44+
</packagesynopsis>
45+
</section>
46+
</partintro>
47+
</reference>
48+
<!-- Keep this comment at the end of the file
49+
Local variables:
50+
mode: sgml
51+
sgml-omittag:t
52+
sgml-shorttag:t
53+
sgml-minimize-attributes:nil
54+
sgml-always-quote-attributes:t
55+
sgml-indent-step:1
56+
sgml-indent-data:t
57+
indent-tabs-mode:nil
58+
sgml-parent-document:nil
59+
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
60+
sgml-exposed-tags:nil
61+
sgml-local-catalogs:nil
62+
sgml-local-ecat-files:nil
63+
End:
64+
vim600: syn=xml fen fdm=syntax fdl=2 si
65+
vim: et tw=78 syn=sgml
66+
vi: ts=1 sw=1
67+
-->

0 commit comments

Comments
 (0)