@@ -958,6 +958,7 @@ public function __construct(
958
958
* <b>PDO::prepare</b> returns <b>FALSE</b> or emits
959
959
* <b>PDOException</b> (depending on error handling).
960
960
* </p>
961
+ * @throws PDOException On error if PDO::ERRMODE_EXCEPTION option is true.
961
962
* <p>
962
963
* Emulated prepared statements does not communicate with the database server
963
964
* so <b>PDO::prepare</b> does not check the statement.
@@ -1031,6 +1032,7 @@ public function inTransaction(): bool {}
1031
1032
* @param int $attribute
1032
1033
* @param mixed $value
1033
1034
* @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.
1034
1036
*/
1035
1037
#[TentativeType]
1036
1038
public function setAttribute (
@@ -1065,6 +1067,7 @@ public function setAttribute(
1065
1067
* <code>
1066
1068
* $db->exec() or die(print_r($db->errorInfo(), true));
1067
1069
* </code>
1070
+ * @throws PDOException On error if PDO::ERRMODE_EXCEPTION option is true.
1068
1071
*/
1069
1072
#[TentativeType]
1070
1073
public function exec (#[LanguageLevelTypeAware(['8.0 ' => 'string ' ], default: '' )] $ statement ): int |false {}
@@ -1090,7 +1093,8 @@ public function exec(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')]
1090
1093
* parameter is set to <b>PDO::FETCH_CLASS</b>.
1091
1094
* </p>
1092
1095
* @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.
1094
1098
* @see PDOStatement::setFetchMode For a full description of the second and following parameters.
1095
1099
*/
1096
1100
#[PhpStormStubsElementAvailable(to: '7.4 ' )]
@@ -1114,7 +1118,8 @@ public function query($query, $fetchMode = PDO::ATTR_DEFAULT_FETCH_MODE, $arg3 =
1114
1118
* parameter is set to <b>PDO::FETCH_CLASS</b>.
1115
1119
* </p>
1116
1120
* @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.
1118
1123
* @see PDOStatement::setFetchMode For a full description of the second and following parameters.
1119
1124
*/
1120
1125
#[PhpStormStubsElementAvailable('8.0 ' )]
@@ -1245,6 +1250,7 @@ public function errorInfo(): array {}
1245
1250
* </p>
1246
1251
* @return mixed A successful call returns the value of the requested PDO attribute.
1247
1252
* An unsuccessful call returns null.
1253
+ * @throws PDOException when the underlying driver does not support the requested attribute.
1248
1254
*/
1249
1255
#[TentativeType]
1250
1256
public function getAttribute (#[LanguageLevelTypeAware(['8.0 ' => 'int ' ], default: '' )] $ attribute ): mixed {}
@@ -1488,6 +1494,7 @@ public function pgsqlGetPid() {}
1488
1494
1489
1495
/**
1490
1496
* @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.
1491
1498
*/
1492
1499
public static function connect (string $ dsn , ?string $ username = null , ?string $ password = null , ?array $ options = null ): static {}
1493
1500
}
@@ -1559,6 +1566,7 @@ public function execute(#[LanguageLevelTypeAware(['8.0' => 'array|null'], defaul
1559
1566
* @param int $cursorOffset [optional]
1560
1567
* @return mixed The return value of this function on success depends on the fetch type. In
1561
1568
* all cases, <b>FALSE</b> is returned on failure.
1569
+ * @throws PDOException On error if PDO::ERRMODE_EXCEPTION option is true.
1562
1570
*/
1563
1571
#[TentativeType]
1564
1572
public function fetch (
@@ -1596,6 +1604,7 @@ public function fetch(
1596
1604
* @param mixed $driverOptions [optional] <p>
1597
1605
* </p>
1598
1606
* @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.
1599
1608
*/
1600
1609
#[TentativeType]
1601
1610
public function bindParam (
@@ -1628,6 +1637,7 @@ public function bindParam(
1628
1637
* Optional parameter(s) for the driver.
1629
1638
* </p>
1630
1639
* @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.
1631
1641
*/
1632
1642
#[TentativeType]
1633
1643
public function bindColumn (
@@ -1657,6 +1667,7 @@ public function bindColumn(
1657
1667
* constants.
1658
1668
* </p>
1659
1669
* @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.
1660
1671
*/
1661
1672
#[TentativeType]
1662
1673
public function bindValue (
@@ -1670,6 +1681,7 @@ public function bindValue(
1670
1681
* Returns the number of rows affected by the last SQL statement
1671
1682
* @link https://php.net/manual/en/pdostatement.rowcount.php
1672
1683
* @return int the number of rows.
1684
+ * @throws PDOException On error if PDO::ERRMODE_EXCEPTION option is true.
1673
1685
*/
1674
1686
#[TentativeType]
1675
1687
public function rowCount (): int {}
@@ -1689,6 +1701,7 @@ public function rowCount(): int {}
1689
1701
* <p>
1690
1702
* There is no way to return another column from the same row if you
1691
1703
* use <b>PDOStatement::fetchColumn</b> to retrieve data.
1704
+ * @throws PDOException On error if PDO::ERRMODE_EXCEPTION option is true.
1692
1705
*/
1693
1706
#[TentativeType]
1694
1707
public function fetchColumn (#[LanguageLevelTypeAware(['8.0 ' => 'int ' ], default: '' )] $ column = 0 ): mixed {}
@@ -1761,6 +1774,7 @@ public function fetchAll(
1761
1774
* </p>
1762
1775
* @return T|stdClass|null an instance of the required class with property names that
1763
1776
* correspond to the column names or <b>FALSE</b> on failure.
1777
+ * @throws PDOException On error if PDO::ERRMODE_EXCEPTION option is true.
1764
1778
*/
1765
1779
#[TentativeType]
1766
1780
public function fetchObject (
@@ -1815,6 +1829,7 @@ public function errorInfo(): array {}
1815
1829
* @param int $attribute
1816
1830
* @param mixed $value
1817
1831
* @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.
1818
1833
*/
1819
1834
#[TentativeType]
1820
1835
public function setAttribute (
@@ -1839,6 +1854,7 @@ public function getAttribute(#[LanguageLevelTypeAware(['8.0' => 'int'], default:
1839
1854
* @return int the number of columns in the result set represented by the
1840
1855
* PDOStatement object. If there is no result set,
1841
1856
* <b>PDOStatement::columnCount</b> returns 0.
1857
+ * @throws PDOException On error if PDO::ERRMODE_EXCEPTION option is true.
1842
1858
*/
1843
1859
#[TentativeType]
1844
1860
public function columnCount (): int {}
@@ -1925,6 +1941,7 @@ public function getColumnMeta(#[LanguageLevelTypeAware(['8.0' => 'int'], default
1925
1941
* </p>
1926
1942
* @param mixed ...$args <p> Constructor arguments. </p>
1927
1943
* @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.
1928
1945
*/
1929
1946
public function setFetchMode ($ mode , ...$ args ) {}
1930
1947
@@ -1933,6 +1950,7 @@ public function setFetchMode($mode, ...$args) {}
1933
1950
* Advances to the next rowset in a multi-rowset statement handle
1934
1951
* @link https://php.net/manual/en/pdostatement.nextrowset.php
1935
1952
* @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.
1936
1954
*/
1937
1955
#[TentativeType]
1938
1956
public function nextRowset (): bool {}
@@ -1942,6 +1960,7 @@ public function nextRowset(): bool {}
1942
1960
* Closes the cursor, enabling the statement to be executed again.
1943
1961
* @link https://php.net/manual/en/pdostatement.closecursor.php
1944
1962
* @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.
1945
1964
*/
1946
1965
#[TentativeType]
1947
1966
public function closeCursor (): bool {}
0 commit comments