Skip to content

Commit 65a1dc5

Browse files
authored
Generate methodsynopses from stubs for ext/intl (IntlCalendar) (#996)
1 parent 3ef3e56 commit 65a1dc5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+285
-466
lines changed

language-snippets.ent

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1055,6 +1055,10 @@ Passing untrusted data to this parameter is <emphasis>insecure</emphasis>, unles
10551055

10561056
<!-- intl notes -->
10571057

1058+
<!ENTITY intl.parameter.intl-calendar '<para xmlns="http://docbook.org/ns/docbook">An <classname>IntlCalendar</classname> instance.</para>'>
1059+
1060+
<!ENTITY intl.error.intl-calendar '<para xmlns="http://docbook.org/ns/docbook">On failure &false; is also returned. To detect error conditions use <function>intl_get_error_code</function>, or set up Intl to throw <link linkend="ini.intl.use-exceptions">exceptions</link>.</para>'>
1061+
10581062
<!ENTITY intl.codepoint.parameter '<para xmlns="http://docbook.org/ns/docbook">The <type>int</type> codepoint value (e.g. <literal>0x2603</literal> for <emphasis>U+2603 SNOWMAN</emphasis>), or the character encoded as a UTF-8 <type>string</type> (e.g. <literal>"\u{2603}"</literal>)</para>'>
10591063

10601064
<!ENTITY intl.codepoint.return '<para xmlns="http://docbook.org/ns/docbook">The return type will be <type>int</type> unless the code point was passed as a UTF-8 <type>string</type>, in which case a <type>string</type> will be returned.</para>'>

reference/intl/intlcalendar.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@
268268
</fieldsynopsis>
269269

270270
<classsynopsisinfo role="comment">&Methods;</classsynopsisinfo>
271+
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.intlcalendar')/db:refentry/db:refsect1[@role='description']/descendant::db:constructorsynopsis[1])" />
271272
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.intlcalendar')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[not(@role='procedural')])" />
272273
</classsynopsis>
273274
<!-- }}} -->

reference/intl/intlcalendar/add.xml

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
3-
43
<refentry xml:id="intlcalendar.add" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
54
<refnamediv>
65
<refname>IntlCalendar::add</refname>
@@ -12,19 +11,19 @@
1211
<para>
1312
&style.oop;
1413
</para>
15-
<methodsynopsis>
14+
<methodsynopsis role="oop">
1615
<modifier>public</modifier> <type>bool</type><methodname>IntlCalendar::add</methodname>
1716
<methodparam><type>int</type><parameter>field</parameter></methodparam>
18-
<methodparam><type>int</type><parameter>amount</parameter></methodparam>
17+
<methodparam><type>int</type><parameter>value</parameter></methodparam>
1918
</methodsynopsis>
2019
<para>
2120
&style.procedural;
2221
</para>
2322
<methodsynopsis role="procedural">
2423
<type>bool</type><methodname>intlcal_add</methodname>
25-
<methodparam><type>IntlCalendar</type><parameter>cal</parameter></methodparam>
24+
<methodparam><type>IntlCalendar</type><parameter>calendar</parameter></methodparam>
2625
<methodparam><type>int</type><parameter>field</parameter></methodparam>
27-
<methodparam><type>int</type><parameter>amount</parameter></methodparam>
26+
<methodparam><type>int</type><parameter>value</parameter></methodparam>
2827
</methodsynopsis>
2928
<para>
3029
Add a signed amount to a field. Adding a positive amount allows advances in
@@ -44,11 +43,9 @@
4443
&reftitle.parameters;
4544
<variablelist>
4645
<varlistentry>
47-
<term><parameter>cal</parameter></term>
46+
<term><parameter>calendar</parameter></term>
4847
<listitem>
49-
<para>
50-
The IntlCalendar resource.
51-
</para>
48+
&intl.parameter.intl-calendar;
5249
</listitem>
5350
</varlistentry>
5451
<varlistentry>
@@ -58,7 +55,7 @@
5855
</listitem>
5956
</varlistentry>
6057
<varlistentry>
61-
<term><parameter>amount</parameter></term>
58+
<term><parameter>value</parameter></term>
6259
<listitem>
6360
<para>
6461
The signed amount to add to the current field. If the amount is positive,
@@ -113,7 +110,6 @@ echo IntlDateFormatter::formatObject($cal), "\n";
113110
</refsect1>
114111

