Make WordPress Core

Changeset 46661


Ignore:
Timestamp:
11/05/2019 09:25:53 PM (7 years ago)
Author:
johnbillion
Message:

Docs: Further improve documentation of known return types, plus other docs fixes.

See #48303

Location:
trunk/src/wp-includes
Files:
15 edited

Legend:

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

    r46152 r46661  
    130130 *                                    Default empty.
    131131 * }
    132  * @return array List of bookmark row objects.
     132 * @return object[] List of bookmark row objects.
    133133 */
    134134function get_bookmarks( $args = '' ) {
  • trunk/src/wp-includes/capabilities.php

    r46596 r46661  
    3434 * @param int    $user_id User ID.
    3535 * @param mixed  ...$args Optional further parameters, typically starting with an object ID.
    36  * @return array Actual capabilities for meta capability.
     36 * @return string[] Actual capabilities for meta capability.
    3737 */
    3838function map_meta_cap( $cap, $user_id, ...$args ) {
    … …  
    839839 * @global array $super_admins
    840840 *
    841  * @return array List of super admin logins
     841 * @return string[] List of super admin logins.
    842842 */
    843843function get_super_admins() {
  • trunk/src/wp-includes/class-requests.php

    r46586 r46661  
    790790         *
    791791         * @param array $array Dictionary of header values
    792          * @return array List of headers
     792         * @return string[] List of headers
    793793         */
    794794        public static function flatten($array) {
    … …  
    806806         * @deprecated Misspelling of {@see Requests::flatten}
    807807         * @param array $array Dictionary of header values
    808          * @return array List of headers
     808         * @return string[] List of headers
    809809         */
    810810        public static function flattern($array) {
  • trunk/src/wp-includes/class-wp-comment.php

    r46586 r46661  
    252252         *                                 'none' to disable `ORDER BY` clause.
    253253         * }
    254          * @return array Array of `WP_Comment` objects.
     254         * @return WP_Comment[] Array of `WP_Comment` objects.
    255255         */
    256256        public function get_children( $args = array() ) {
  • trunk/src/wp-includes/class-wp-customize-manager.php

    r46637 r46661  
    437437         * @since 3.4.0
    438438         *
    439          * @param mixed $ajax_message Ajax return
    440          * @param mixed $message UI message
     439         * @param string|WP_Error $ajax_message Ajax return.
     440         * @param string          $message      Optional. UI message.
    441441         */
    442442        protected function wp_die( $ajax_message, $message = null ) {
  • trunk/src/wp-includes/class-wp-embed.php

    r45590 r46661  
    174174                                        if ( false !== $return ) {
    175175                                                /**
    176                                                  * Filters the returned embed handler.
     176                                                 * Filters the returned embed HTML.
    177177                                                 *
    178178                                                 * @since 2.9.0
    … …  
    180180                                                 * @see WP_Embed::shortcode()
    181181                                                 *
    182                                                  * @param mixed  $return The shortcode callback function to call.
    183                                                  * @param string $url    The attempted embed URL.
    184                                                  * @param array  $attr   An array of shortcode attributes.
     182                                                 * @param string|false $return The HTML result of the shortcode, or false on failure.
     183                                                 * @param string       $url    The embed URL.
     184                                                 * @param array        $attr   An array of shortcode attributes.
    185185                                                 */
    186186                                                return apply_filters( 'embed_handler_html', $return, $url, $attr );
    … …  
    249249                                 * @see WP_Embed::shortcode()
    250250                                 *
    251                                  * @param mixed $cache   The cached HTML result, stored in post meta.
    252                                  * @param string $url     The attempted embed URL.
    253                                  * @param array  $attr    An array of shortcode attributes.
    254                                  * @param int    $post_ID Post ID.
     251                                 * @param string|false $cache   The cached HTML result, stored in post meta.
     252                                 * @param string       $url     The attempted embed URL.
     253                                 * @param array        $attr    An array of shortcode attributes.
     254                                 * @param int          $post_ID Post ID.
    255255                                 */
    256256                                return apply_filters( 'embed_oembed_html', $cache, $url, $attr, $post_ID );
  • trunk/src/wp-includes/class-wp-image-editor.php

    r46202 r46661  
    173173         * @since 3.5.0
    174174         *
    175          * @return array {'width'=>int, 'height'=>int}
     175         * @return array {
     176         *     Dimensions of the image.
     177         *
     178         *     @type int $width  The image width.
     179         *     @type int $height The image height.
     180         * }
    176181         */
    177182        public function get_size() {
  • trunk/src/wp-includes/class-wp-query.php

    r46474 r46661  
    14031403         *
    14041404         * @param string[] $terms Array of terms to check.
    1405          * @return array Terms that are not stopwords.
     1405         * @return string[] Terms that are not stopwords.
    14061406         */
    14071407        protected function parse_search_terms( $terms ) {
    … …  
    14391439         * @since 3.7.0
    14401440         *
    1441          * @return array Stopwords.
     1441         * @return string[] Stopwords.
    14421442         */
    14431443        protected function get_search_stopwords() {
    … …  
    35863586         * @since 3.1.0
    35873587         *
    3588          * @param mixed $post_types Optional. Post type or array of posts types to check against.
     3588         * @param string|string[] $post_types Optional. Post type or array of posts types to check against.
    35893589         * @return bool
    35903590         */
  • trunk/src/wp-includes/class-wp-recovery-mode-email-service.php

    r46586 r46661  
    307307         *
    308308         * @param array $extension The extension that caused the error.
    309          * @return array An associated array of debug information.
     309         * @return array An associative array of debug information.
    310310         */
    311311        private function get_debug( $extension ) {
  • trunk/src/wp-includes/class-wp-rewrite.php

    r46596 r46661  
    464464         * @since 1.5.0
    465465         *
    466          * @return array Page rewrite rules.
     466         * @return string[] Page rewrite rules.
    467467         */
    468468        public function page_rewrite_rules() {
    … …  
    12511251         * @since 1.5.0
    12521252         *
    1253          * @return array An associate array of matches and queries.
     1253         * @return string[] An associative array of matches and queries.
    12541254         */
    12551255        public function rewrite_rules() {
    … …  
    14561456         * @since 1.5.0
    14571457         *
    1458          * @return array Rewrite rules.
     1458         * @return string[] Array of rewrite rules keyed by their regex pattern.
    14591459         */
    14601460        public function wp_rewrite_rules() {
  • trunk/src/wp-includes/class-wp-theme.php

    r46278 r46661  
    11571157         * @param int $depth Optional. How deep to search for files. Defaults to a flat scan (0 depth). -1 depth is infinite.
    11581158         * @param bool $search_parent Optional. Whether to return parent files. Defaults to false.
    1159          * @return array Array of files, keyed by the path to the file relative to the theme's directory, with the values
    1160          *               being absolute paths.
     1159         * @return string[] Array of files, keyed by the path to the file relative to the theme's directory, with the values
     1160         *                  being absolute paths.
    11611161         */
    11621162        public function get_files( $type = null, $depth = 0, $search_parent = false ) {
    … …  
    11751175         * @since 4.7.0
    11761176         *
    1177          * @return array Array of page templates, keyed by filename and post type,
     1177         * @return string Array of page templates, keyed by filename and post type,
    11781178         *               with the value of the translated header name.
    11791179         */
    … …  
    12341234         * @param string       $post_type Optional. Post type to get the templates for. Default 'page'.
    12351235         *                                If a post is provided, its post type is used.
    1236          * @return array Array of page templates, keyed by filename, with the value of the translated header name.
     1236         * @return string[] Array of template header names keyed by the template file name.
    12371237         */
    12381238        public function get_page_templates( $post = null, $post_type = 'page' ) {
    … …  
    12491249                 * @since 4.9.6
    12501250                 *
    1251                  * @param string[]     $post_templates Array of page templates. Keys are filenames,
    1252                  *                                     values are translated names.
     1251                 * @param string[]     $post_templates Array of template header names keyed by the template file name.
    12531252                 * @param WP_Theme     $this           The theme object.
    12541253                 * @param WP_Post|null $post           The post being edited, provided for context, or null.
    … …  
    12661265                 * @since 4.7.0 Added the `$post_type` parameter.
    12671266                 *
    1268                  * @param string[]     $post_templates Array of page templates. Keys are filenames,
    1269                  *                                     values are translated names.
     1267                 * @param string[]     $post_templates Array of template header names keyed by the template file name.
    12701268                 * @param WP_Theme     $this           The theme object.
    12711269                 * @param WP_Post|null $post           The post being edited, provided for context, or null.
    … …  
    12901288         *                                         returned path for the found files, particularly when this function
    12911289         *                                         recurses to lower depths. Default empty.
    1292          * @return array|false Array of files, keyed by the path to the file relative to the `$path` directory prepended
    1293          *                     with `$relative_path`, with the values being absolute paths. False otherwise.
     1290         * @return string[]|false Array of files, keyed by the path to the file relative to the `$path` directory prepended
     1291         *                        with `$relative_path`, with the values being absolute paths. False otherwise.
    12941292         */
    12951293        private static function scandir( $path, $extensions = null, $depth = 0, $relative_path = '' ) {
  • trunk/src/wp-includes/class-wp-user.php

    r46451 r46661  
    865865         * @since 4.9.0
    866866         *
    867          * @return array User capabilities array.
     867         * @return bool[] List of capabilities keyed by the capability name,
     868         *                e.g. array( 'edit_posts' => true, 'delete_posts' => false ).
    868869         */
    869870        private function get_caps_data() {
  • trunk/src/wp-includes/class.wp-dependencies.php

    r45590 r46661  
    2626
    2727        /**
    28          * An array of queued _WP_Dependency handle objects.
     28         * An array of handles of queued objects.
    2929         *
    3030         * @since 2.6.8
    31          * @var array
     31         * @var string[]
    3232         */
    3333        public $queue = array();
    3434
    3535        /**
    36          * An array of _WP_Dependency handle objects to queue.
    37          *
    38          * @since 2.6.0
    39          * @var array
     36         * An array of handles of objects to queue.
     37         *
     38         * @since 2.6.0
     39         * @var string[]
    4040         */
    4141        public $to_do = array();
    4242
    4343        /**
    44          * An array of _WP_Dependency handle objects already queued.
    45          *
    46          * @since 2.6.0
    47          * @var array
     44         * An array of handles of objects already queued.
     45         *
     46         * @since 2.6.0
     47         * @var string[]
    4848         */
    4949        public $done = array();
    … …  
    8484         * @since 2.8.0 Added the `$group` parameter.
    8585         *
    86          * @param mixed $handles Optional. Items to be processed: Process queue (false), process item (string), process items (array of strings).
    87          * @param mixed $group  Group level: level (int), no groups (false).
    88          * @return array Handles of items that have been processed.
     86         * @param mixed     $handles Optional. Items to be processed: Process queue (false), process item (string), process items (array of strings).
     87         * @param int|false $group   Optional. Group level: level (int), no groups (false).
     88         * @return string[] Array of handles of items that have been processed.
    8989         */
    9090        public function do_items( $handles = false, $group = false ) {
    … …  
    137137         * @since 2.8.0 Added the `$group` parameter.
    138138         *
    139          * @param mixed    $handles   Item handle and argument (string) or item handles and arguments (array of strings).
    140          * @param bool      $recursion Internal flag that function is calling itself.
    141          * @param int|false $group     Group level: (int) level, (false) no groups.
     139         * @param string|string[] $handles   Item handle and argument (string) or item handles and arguments (array of strings).
     140         * @param bool            $recursion Internal flag that function is calling itself.
     141         * @param int|false       $group     Group level: (int) level, (false) no groups.
    142142         * @return bool True on success, false on failure.
    143143         */
    … …  
    271271         * @since 2.6.0 Moved from `WP_Scripts`.
    272272         *
    273          * @param mixed $handles Item handle and argument (string) or item handles and arguments (array of strings).
     273         * @param string|string[] $handles Item handle and argument (string) or item handles and arguments (array of strings).
    274274         * @return void
    275275         */
    … …  
    291291         * @since 2.6.0 Moved from `WP_Scripts`.
    292292         *
    293          * @param mixed $handles Item handle and argument (string) or item handles and arguments (array of strings).
     293         * @param string|string[] $handles Item handle and argument (string) or item handles and arguments (array of strings).
    294294         */
    295295        public function enqueue( $handles ) {
    … …  
    314314         * @since 2.6.0 Moved from `WP_Scripts`.
    315315         *
    316          * @param mixed $handles Item handle and argument (string) or item handles and arguments (array of strings).
     316         * @param string|string[] $handles Item handle and argument (string) or item handles and arguments (array of strings).
    317317         */
    318318        public function dequeue( $handles ) {
  • trunk/src/wp-includes/class.wp-scripts.php

    r46287 r46661  
    176176         * @since 2.8.0 Added the `$group` parameter.
    177177         *
    178          * @param mixed $handles Optional. Scripts to be printed. (void) prints queue, (string) prints
    179          *                       that script, (array of strings) prints those scripts. Default false.
    180          * @param int  $group   Optional. If scripts were queued in groups prints this group number.
    181          *                       Default false.
    182          * @return array Scripts that have been printed.
     178         * @param mixed     $handles Optional. Scripts to be printed. (void) prints queue, (string) prints
     179         *                           that script, (array of strings) prints those scripts. Default false.
     180         * @param int|false $group   Optional. If scripts were queued in groups prints this group number.
     181         *                           Default false.
     182         * @return string[] Handles of scripts that have been printed.
    183183         */
    184184        public function print_scripts( $handles = false, $group = false ) {
    … …  
    628628         * @see WP_Dependencies::do_items()
    629629         *
    630          * @return array Handles of items that have been processed.
     630         * @return string[] Handles of items that have been processed.
    631631         */
    632632        public function do_head_items() {
    … …  
    642642         * @see WP_Dependencies::do_items()
    643643         *
    644          * @return array Handles of items that have been processed.
     644         * @return string[] Handles of items that have been processed.
    645645         */
    646646        public function do_footer_items() {
  • trunk/src/wp-includes/class.wp-styles.php

    r46287 r46661  
    357357         * @see WP_Dependencies::all_deps()
    358358         *
    359          * @param mixed    $handles   Item handle and argument (string) or item handles and arguments (array of strings).
    360          * @param bool      $recursion Internal flag that function is calling itself.
    361          * @param int|false $group     Group level: (int) level, (false) no groups.
     359         * @param string|string[] $handles   Item handle and argument (string) or item handles and arguments (array of strings).
     360         * @param bool            $recursion Internal flag that function is calling itself.
     361         * @param int|false       $group     Group level: (int) level, (false) no groups.
    362362         * @return bool True on success, false on failure.
    363363         */
    … …  
    438438         * @see WP_Dependencies::do_items()
    439439         *
    440          * @return array Handles of items that have been processed.
     440         * @return string[] Handles of items that have been processed.
    441441         */
    442442        public function do_footer_items() {
Note: See TracChangeset for help on using the changeset viewer.