Skip to content

Commit 024620a

Browse files
VincentLangletisfedorov
authored andcommitted
Throws PDOException
1 parent 56e4916 commit 024620a

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

PDO/PDO.php

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -958,6 +958,7 @@ public function __construct(
958958
* <b>PDO::prepare</b> returns <b>FALSE</b> or emits
959959
* <b>PDOException</b> (depending on error handling).
960960
* </p>
961+
* @throws PDOException On error if PDO::ERRMODE_EXCEPTION option is true.
961962
* <p>
962963
* Emulated prepared statements does not communicate with the database server
963964
* so <b>PDO::prepare</b> does not check the statement.
@@ -1031,6 +1032,7 @@ public function inTransaction(): bool {}
10311032
* @param int $attribute
10321033
* @param mixed $value
10331034
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
1035+
* @throws PDOException On error if PDO::ERRMODE_EXCEPTION option is true.
10341036
*/
10351037
#[TentativeType]
10361038
public function setAttribute(
@@ -1065,6 +1067,7 @@ public function setAttribute(
10651067
* <code>
10661068
* $db->exec() or die(print_r($db->errorInfo(), true));
10671069
* </code>
1070+
* @throws PDOException On error if PDO::ERRMODE_EXCEPTION option is true.
10681071
*/
10691072
#[TentativeType]
10701073
public function exec(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $statement): int|false {}
@@ -1090,7 +1093,8 @@ public function exec(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')]
10901093
* parameter is set to <b>PDO::FETCH_CLASS</b>.
10911094
* </p>
10921095
* @return PDOStatement|false <b>PDO::query</b> returns a PDOStatement object, or <b>FALSE</b>
1093-
* on failure.
1096+
* on failure or emits <b>PDOException</b> (depending on error handling)
1097+
* @throws PDOException On error if PDO::ERRMODE_EXCEPTION option is true.
10941098
* @see PDOStatement::setFetchMode For a full description of the second and following parameters.
10951099
*/
10961100
#[PhpStormStubsElementAvailable(to: '7.4')]
@@ -1114,7 +1118,8 @@ public function query($query, $fetchMode = PDO::ATTR_DEFAULT_FETCH_MODE, $arg3 =
11141118
* parameter is set to <b>PDO::FETCH_CLASS</b>.
11151119
* </p>
11161120
* @return PDOStatement|false <b>PDO::query</b> returns a PDOStatement object, or <b>FALSE</b>
1117-
* on failure.
1121+
* on failure or emits <b>PDOException</b> (depending on error handling).
1122+
* @throws PDOException On error if PDO::ERRMODE_EXCEPTION option is true.
11181123
* @see PDOStatement::setFetchMode For a full description of the second and following parameters.
11191124
*/
11201125
#[PhpStormStubsElementAvailable('8.0')]
@@ -1245,6 +1250,7 @@ public function errorInfo(): array {}
12451250
* </p>
12461251
* @return mixed A successful call returns the value of the requested PDO attribute.
12471252
* An unsuccessful call returns null.
1253+
* @throws PDOException when the underlying driver does not support the requested attribute.
12481254
*/
12491255
#[TentativeType]
12501256
public function getAttribute(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $attribute): mixed {}
@@ -1488,6 +1494,7 @@ public function pgsqlGetPid() {}
14881494

14891495
/**
14901496
* @since 8.4
1497+
* @throws PDOException if the attempt to connect to the requested database fails, regardless of which PDO::ATTR_ERRMODE is currently set.
14911498
*/
14921499
public static function connect(string $dsn, ?string $username = null, ?string $password = null, ?array $options = null): static {}
14931500
}
@@ -1559,6 +1566,7 @@ public function execute(#[LanguageLevelTypeAware(['8.0' => 'array|null'], defaul
15591566
* @param int $cursorOffset [optional]
15601567
* @return mixed The return value of this function on success depends on the fetch type. In
15611568
* all cases, <b>FALSE</b> is returned on failure.
1569+
* @throws PDOException On error if PDO::ERRMODE_EXCEPTION option is true.
15621570
*/
15631571
#[TentativeType]
15641572
public function fetch(
@@ -1596,6 +1604,7 @@ public function fetch(
15961604
* @param mixed $driverOptions [optional] <p>
15971605
* </p>
15981606
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
1607+
* @throws PDOException On error if PDO::ERRMODE_EXCEPTION option is true.
15991608
*/
16001609
#[TentativeType]
16011610
public function bindParam(
@@ -1628,6 +1637,7 @@ public function bindParam(
16281637
* Optional parameter(s) for the driver.
16291638
* </p>
16301639
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
1640+
* @throws PDOException On error if PDO::ERRMODE_EXCEPTION option is true.
16311641
*/
16321642
#[TentativeType]
16331643
public function bindColumn(
@@ -1657,6 +1667,7 @@ public function bindColumn(
16571667
* constants.
16581668
* </p>
16591669
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
1670+
* @throws PDOException On error if PDO::ERRMODE_EXCEPTION option is true.
16601671
*/
16611672
#[TentativeType]
16621673
public function bindValue(
@@ -1670,6 +1681,7 @@ public function bindValue(
16701681
* Returns the number of rows affected by the last SQL statement
16711682
* @link https://php.net/manual/en/pdostatement.rowcount.php
16721683
* @return int the number of rows.
1684+
* @throws PDOException On error if PDO::ERRMODE_EXCEPTION option is true.
16731685
*/
16741686
#[TentativeType]
16751687
public function rowCount(): int {}
@@ -1689,6 +1701,7 @@ public function rowCount(): int {}
16891701
* <p>
16901702
* There is no way to return another column from the same row if you
16911703
* use <b>PDOStatement::fetchColumn</b> to retrieve data.
1704+
* @throws PDOException On error if PDO::ERRMODE_EXCEPTION option is true.
16921705
*/
16931706
#[TentativeType]
16941707
public function fetchColumn(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $column = 0): mixed {}
@@ -1761,6 +1774,7 @@ public function fetchAll(
17611774
* </p>
17621775
* @return T|stdClass|null an instance of the required class with property names that
17631776
* correspond to the column names or <b>FALSE</b> on failure.
1777+
* @throws PDOException On error if PDO::ERRMODE_EXCEPTION option is true.
17641778
*/
17651779
#[TentativeType]
17661780
public function fetchObject(
@@ -1815,6 +1829,7 @@ public function errorInfo(): array {}
18151829
* @param int $attribute
18161830
* @param mixed $value
18171831
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
1832+
* @throws PDOException On error if PDO::ERRMODE_EXCEPTION option is true.
18181833
*/
18191834
#[TentativeType]
18201835
public function setAttribute(
@@ -1839,6 +1854,7 @@ public function getAttribute(#[LanguageLevelTypeAware(['8.0' => 'int'], default:
18391854
* @return int the number of columns in the result set represented by the
18401855
* PDOStatement object. If there is no result set,
18411856
* <b>PDOStatement::columnCount</b> returns 0.
1857+
* @throws PDOException On error if PDO::ERRMODE_EXCEPTION option is true.
18421858
*/
18431859
#[TentativeType]
18441860
public function columnCount(): int {}
@@ -1925,6 +1941,7 @@ public function getColumnMeta(#[LanguageLevelTypeAware(['8.0' => 'int'], default
19251941
* </p>
19261942
* @param mixed ...$args <p> Constructor arguments. </p>
19271943
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
1944+
* @throws PDOException On error if PDO::ERRMODE_EXCEPTION option is true.
19281945
*/
19291946
public function setFetchMode($mode, ...$args) {}
19301947

@@ -1933,6 +1950,7 @@ public function setFetchMode($mode, ...$args) {}
19331950
* Advances to the next rowset in a multi-rowset statement handle
19341951
* @link https://php.net/manual/en/pdostatement.nextrowset.php
19351952
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
1953+
* @throws PDOException On error if PDO::ERRMODE_EXCEPTION option is true.
19361954
*/
19371955
#[TentativeType]
19381956
public function nextRowset(): bool {}
@@ -1942,6 +1960,7 @@ public function nextRowset(): bool {}
19421960
* Closes the cursor, enabling the statement to be executed again.
19431961
* @link https://php.net/manual/en/pdostatement.closecursor.php
19441962
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
1963+
* @throws PDOException On error if PDO::ERRMODE_EXCEPTION option is true.
19451964
*/
19461965
#[TentativeType]
19471966
public function closeCursor(): bool {}

0 commit comments

Comments
 (0)