115112
</refentry>
116-
117113
<!-- Keep this comment at the end of the file
118114
Local variables:
119115
mode: sgml

reference/intl/intlcalendar/after.xml

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
3-
43
<refentry xml:id="intlcalendar.after" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
54
<refnamediv>
65
<refname>IntlCalendar::after</refname>
@@ -12,7 +11,7 @@
1211
<para>
1312
&style.oop;
1413
</para>
15-
<methodsynopsis>
14+
<methodsynopsis role="oop">
1615
<modifier>public</modifier> <type>bool</type><methodname>IntlCalendar::after</methodname>
1716
<methodparam><type>IntlCalendar</type><parameter>other</parameter></methodparam>
1817
</methodsynopsis>
@@ -21,7 +20,7 @@
2120
</para>
2221
<methodsynopsis role="procedural">
2322
<type>bool</type><methodname>intlcal_after</methodname>
24-
<methodparam><type>IntlCalendar</type><parameter>cal</parameter></methodparam>
23+
<methodparam><type>IntlCalendar</type><parameter>calendar</parameter></methodparam>
2524
<methodparam><type>IntlCalendar</type><parameter>other</parameter></methodparam>
2625
</methodsynopsis>
2726
<para>
@@ -33,11 +32,9 @@
3332
&reftitle.parameters;
3433
<variablelist>
3534
<varlistentry>
36-
<term><parameter>cal</parameter></term>
35+
<term><parameter>calendar</parameter></term>
3736
<listitem>
38-
<para>
39-
The IntlCalendar resource.
40-
</para>
37+
&intl.parameter.intl-calendar;
4138
</listitem>
4239
</varlistentry>
4340
<varlistentry>
@@ -56,10 +53,8 @@
5653
<para>
5754
Returns &true; if this objectʼs current time is after that of the
5855
<parameter>calendar</parameter> argumentʼs time. Returns &false; otherwise.
59-
Also returns &false; on failure. You can use <link
60-
linkend="ini.intl.use-exceptions">exceptions</link> or
61-
<function>intl_get_error_code</function> to detect error conditions.
6256
</para>
57+
&intl.error.intl-calendar;
6358
</refsect1>
6459

6560

