Make WordPress Core

Changeset 52373


Ignore:
Timestamp:
12/14/2021 04:22:47 PM (5 years ago)
Author:
johnbillion
Message:

Database: Correct and improve documentation for properties and parameters in wpdb.

See #53399

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/wp-db.php

    r52294 r52373  
    133133         * @since 0.71
    134134         *
    135          * @var array|null
     135         * @var stdClass[]|null
    136136         */
    137137        public $last_result;
    138138
    139139        /**
    140          * MySQL result, which is either a resource or boolean.
     140         * MySQL query result.
     141         *
     142         * Possible values:
     143         *
     144         * - `null` if a query is yet to be made or if the result has since been flushed
     145         * - `mysqli_result` instance when the MySQLi driver is in use, or `resource` when the older
     146         *   MySQL driver is in use, for successful SELECT, SHOW, DESCRIBE, or EXPLAIN queries
     147         * - `true` for other query types that were successful
     148         * - `false` if the query returned an error
    141149         *
    142150         * @since 0.71
    143151         *
    144          * @var mixed
     152         * @var mysqli_result|resource|bool|null
    145153         */
    146154        protected $result;
     
    280288         *
    281289         * @see wpdb::tables()
    282          * @var array
     290         * @var string[]
    283291         */
    284292        public $tables = array(
     
    303311         *
    304312         * @see wpdb::tables()
    305          * @var array
     313         * @var string[]
    306314         */
    307315        public $old_tables = array( 'categories', 'post2cat', 'link2cat' );
     
    313321         *
    314322         * @see wpdb::tables()
    315          * @var array
     323         * @var string[]
    316324         */
    317325        public $global_tables = array( 'users', 'usermeta' );
     
    323331         *
    324332         * @see wpdb::tables()
    325          * @var array
     333         * @var string[]
    326334         */
    327335        public $ms_global_tables = array(
     
    582590
    583591        /**
    584          * Database Handle.
     592         * Database handle.
     593         *
     594         * Possible values:
     595         *
     596         * - `null` if the connection is yet to be made or has been closed
     597         * - `mysqli` instance when the MySQLi driver is in use
     598         * - `resource` when the older MySQL driver is in use
     599         * - `false` if the connection has failed
    585600         *
    586601         * @since 0.71
    587602         *
    588          * @var string
     603         * @var mysqli|resource|false|null
    589604         */
    590605        protected $dbh;
     
    618633         * @since 3.9.0
    619634         *
    620          * @var array
     635         * @var string[]
    621636         */
    622637        protected $incompatible_modes = array(
     
    850865         * @since 3.1.0
    851866         *
    852          * @param resource $dbh     The resource given by mysql_connect.
    853          * @param string   $charset Optional. The character set. Default null.
    854          * @param string   $collate Optional. The collation. Default null.
     867         * @param mysqli|resource $dbh     The connection returned by `mysqli_connect()` or `mysql_connect()`.
     868         * @param string          $charset Optional. The character set. Default null.
     869         * @param string          $collate Optional. The collation. Default null.
    855870         */
    856871        public function set_charset( $dbh, $charset = null, $collate = null ) {
     
    11421157
    11431158        /**
    1144          * Selects a database using the current database connection.
     1159         * Selects a database using the current or provided database connection.
    11451160         *
    11461161         * The database name will be changed based on the current database connection.
     
    11491164         * @since 0.71
    11501165         *
    1151          * @param string        $db  MySQL database name.
    1152          * @param resource|null $dbh Optional link identifier.
     1166         * @param string          $db  MySQL database name.
     1167         * @param mysqli|resource $dbh Optional database connection.
    11531168         */
    11541169        public function select( $db, $dbh = null ) {
Note: See TracChangeset for help on using the changeset viewer.