2626 * we conditionally define traits with different APIs based on the PHP version.
2727 */
2828if ( PHP_VERSION_ID < 80000 ) {
29- trait WP_PDO_Proxy_Statement_PHP_Compat {
29+ /**
30+ * PHP compatibility methods for WP_MySQL_On_SQLite_Statement.
31+ *
32+ * @access private
33+ */
34+ trait WP_MySQL_On_SQLite_Statement_PHP_Compat {
3035 /**
3136 * Set the default fetch mode for this statement.
3237 *
@@ -61,7 +66,12 @@ public function fetchAll( $mode = null, $class_name = null, $constructor_args =
6166 }
6267 }
6368} else {
64- trait WP_PDO_Proxy_Statement_PHP_Compat {
69+ /**
70+ * PHP compatibility methods for WP_MySQL_On_SQLite_Statement.
71+ *
72+ * @access private
73+ */
74+ trait WP_MySQL_On_SQLite_Statement_PHP_Compat {
6575 /**
6676 * Set the default fetch mode for this statement.
6777 *
@@ -88,10 +98,10 @@ public function fetchAll( $mode = PDO::FETCH_DEFAULT, ...$args ): array {
8898}
8999
90100/**
91- * PDOStatement implementation that operates on in-memory data .
101+ * PDOStatement implementation for MySQL-on-SQLite query results .
92102 *
93- * This class implements a complete PDOStatement interface on top of PHP arrays.
94- * It is used for result sets that are composed or transformed in the PHP layer .
103+ * Delegates operations to the underlying SQLite statement while adapting
104+ * MySQL-specific behavior such as affected row counts .
95105 *
96106 * PDO supports the following fetch modes:
97107 * - PDO::FETCH_DEFAULT: current default fetch mode (available from PHP 8.0)
@@ -108,8 +118,8 @@ public function fetchAll( $mode = PDO::FETCH_DEFAULT, ...$args ): array {
108118 * - PDO::FETCH_BOUND: bind values to PHP variables, can't be used with fetchAll()
109119 * - PDO::FETCH_FUNC: custom function, only works with fetchAll(), can't be default [1 extra arg]
110120 */
111- class WP_PDO_Proxy_Statement extends PDOStatement {
112- use WP_PDO_Proxy_Statement_PHP_Compat ;
121+ class WP_MySQL_On_SQLite_Statement extends PDOStatement {
122+ use WP_MySQL_On_SQLite_Statement_PHP_Compat ;
113123
114124 /**
115125 * The original PDO statement.
@@ -347,7 +357,7 @@ public function debugDumpParams(): ?bool {
347357 /**
348358 * Fetch all remaining rows from the result set.
349359 *
350- * This is used internally by the "WP_PDO_Proxy_Statement_PHP_Compat " trait,
360+ * This is used internally by the "WP_MySQL_On_SQLite_Statement_PHP_Compat " trait,
351361 * that is defined conditionally based on the current PHP version.
352362 *
353363 * @param int $mode The fetch mode to use.
@@ -361,7 +371,7 @@ private function fetchAllRows( $mode = null, ...$args ): array {
361371 /**
362372 * Set the default fetch mode for this statement.
363373 *
364- * This is used internally by the "WP_PDO_Proxy_Statement_PHP_Compat " trait,
374+ * This is used internally by the "WP_MySQL_On_SQLite_Statement_PHP_Compat " trait,
365375 * that is defined conditionally based on the current PHP version.
366376 *
367377 * @param int $mode The fetch mode to set as the default.
0 commit comments