@@ -89,7 +84,6 @@ var_dump($cal1->after($cal2), //true
8984
</refsect1>
9085

9186
</refentry>
92-
9387
<!-- Keep this comment at the end of the file
9488
Local variables:
9589
mode: sgml

reference/intl/intlcalendar/before.xml

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
3-
43
<refentry xml:id="intlcalendar.before" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
54
<refnamediv>
65
<refname>IntlCalendar::before</refname>
@@ -12,7 +11,7 @@
1211
<para>
1312
&style.oop;
1413
</para>
15-
<methodsynopsis>
14+
<methodsynopsis role="oop">
1615
<modifier>public</modifier> <type>bool</type><methodname>IntlCalendar::before</methodname>
1716
<methodparam><type>IntlCalendar</type><parameter>other</parameter></methodparam>
1817
</methodsynopsis>
@@ -21,7 +20,7 @@
2120
</para>
2221
<methodsynopsis role="procedural">
2322
<type>bool</type><methodname>intlcal_before</methodname>
24-
<methodparam><type>IntlCalendar</type><parameter>cal</parameter></methodparam>
23+
<methodparam><type>IntlCalendar</type><parameter>calendar</parameter></methodparam>
2524
<methodparam><type>IntlCalendar</type><parameter>other</parameter></methodparam>
2625
</methodsynopsis>
2726
<para>
@@ -33,11 +32,9 @@
3332
&reftitle.parameters;
3433
<variablelist>
3534
<varlistentry>
36-
<term><parameter>cal</parameter></term>
35+
<term><parameter>calendar</parameter></term>
3736
<listitem>
38-
<para>
39-
The IntlCalendar resource.
40-
</para>
37+
&intl.parameter.intl-calendar;
4138
</listitem>
4239
</varlistentry>
4340
<varlistentry>
@@ -56,14 +53,11 @@
5653
<para>
5754
Returns &true; if this objectʼs current time is before that of the
5855
<parameter>calendar</parameter> argumentʼs time. Returns &false; otherwise.
59-
Also returns &false; on failure. You can use <link
60-
linkend="ini.intl.use-exceptions">exceptions</link> or
61-
<function>intl_get_error_code</function> to detect error conditions.
6256
</para>
57+
&intl.error.intl-calendar;
6358
</refsect1>
6459

6560
</refentry>
66-
6761
<!-- Keep this comment at the end of the file
6862
Local variables:
6963
mode: sgml

reference/intl/intlcalendar/clear.xml

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
3-
43
<refentry xml:id="intlcalendar.clear" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
54
<refnamediv>
65
<refname>IntlCalendar::clear</refname>
@@ -12,17 +11,17 @@
1211
<para>
1312
&style.oop;
1413
</para>
15-
<methodsynopsis>
14+
<methodsynopsis role="oop">
1615
<modifier>public</modifier> <type>bool</type><methodname>IntlCalendar::clear</methodname>
17-
<methodparam choice="opt"><type>int</type><parameter>field</parameter><initializer>NULL</initializer></methodparam>
16+
<methodparam choice="opt"><type class="union"><type>int</type><type>null</type></type><parameter>field</parameter><initializer>&null;</initializer></methodparam>
1817
</methodsynopsis>
1918
<para>
2019
&style.procedural;
2120
</para>
2221
<methodsynopsis role="procedural">
2322
<type>bool</type><methodname>intlcal_clear</methodname>
24-
<methodparam><type>IntlCalendar</type><parameter>cal</parameter></methodparam>
25-
<methodparam choice="opt"><type>int</type><parameter>field</parameter><initializer>NULL</initializer></methodparam>
23+
<methodparam><type>IntlCalendar</type><parameter>calendar</parameter></methodparam>
24+
<methodparam choice="opt"><type class="union"><type>int</type><type>null</type></type><parameter>field</parameter><initializer>&null;</initializer></methodparam>
2625
</methodsynopsis>
2726
<para>
2827
Clears either all of the fields or a specific field. A cleared field is
@@ -38,11 +37,9 @@
3837
&reftitle.parameters;
3938
<variablelist>
4039
<varlistentry>
41-
<term><parameter>cal</parameter></term>
40+
<term><parameter>calendar</parameter></term>
4241
<listitem>
43-
<para>
44-
The IntlCalendar resource.
45-
</para>
42+
&intl.parameter.intl-calendar;
4643
</listitem>
4744
</varlistentry>
4845
<varlistentry>
@@ -57,8 +54,7 @@
5754
<refsect1 role="returnvalues">
5855
&reftitle.returnvalues;
5956
<para>
60-
Returns &true; on success&return.falseforfailure;. Failure can only occur is
61-
invalid arguments are provided.
57+
&return.true.always;
6258
</para>
6359
</refsect1>
6460

@@ -213,7 +209,6 @@ Array
213209
</refsect1>
214210

215211
</refentry>
216-
217212
<!-- Keep this comment at the end of the file
218213
Local variables:
219214
mode: sgml

reference/intl/intlcalendar/construct.xml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
3-
43
<refentry xml:id="intlcalendar.construct" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
54
<refnamediv>
65
<refname>IntlCalendar::__construct</refname>
@@ -9,10 +8,10 @@
98

109
<refsect1 role="description">
1110
&reftitle.description;
12-
<methodsynopsis>
11+
<constructorsynopsis>
1312
<modifier>private</modifier> <methodname>IntlCalendar::__construct</methodname>
14-
<void />
15-
</methodsynopsis>
13+
<void/>
14+
</constructorsynopsis>
1615
<para>
1716
A private constructor for disallowing instantiation with the
1817
<link linkend="language.oop5.basic.new">new</link> operator.
@@ -35,7 +34,6 @@
3534
</refsect1>
3635

3736
</refentry>
38-
3937
<!-- Keep this comment at the end of the file
4038
Local variables:
4139
mode: sgml

reference/intl/intlcalendar/createinstance.xml

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
3-
43
<refentry xml:id="intlcalendar.createinstance" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
54
<refnamediv>
65
<refname>IntlCalendar::createInstance</refname>
@@ -12,18 +11,18 @@
1211
<para>
1312
&style.oop;
1413
</para>
15-
<methodsynopsis>
16-
<modifier>public</modifier> <modifier>static</modifier> <type>IntlCalendar</type><methodname>IntlCalendar::createInstance</methodname>
17-
<methodparam choice="opt"><type>mixed</type><parameter>timeZone</parameter><initializer>NULL</initializer></methodparam>
18-
<methodparam choice="opt"><type>string</type><parameter>locale</parameter><initializer>""</initializer></methodparam>
14+
<methodsynopsis role="oop">
15+
<modifier>public</modifier> <modifier>static</modifier> <type class="union"><type>IntlCalendar</type><type>null</type></type><methodname>IntlCalendar::createInstance</methodname>
16+
<methodparam choice="opt"><type class="union"><type>IntlTimeZone</type><type>DateTimeZone</type><type>string</type><type>null</type></type><parameter>timezone</parameter><initializer>&null;</initializer></methodparam>
17+
<methodparam choice="opt"><type class="union"><type>string</type><type>null</type></type><parameter>locale</parameter><initializer>&null;</initializer></methodparam>
1918
</methodsynopsis>
2019
<para>
2120
&style.procedural;
2221
</para>
2322
<methodsynopsis role="procedural">
24-
<type>IntlCalendar</type><methodname>intlcal_create_instance</methodname>
25-
<methodparam choice="opt"><type>mixed</type><parameter>timeZone</parameter><initializer>NULL</initializer></methodparam>
26-
<methodparam choice="opt"><type>string</type><parameter>locale</parameter><initializer>""</initializer></methodparam>
23+
<type class="union"><type>IntlCalendar</type><type>null</type></type><methodname>intlcal_create_instance</methodname>
24+
<methodparam choice="opt"><type class="union"><type>IntlTimeZone</type><type>DateTimeZone</type><type>string</type><type>null</type></type><parameter>timezone</parameter><initializer>&null;</initializer></methodparam>
25+
<methodparam choice="opt"><type class="union"><type>string</type><type>null</type></type><parameter>locale</parameter><initializer>&null;</initializer></methodparam>
2726
</methodsynopsis>
2827
<para>
2928
Given a timezone and locale, this method creates an
@@ -42,7 +41,7 @@
4241
&reftitle.parameters;
4342
<variablelist>
4443
<varlistentry>
45-
<term><parameter>timeZone</parameter></term>
44+
<term><parameter>timezone</parameter></term>
4645
<listitem>
4746
<para>
4847
The timezone to use.
@@ -54,8 +53,7 @@
5453
<term><parameter>locale</parameter></term>
5554
<listitem>
5655
<para>
57-
A locale to use or &null; to use <link
58-
linkend="ini.intl.default-locale">the default locale</link>.
56+
A locale to use or &null; to use <link linkend="ini.intl.default-locale">the default locale</link>.
5957
</para>
6058
</listitem>
6159
</varlistentry>
@@ -131,7 +129,6 @@ string(70) "martes 28 de Khordad de 1392 14:11:02 Hora de verano de Europa Centr
131129
</refsect1>
132130

133131
</refentry>
134-
135132
<!-- Keep this comment at the end of the file
136133
Local variables:
137134
mode: sgml

0 commit comments

Comments
 (0)