Skip to content

Commit c9c1581

Browse files
authored
Generate ext/pdo methodsynopses based on stubs (#494)
1 parent fb5362c commit c9c1581

23 files changed

+129
-128
lines changed

reference/pdo/constants.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,17 @@
112112
</simpara>
113113
</listitem>
114114
</varlistentry>
115+
<varlistentry xml:id="pdo.constants.fetch-default">
116+
<term>
117+
<constant>PDO::FETCH_DEFAULT</constant>
118+
(<type>int</type>)
119+
</term>
120+
<listitem>
121+
<simpara>
122+
Specifies that the default fetch mode shall be used.
123+
</simpara>
124+
</listitem>
125+
</varlistentry>
115126
<varlistentry xml:id="pdo.constants.fetch-lazy">
116127
<term>
117128
<constant>PDO::FETCH_LAZY</constant>

reference/pdo/pdo/construct.xml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
<constructorsynopsis>
1313
<modifier>public</modifier> <methodname>PDO::__construct</methodname>
1414
<methodparam><type>string</type><parameter>dsn</parameter></methodparam>
15-
<methodparam choice="opt"><type>string</type><parameter>username</parameter></methodparam>
16-
<methodparam choice="opt"><type>string</type><parameter>passwd</parameter></methodparam>
17-
<methodparam choice="opt"><type>array</type><parameter>options</parameter></methodparam>
15+
<methodparam choice="opt"><type class="union"><type>string</type><type>null</type></type><parameter>username</parameter><initializer>&null;</initializer></methodparam>
16+
<methodparam choice="opt"><type class="union"><type>string</type><type>null</type></type><parameter>password</parameter><initializer>&null;</initializer></methodparam>
17+
<methodparam choice="opt"><type class="union"><type>array</type><type>null</type></type><parameter>options</parameter><initializer>&null;</initializer></methodparam>
1818
</constructorsynopsis>
1919
<para>
2020
Creates a PDO instance to represent a connection to the requested
@@ -198,7 +198,6 @@ $dbh = new PDO($dsn, $user, $password);
198198
</para>
199199
</refsect1>
200200
</refentry>
201-
202201
<!-- Keep this comment at the end of the file
203202
Local variables:
204203
mode: sgml

reference/pdo/pdo/errorcode.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<refsect1 role="description">
1111
&reftitle.description;
1212
<methodsynopsis>
13-
<modifier>public</modifier> <type>string</type><methodname>PDO::errorCode</methodname>
13+
<modifier>public</modifier> <type class="union"><type>string</type><type>null</type></type><methodname>PDO::errorCode</methodname>
1414
<void/>
1515
</methodsynopsis>
1616

@@ -79,7 +79,6 @@ PDO::errorCode(): 42S02
7979
</refsect1>
8080

8181
</refentry>
82-
8382
<!-- Keep this comment at the end of the file
8483
Local variables:
8584
mode: sgml

reference/pdo/pdo/exec.xml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<refsect1 role="description">
1111
&reftitle.description;
1212
<methodsynopsis>
13-
<modifier>public</modifier> <type>int</type><methodname>PDO::exec</methodname>
13+
<modifier>public</modifier> <type class="union"><type>int</type><type>false</type></type><methodname>PDO::exec</methodname>
1414
<methodparam><type>string</type><parameter>statement</parameter></methodparam>
1515
</methodsynopsis>
1616

@@ -40,8 +40,7 @@
4040
The SQL statement to prepare and execute.
4141
</para>
4242
<para>
43-
Data inside the query should be <link
44-
linkend="pdo.quote">properly escaped</link>.
43+
Data inside the query should be <link linkend="pdo.quote">properly escaped</link>.
4544
</para>
4645
</listitem>
4746
</varlistentry>
@@ -118,7 +117,6 @@ Deleted 1 rows.
118117

119118

120119
</refentry>
121-
122120
<!-- Keep this comment at the end of the file
123121
Local variables:
124122
mode: sgml

reference/pdo/pdo/getattribute.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<refsect1 role="description">
1111
&reftitle.description;
1212
<methodsynopsis>
13-
<modifier>public</modifier> <type>mixed</type><methodname>PDO::getAttribute</methodname>
13+
<modifier>public</modifier> <type class="union"><type>bool</type><type>int</type><type>string</type><type>array</type><type>null</type></type><methodname>PDO::getAttribute</methodname>
1414
<methodparam><type>int</type><parameter>attribute</parameter></methodparam>
1515
</methodsynopsis>
1616

@@ -113,7 +113,6 @@ Use the PEAR Coding Standards
113113

114114

115115
</refentry>
116-
117116
<!-- Keep this comment at the end of the file
118117
Local variables:
119118
mode: sgml

reference/pdo/pdo/lastinsertid.xml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
<refsect1 role="description">
1111
&reftitle.description;
1212
<methodsynopsis>
13-
<modifier>public</modifier> <type>string</type><methodname>PDO::lastInsertId</methodname>
14-
<methodparam choice="opt"><type>string</type><parameter>name</parameter><initializer>&null;</initializer></methodparam>
13+
<modifier>public</modifier> <type class="union"><type>string</type><type>false</type></type><methodname>PDO::lastInsertId</methodname>
14+
<methodparam choice="opt"><type class="union"><type>string</type><type>null</type></type><parameter>name</parameter><initializer>&null;</initializer></methodparam>
1515
</methodsynopsis>
1616

1717
<para>
@@ -67,7 +67,6 @@
6767
</refsect1>
6868

6969
</refentry>
70-
7170
<!-- Keep this comment at the end of the file
7271
Local variables:
7372
mode: sgml

reference/pdo/pdo/prepare.xml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
<refsect1 role="description">
1111
&reftitle.description;
1212
<methodsynopsis>
13-
<modifier>public</modifier> <type>PDOStatement</type><methodname>PDO::prepare</methodname>
14-
<methodparam><type>string</type><parameter>statement</parameter></methodparam>
15-
<methodparam choice="opt"><type>array</type><parameter>driver_options</parameter><initializer>array()</initializer></methodparam>
13+
<modifier>public</modifier> <type class="union"><type>PDOStatement</type><type>false</type></type><methodname>PDO::prepare</methodname>
14+
<methodparam><type>string</type><parameter>query</parameter></methodparam>
15+
<methodparam choice="opt"><type>array</type><parameter>options</parameter><initializer>[]</initializer></methodparam>
1616
</methodsynopsis>
1717

1818
<para>
@@ -72,15 +72,15 @@
7272
<para>
7373
<variablelist>
7474
<varlistentry>
75-
<term><parameter>statement</parameter></term>
75+
<term><parameter>query</parameter></term>
7676
<listitem>
7777
<para>
7878
This must be a valid SQL statement template for the target database server.
7979
</para>
8080
</listitem>
8181
</varlistentry>
8282
<varlistentry>
83-
<term><parameter>driver_options</parameter></term>
83+
<term><parameter>options</parameter></term>
8484
<listitem>
8585
<para>
8686
This array holds one or more key=&gt;value pairs to set
@@ -105,8 +105,7 @@
105105
<classname>PDOStatement</classname> object.
106106
If the database server cannot successfully prepare the statement,
107107
<function>PDO::prepare</function> returns &false; or emits
108-
<classname>PDOException</classname> (depending on <link
109-
linkend="pdo.error-handling">error handling</link>).
108+
<classname>PDOException</classname> (depending on <link linkend="pdo.error-handling">error handling</link>).
110109
</para>
111110
<note>
112111
<para>
@@ -167,7 +166,6 @@ $yellow = $sth->fetchAll();
167166
</para>
168167
</refsect1>
169168
</refentry>
170-
171169
<!-- Keep this comment at the end of the file
172170
Local variables:
173171
mode: sgml

reference/pdo/pdo/query.xml

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,29 +10,30 @@
1010
<refsect1 role="description">
1111
&reftitle.description;
1212
<methodsynopsis>
13-
<modifier>public</modifier> <type>PDOStatement</type><methodname>PDO::query</methodname>
14-
<methodparam><type>string</type><parameter>statement</parameter></methodparam>
13+
<modifier>public</modifier> <type class="union"><type>PDOStatement</type><type>false</type></type><methodname>PDO::query</methodname>
14+
<methodparam><type>string</type><parameter>query</parameter></methodparam>
15+
<methodparam choice="opt"><type class="union"><type>int</type><type>null</type></type><parameter>fetchMode</parameter><initializer>&null;</initializer></methodparam>
1516
</methodsynopsis>
1617

1718
<methodsynopsis>
18-
<modifier>public</modifier> <type>PDOStatement</type><methodname>PDO::query</methodname>
19-
<methodparam><type>string</type><parameter>statement</parameter></methodparam>
20-
<methodparam><type>int</type><parameter>fetch_style</parameter><initializer>PDO::FETCH_COLUMN</initializer></methodparam>
19+
<modifier>public</modifier> <type class="union"><type>PDOStatement</type><type>false</type></type><methodname>PDO::query</methodname>
20+
<methodparam><type>string</type><parameter>query</parameter></methodparam>
21+
<methodparam choice="opt"><type class="union"><type>int</type><type>null</type></type><parameter>fetchMode</parameter><initializer>PDO::FETCH_COLUMN</initializer></methodparam>
2122
<methodparam><type>int</type><parameter>colno</parameter></methodparam>
2223
</methodsynopsis>
2324

2425
<methodsynopsis>
25-
<modifier>public</modifier> <type>PDOStatement</type><methodname>PDO::query</methodname>
26-
<methodparam><type>string</type><parameter>statement</parameter></methodparam>
27-
<methodparam><type>int</type><parameter>fetch_style</parameter><initializer>PDO::FETCH_CLASS</initializer></methodparam>
26+
<modifier>public</modifier> <type class="union"><type>PDOStatement</type><type>false</type></type><methodname>PDO::query</methodname>
27+
<methodparam><type>string</type><parameter>query</parameter></methodparam>
28+
<methodparam choice="opt"><type class="union"><type>int</type><type>null</type></type><parameter>fetchMode</parameter><initializer>PDO::FETCH_CLASS</initializer></methodparam>
2829
<methodparam><type>string</type><parameter>classname</parameter></methodparam>
29-
<methodparam><type>array</type><parameter>ctorargs</parameter></methodparam>
30+
<methodparam><type>array</type><parameter>constructorArgs</parameter></methodparam>
3031
</methodsynopsis>
3132

3233
<methodsynopsis>
33-
<modifier>public</modifier> <type>PDOStatement</type><methodname>PDO::query</methodname>
34-
<methodparam><type>string</type><parameter>statement</parameter></methodparam>
35-
<methodparam><type>int</type><parameter>fetch_style</parameter><initializer>PDO::FETCH_INTO</initializer></methodparam>
34+
<modifier>public</modifier> <type class="union"><type>PDOStatement</type><type>false</type></type><methodname>PDO::query</methodname>
35+
<methodparam><type>string</type><parameter>query</parameter></methodparam>
36+
<methodparam choice="opt"><type class="union"><type>int</type><type>null</type></type><parameter>fetchMode</parameter><initializer>PDO::FETCH_INTO</initializer></methodparam>
3637
<methodparam><type>object</type><parameter>object</parameter></methodparam>
3738
</methodsynopsis>
3839

@@ -70,14 +71,13 @@
7071
<para>
7172
<variablelist>
7273
<varlistentry>
73-
<term><parameter>statement</parameter></term>
74+
<term><parameter>query</parameter></term>
7475
<listitem>
7576
<para>
7677
The SQL statement to prepare and execute.
7778
</para>
7879
<para>
79-
Data inside the query should be <link
80-
linkend="pdo.quote">properly escaped</link>.
80+
Data inside the query should be <link linkend="pdo.quote">properly escaped</link>.
8181
</para>
8282
</listitem>
8383
</varlistentry>
@@ -144,7 +144,6 @@ watermelon pink 90
144144

145145

146146
</refentry>
147-
148147
<!-- Keep this comment at the end of the file
149148
Local variables:
150149
mode: sgml

reference/pdo/pdo/quote.xml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
<refsect1 role="description">
1111
&reftitle.description;
1212
<methodsynopsis>
13-
<modifier>public</modifier> <type>string</type><methodname>PDO::quote</methodname>
13+
<modifier>public</modifier> <type class="union"><type>string</type><type>false</type></type><methodname>PDO::quote</methodname>
1414
<methodparam><type>string</type><parameter>string</parameter></methodparam>
15-
<methodparam choice="opt"><type>int</type><parameter>parameter_type</parameter><initializer>PDO::PARAM_STR</initializer></methodparam>
15+
<methodparam choice="opt"><type>int</type><parameter>type</parameter><initializer>PDO::PARAM_STR</initializer></methodparam>
1616
</methodsynopsis>
1717

1818
<para>
@@ -57,7 +57,7 @@
5757
</listitem>
5858
</varlistentry>
5959
<varlistentry>
60-
<term><parameter>parameter_type</parameter></term>
60+
<term><parameter>type</parameter></term>
6161
<listitem>
6262
<para>
6363
Provides a data type hint for drivers that have alternate quoting styles.
@@ -168,7 +168,6 @@ Quoted string: 'Co''mpl''''ex "st''"ring'
168168
</refsect1>
169169

170170
</refentry>
171-
172171
<!-- Keep this comment at the end of the file
173172
Local variables:
174173
mode: sgml

reference/pdo/pdo/setattribute.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<methodsynopsis>
1313
<modifier>public</modifier> <type>bool</type><methodname>PDO::setAttribute</methodname>
1414
<methodparam><type>int</type><parameter>attribute</parameter></methodparam>
15-
<methodparam><type>mixed</type><parameter>value</parameter></methodparam>
15+
<methodparam><type class="union"><type>array</type><type>int</type></type><parameter>value</parameter></methodparam>
1616
</methodsynopsis>
1717

1818
<para>
@@ -106,7 +106,6 @@
106106
</refsect1>
107107

108108
</refentry>
109-
110109
<!-- Keep this comment at the end of the file
111110
Local variables:
112111
mode: sgml

0 commit comments

Comments
 (0)