intelephense

1.14.41.16.1
lib/stub/PDO/PDO.php
lib/stub/PDO/PDO.php
+69−5
Index: package/lib/stub/PDO/PDO.php
===================================================================
--- package/lib/stub/PDO/PDO.php
+++ package/lib/stub/PDO/PDO.php
@@ -962,8 +962,9 @@
          * If the database server cannot successfully prepare the statement,
          * <b>PDO::prepare</b> returns <b>FALSE</b> or emits
          * <b>PDOException</b> (depending on error handling).
          * </p>
+         * @throws PDOException On error if PDO::ERRMODE_EXCEPTION option is true.
          * <p>
          * Emulated prepared statements does not communicate with the database server
          * so <b>PDO::prepare</b> does not check the statement.
          */
@@ -1035,8 +1036,9 @@
          * @link https://php.net/manual/en/pdo.setattribute.php
          * @param int $attribute
          * @param mixed $value
          * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
+         * @throws PDOException On error if PDO::ERRMODE_EXCEPTION option is true.
          */
         #[TentativeType]
         public function setAttribute(
             #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $attribute,
@@ -1069,8 +1071,9 @@
          * results in a call to <b>die</b>:
          * <code>
          * $db->exec() or die(print_r($db->errorInfo(), true));
          * </code>
+         * @throws PDOException On error if PDO::ERRMODE_EXCEPTION option is true.
          */
         #[TentativeType]
         public function exec(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $statement): int|false {}
 
@@ -1094,9 +1097,10 @@
          * Arguments of custom class constructor when the <i>mode</i>
          * parameter is set to <b>PDO::FETCH_CLASS</b>.
          * </p>
          * @return PDOStatement|false <b>PDO::query</b> returns a PDOStatement object, or <b>FALSE</b>
-         * on failure.
+         * on failure or emits <b>PDOException</b> (depending on error handling)
+         * @throws PDOException On error if PDO::ERRMODE_EXCEPTION option is true.
          * @see PDOStatement::setFetchMode For a full description of the second and following parameters.
          */
         #[StubsElementAvailable(to: '7.4')]
         public function query($query, $fetchMode = PDO::ATTR_DEFAULT_FETCH_MODE, $arg3 = null, $ctorargs = []) {}
@@ -1118,9 +1122,10 @@
          * Arguments of custom class constructor when the <i>mode</i>
          * parameter is set to <b>PDO::FETCH_CLASS</b>.
          * </p>
          * @return PDOStatement|false <b>PDO::query</b> returns a PDOStatement object, or <b>FALSE</b>
-         * on failure.
+         * on failure or emits <b>PDOException</b> (depending on error handling).
+         * @throws PDOException On error if PDO::ERRMODE_EXCEPTION option is true.
          * @see PDOStatement::setFetchMode For a full description of the second and following parameters.
          */
         #[StubsElementAvailable('8.0')]
         public function query(
@@ -1249,8 +1254,9 @@
          * PDO::ATTR_TIMEOUT
          * </p>
          * @return mixed A successful call returns the value of the requested PDO attribute.
          * An unsuccessful call returns null.
+         * @throws PDOException when the underlying driver does not support the requested attribute.
          */
         #[TentativeType]
         public function getAttribute(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $attribute): mixed {}
 
@@ -1491,8 +1497,9 @@
          */
         public function pgsqlGetPid() {}
 
         /**
+         * @throws PDOException if the attempt to connect to the requested database fails, regardless of which PDO::ATTR_ERRMODE is currently set.
          * @since 8.4
          */
         public static function connect(string $dsn, ?string $username = null, ?string $password = null, ?array $options = null): static {}
     }
@@ -1563,8 +1570,9 @@
          * </p>
          * @param int $cursorOffset [optional]
          * @return mixed The return value of this function on success depends on the fetch type. In
          * all cases, <b>FALSE</b> is returned on failure.
+         * @throws PDOException On error if PDO::ERRMODE_EXCEPTION option is true.
          */
         #[TentativeType]
         public function fetch(
             #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $mode = PDO::FETCH_DEFAULT,
@@ -1585,8 +1593,9 @@
          * </p>
          * @param mixed &$var <p>
          * Name of the PHP variable to bind to the SQL statement parameter.
          * </p>
+         * @param-out mixed $var
          * @param int $type [optional] <p>
          * Explicit data type for the parameter using the PDO::PARAM_*
          * constants.
          * To return an INOUT parameter from a stored procedure,
@@ -1600,8 +1609,9 @@
          * </p>
          * @param mixed $driverOptions [optional] <p>
          * </p>
          * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
+         * @throws PDOException On error if PDO::ERRMODE_EXCEPTION option is true.
          */
         #[TentativeType]
         public function bindParam(
             #[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $param,
@@ -1622,8 +1632,9 @@
          * </p>
          * @param mixed &$var <p>
          * Name of the PHP variable to which the column will be bound.
          * </p>
+         * @param-out mixed $var
          * @param int $type [optional] <p>
          * Data type of the parameter, specified by the PDO::PARAM_* constants.
          * </p>
          * @param int $maxLength [optional] <p>
@@ -1632,8 +1643,9 @@
          * @param mixed $driverOptions [optional] <p>
          * Optional parameter(s) for the driver.
          * </p>
          * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
+         * @throws PDOException On error if PDO::ERRMODE_EXCEPTION option is true.
          */
         #[TentativeType]
         public function bindColumn(
             #[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $column,
@@ -1661,8 +1673,9 @@
          * Explicit data type for the parameter using the PDO::PARAM_*
          * constants.
          * </p>
          * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
+         * @throws PDOException On error if PDO::ERRMODE_EXCEPTION option is true.
          */
         #[TentativeType]
         public function bindValue(
             #[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $param,
@@ -1674,8 +1687,9 @@
          * (PHP 5 &gt;= 5.1.0, PHP 7, PECL pdo &gt;= 0.1.0)<br/>
          * Returns the number of rows affected by the last SQL statement
          * @link https://php.net/manual/en/pdostatement.rowcount.php
          * @return int the number of rows.
+         * @throws PDOException On error if PDO::ERRMODE_EXCEPTION option is true.
          */
         #[TentativeType]
         public function rowCount(): int {}
 
@@ -1693,8 +1707,9 @@
          * </p>
          * <p>
          * There is no way to return another column from the same row if you
          * use <b>PDOStatement::fetchColumn</b> to retrieve data.
+         * @throws PDOException On error if PDO::ERRMODE_EXCEPTION option is true.
          */
         #[TentativeType]
         public function fetchColumn(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $column = 0): mixed {}
 
@@ -1765,8 +1780,9 @@
          * Elements of this array are passed to the constructor.
          * </p>
          * @return T|stdClass|null an instance of the required class with property names that
          * correspond to the column names or <b>FALSE</b> on failure.
+         * @throws PDOException On error if PDO::ERRMODE_EXCEPTION option is true.
          */
         #[TentativeType]
         public function fetchObject(
             #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $class = "stdClass",
@@ -1819,8 +1835,9 @@
          * @link https://php.net/manual/en/pdostatement.setattribute.php
          * @param int $attribute
          * @param mixed $value
          * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
+         * @throws PDOException On error if PDO::ERRMODE_EXCEPTION option is true.
          */
         #[TentativeType]
         public function setAttribute(
             #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $attribute,
@@ -1843,8 +1860,9 @@
          * @link https://php.net/manual/en/pdostatement.columncount.php
          * @return int the number of columns in the result set represented by the
          * PDOStatement object. If there is no result set,
          * <b>PDOStatement::columnCount</b> returns 0.
+         * @throws PDOException On error if PDO::ERRMODE_EXCEPTION option is true.
          */
         #[TentativeType]
         public function columnCount(): int {}
 
@@ -1937,16 +1955,18 @@
          * The fetch mode must be one of the PDO::FETCH_* constants.
          * </p>
          * @param mixed ...$args <p> Constructor arguments. </p>
          * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
+         * @throws PDOException On error if PDO::ERRMODE_EXCEPTION option is true.
          */
         public function setFetchMode($mode, ...$args) {}
 
         /**
          * (PHP 5 &gt;= 5.1.0, PHP 7, PECL pdo &gt;= 0.2.0)<br/>
          * Advances to the next rowset in a multi-rowset statement handle
          * @link https://php.net/manual/en/pdostatement.nextrowset.php
          * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
+         * @throws PDOException On error if PDO::ERRMODE_EXCEPTION option is true.
          */
         #[TentativeType]
         public function nextRowset(): bool {}
 
@@ -1954,8 +1974,9 @@
          * (PHP 5 &gt;= 5.1.0, PHP 7, PECL pdo &gt;= 0.9.0)<br/>
          * Closes the cursor, enabling the statement to be executed again.
          * @link https://php.net/manual/en/pdostatement.closecursor.php
          * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
+         * @throws PDOException On error if PDO::ERRMODE_EXCEPTION option is true.
          */
         #[TentativeType]
         public function closeCursor(): bool {}
 
@@ -2006,17 +2027,45 @@
     /**
      * @since 8.4
      */
     class Sqlite extends PDO
-{
+    {
         public const int DETERMINISTIC = 0;
         public const int OPEN_READONLY = 1;
         public const int OPEN_READWRITE = 0;
         public const int OPEN_CREATE = 0;
         public const int ATTR_OPEN_FLAGS = 0;
         public const int ATTR_READONLY_STATEMENT = 0;
         public const int ATTR_EXTENDED_RESULT_CODES = 0;
+        public const IGNORE = 0;
+        public const DENY = 0;
+        public const OK = 0;
+        public const EXPLAIN_MODE_EXPLAIN_QUERY_PLAN = 0;
+        public const EXPLAIN_MODE_EXPLAIN = 0;
+        public const EXPLAIN_MODE_PREPARED = 0;
+        public const ATTR_EXPLAIN_STATEMENT = 0;
+        public const ATTR_BUSY_STATEMENT = 0;
 
+        /**
+         * @since 8.5
+         */
+        public const ATTR_TRANSACTION_MODE = 1005;
+
+        /**
+         * @since 8.5
+         */
+        public const TRANSACTION_MODE_DEFERRED = 0;
+
+        /**
+         * @since 8.5
+         */
+        public const TRANSACTION_MODE_IMMEDIATE = 1;
+
+        /**
+         * @since 8.5
+         */
+        public const TRANSACTION_MODE_EXCLUSIVE = 2;
+
         public function createAggregate(
             string $name,
             callable $step,
             callable $finalize,
@@ -2041,15 +2090,20 @@
             int $rowid,
             ?string $dbname = "main",
             int $flags = \Pdo\Sqlite::OPEN_READONLY
         ) {}
+
+        /**
+         * @since 8.5
+         */
+        public function setAuthorizer(?callable $callback): void {}
     }
 
     /**
      * @since 8.4
      */
     class Mysql extends PDO
-{
+    {
         public const int ATTR_USE_BUFFERED_QUERY = 0;
         public const int ATTR_LOCAL_INFILE = 0;
         public const int ATTR_INIT_COMMAND = 0;
         public const int ATTR_MAX_BUFFER_SIZE = 0;
@@ -2091,37 +2145,47 @@
             string $separator = "\t",
             string $nullAs = "\\\\N",
             ?string $fields = null
         ): bool {}
+
         public function copyFromFile(
             string $tableName,
             string $filename,
             string $separator = "\t",
             string $nullAs = "\\\\N",
             ?string $fields = null
         ): bool {}
+
         public function copyToArray(
             string $tableName,
             string $separator = "\t",
             string $nullAs = "\\\\N",
             ?string $fields = null
         ): array|false {}
+
         public function copyToFile(
             string $tableName,
             string $filename,
             string $separator = "\t",
             string $nullAs = "\\\\N",
             ?string $fields = null
         ): bool {}
+
         public function escapeIdentifier(string $input): string {}
+
         public function getNotify(int $fetchMode = \PDO::FETCH_DEFAULT, int $timeoutMilliseconds = 0): array|false {}
-        public function getPid(): int{}
+
+        public function getPid(): int {}
+
         public function lobCreate(): string|false {}
+
         /**
          * Opens an existing large object stream. Must be called inside a transaction.
          * @return resource|false
          */
         public function lobOpen(string $oid, string $mode = "rb") {}
+
         public function lobUnlink(string $oid): bool {}
+
         public function setNoticeCallback(?callable $callback): void {}
     }
 }