WordPress.org

Make WordPress Core

Changeset 51298


Ignore:
Timestamp:
07/01/2021 09:01:17 PM (5 months ago)
Author:
johnbillion
Message:

Docs: Corrections and improvements to types used in docblocks for symbols, properties, and filters.

See #53399

Location:
trunk
Files:
25 edited

Legend:

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

    r51240 r51298  
    245245     * @since 5.8.0
    246246     *
    247      * @param array $widgets An array of excluded widget-type IDs.
     247     * @param string[] $widgets An array of excluded widget-type IDs.
    248248     */
    249249    $editor_settings['widgetTypesToHideFromLegacyWidgetBlock'] = apply_filters(
     
    395395 * @global WP_Post $post Global post object.
    396396 *
    397  * @param array                   $preload_paths        List of paths to preload.
     397 * @param string[]                $preload_paths        List of paths to preload.
    398398 * @param WP_Block_Editor_Context $block_editor_context The current block editor context.
    399399 *
  • trunk/src/wp-includes/block-supports/border.php

    r51221 r51298  
    126126 * @param WP_Block_Type $block_type Block type.
    127127 *
    128  * @return boolean
     128 * @return bool
    129129 */
    130130function wp_skip_border_serialization( $block_type ) {
     
    150150 * @param string        $feature    Name of the feature to check support for.
    151151 * @param mixed         $default    Fallback value for feature support, defaults to false.
    152  *
    153  * @return boolean Whether or not the feature is supported.
     152 * @return bool Whether the feature is supported.
    154153 */
    155154function wp_has_border_feature_support( $block_type, $feature, $default = false ) {
  • trunk/src/wp-includes/block-supports/spacing.php

    r50945 r51298  
    7676 * @param WP_Block_Type $block_type Block type to check for support.
    7777 * @param string        $feature    Name of the feature to check support for.
    78  * @param mixed         $default    Fallback value for feature support, defaults to false.
    79  *
    80  * @return boolean                  Whether or not the feature is supported.
     78 * @param mixed         $default    Fallback value for feature support. Default false.
     79 * @return bool Whether the feature is supported.
    8180 */
    8281function wp_has_spacing_feature_support( $block_type, $feature, $default = false ) {
  • trunk/src/wp-includes/block-template.php

    r51221 r51298  
    1515 * @global string $_wp_current_template_content
    1616 *
    17  * @param string $template  Path to the template. See locate_template().
    18  * @param string $type      Sanitized filename without extension.
    19  * @param array $templates A list of template candidates, in descending order of priority.
     17 * @param string   $template  Path to the template. See locate_template().
     18 * @param string   $type      Sanitized filename without extension.
     19 * @param string[] $templates A list of template candidates, in descending order of priority.
    2020 * @return string The path to the Full Site Editing template canvas file, or the fallback PHP template.
    2121 */
  • trunk/src/wp-includes/blocks.php

    r51288 r51298  
    961961 * @param WP_Block_Type $block_type Block type to check for support.
    962962 * @param string        $feature    Name of the feature to check support for.
    963  * @param mixed         $default    Fallback value for feature support, defaults to false.
    964  *
    965  * @return boolean                  Whether or not the feature is supported.
     963 * @param mixed         $default    Optional. Fallback value for feature support. Default false.
     964 * @return bool Whether the feature is supported.
    966965 */
    967966function block_has_support( $block_type, $feature, $default = false ) {
  • trunk/src/wp-includes/class-wp-block.php

    r50123 r51298  
    6262     *
    6363     * @since 5.5.0
    64      * @var WP_Block[]
     64     * @var WP_Block_List
    6565     */
    6666    public $inner_blocks = array();
  • trunk/src/wp-includes/class-wp-comment-query.php

    r49946 r51298  
    215215     *                                                   affiliated comments for. Pass 'any' to match any value.
    216216     *                                                   Default empty.
    217      *     @type string      $post_type                 Post type or array of post types to retrieve affiliated
     217     *     @type string|array $post_type                 Post type or array of post types to retrieve affiliated
    218218     *                                                   comments for. Pass 'any' to match any value. Default empty.
    219219     *     @type string       $post_name                 Post name to retrieve affiliated comments for.
  • trunk/src/wp-includes/class-wp-http-streams.php

    r49597 r51298  
    366366     * @since 3.7.0
    367367     *
    368      * @param stream $stream The PHP Stream which the SSL request is being made over
    369      * @param string $host The hostname being requested
     368     * @param resource $stream The PHP Stream which the SSL request is being made over
     369     * @param string   $host  The hostname being requested
    370370     * @return bool If the cerficiate presented in $stream is valid for $host
    371371     */
  • trunk/src/wp-includes/class-wp-image-editor-gd.php

    r50810 r51298  
    534534     * @since 3.5.0
    535535     *
    536      * @param string|stream $filename
    537      * @param callable      $function
    538      * @param array         $arguments
     536     * @param string  $filename
     537     * @param callable $function
     538     * @param array    $arguments
    539539     * @return bool
    540540     */
  • trunk/src/wp-includes/class-wp-image-editor-imagick.php

    r50821 r51298  
    902902     * @since 5.6.0
    903903     *
    904      * @return true|WP_error
     904     * @return true|WP_Error
    905905     */
    906906    protected function pdf_load_source() {
  • trunk/src/wp-includes/class-wp-image-editor.php

    r51221 r51298  
    506506     * @since 3.5.0
    507507     *
    508      * @param string|stream $filename
    509      * @param callable      $function
    510      * @param array         $arguments
     508     * @param string  $filename
     509     * @param callable $function
     510     * @param array    $arguments
    511511     * @return bool
    512512     */
  • trunk/src/wp-includes/class-wp-term-query.php

    r50614 r51298  
    167167     *                                                Default empty.
    168168     *     @type int          $child_of               Term ID to retrieve child terms of. If multiple taxonomies
    169      *                                                are passed, $child_of is ignored. Default 0.
    170      *     @type int|string   $parent                 Parent term ID to retrieve direct-child terms of.
     169     *                                                are passed, `$child_of` is ignored. Default 0.
     170     *     @type int          $parent                 Parent term ID to retrieve direct-child terms of.
    171171     *                                                Default empty.
    172172     *     @type bool         $childless              True to limit results to terms that have no children.
  • trunk/src/wp-includes/class-wp-theme-json.php

    r51292 r51298  
    4545     *
    4646     * @since 5.8.0
    47      * @var array
     47     * @var string[]
    4848     */
    4949    const VALID_ORIGINS = array(
     
    167167    /**
    168168     * @since 5.8.0
    169      * @var array
     169     * @var string[]
    170170     */
    171171    const ALLOWED_TOP_LEVEL_KEYS = array(
     
    235235    /**
    236236     * @since 5.8.0
    237      * @var array
     237     * @var string[]
    238238     */
    239239    const ELEMENTS = array(
  • trunk/src/wp-includes/customize/class-wp-customize-background-image-setting.php

    r35385 r51298  
    2121     * @since 3.4.0
    2222     *
    23      * @param $value
     23     * @param mixed $value
    2424     */
    2525    public function update( $value ) {
  • trunk/src/wp-includes/customize/class-wp-customize-header-image-setting.php

    r47198 r51298  
    2525     * @global Custom_Image_Header $custom_image_header
    2626     *
    27      * @param $value
     27     * @param mixed $value
    2828     */
    2929    public function update( $value ) {
  • trunk/src/wp-includes/embed.php

    r50556 r51298  
    723723 * @since 4.4.0
    724724 *
    725  * @param bool                      $served  Whether the request has already been served.
    726  * @param WP_HTTP_ResponseInterface $result  Result to send to the client. Usually a WP_REST_Response.
    727  * @param WP_REST_Request           $request Request used to generate the response.
    728  * @param WP_REST_Server            $server  Server instance.
     725 * @param bool             $served  Whether the request has already been served.
     726 * @param WP_HTTP_Response $result  Result to send to the client. Usually a `WP_REST_Response`.
     727 * @param WP_REST_Request  $request Request used to generate the response.
     728 * @param WP_REST_Server   $server  Server instance.
    729729 * @return true
    730730 */
  • trunk/src/wp-includes/general-template.php

    r51048 r51298  
    12911291 * @param bool   $display     Optional. Whether to display or retrieve title. Default true.
    12921292 * @param string $seplocation Optional. Location of the separator ('left' or 'right').
    1293  * @return string|null String on retrieve, null when displaying.
     1293 * @return string|void String when `$display` is true, nothing otherwise.
    12941294 */
    12951295function wp_title( $sep = '»', $display = true, $seplocation = '' ) {
  • trunk/src/wp-includes/l10n.php

    r49963 r51298  
    402402 * @param string $domain  Optional. Text domain. Unique identifier for retrieving translated strings.
    403403 *                        Default 'default'.
    404  * @return string Translated context string without pipe.
    405404 */
    406405function _ex( $text, $context, $domain = 'default' ) {
  • trunk/src/wp-includes/post.php

    r51018 r51298  
    12341234 *                               from the array needs to match; 'and' means all elements must match.
    12351235 *                               Default 'and'.
    1236  * @return array A list of post status names or objects.
     1236 * @return string[]|stdClass[] A list of post status names or objects.
    12371237 */
    12381238function get_post_stati( $args = array(), $output = 'names', $operator = 'and' ) {
     
    14281428 *                                               'dashicons-chart-pie'. Pass 'none' to leave div.wp-menu-image empty
    14291429 *                                               so an icon can be added via CSS. Defaults to use the posts icon.
    1430  *     @type string      $capability_type       The string to use to build the read, edit, and delete capabilities.
     1430 *     @type string|array $capability_type       The string to use to build the read, edit, and delete capabilities.
    14311431 *                                               May be passed as an array to allow for alternative plurals when using
    14321432 *                                               this argument as a base to construct the capabilities, e.g.
     
    37953795 *     @type string $post_date_gmt         The date of the post in the GMT timezone. Default is
    37963796 *                                         the value of `$post_date`.
    3797  *     @type mixed $post_content          The post content. Default empty.
     3797 *     @type string $post_content          The post content. Default empty.
    37983798 *     @type string $post_content_filtered The filtered post content. Default empty.
    37993799 *     @type string $post_title            The post title. Default empty.
  • trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-autosaves-controller.php

    r51000 r51298  
    3838     *
    3939     * @since 5.0.0
    40      * @var WP_REST_Controller
     40     * @var WP_REST_Revisions_Controller
    4141     */
    4242    private $revisions_controller;
  • trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-templates-controller.php

    r51289 r51298  
    477477     * @since 5.8.0
    478478     *
    479      * @return array List of link relations.
     479     * @return string[] List of link relations.
    480480     */
    481481    protected function get_available_actions() {
  • trunk/src/wp-includes/user.php

    r51129 r51298  
    24432443 * @since 3.7.0
    24442444 *
    2445  * @param WP_User $user Optional. WP_User object.
     2445 * @param WP_User|null $user Optional. WP_User object.
    24462446 * @return string[] Array of contact method labels keyed by contact method.
    24472447 */
     
    24612461     * @since 2.9.0
    24622462     *
    2463      * @param string[] $methods Array of contact method labels keyed by contact method.
    2464      * @param WP_User  $user    WP_User object.
     2463     * @param string[]     $methods Array of contact method labels keyed by contact method.
     2464     * @param WP_User|null $user    WP_User object or null if none was provided.
    24652465     */
    24662466    return apply_filters( 'user_contactmethods', $methods, $user );
     
    24752475 * @access private
    24762476 *
    2477  * @param WP_User $user Optional. WP_User object. Default null.
     2477 * @param WP_User|null $user Optional. WP_User object. Default null.
    24782478 * @return string[] Array of contact method labels keyed by contact method.
    24792479 */
  • trunk/src/wp-includes/widgets.php

    r51219 r51298  
    18291829 * @since 5.8.0
    18301830 *
    1831  * @return boolean Whether or not to use the block editor to manage widgets.
     1831 * @return bool Whether to use the block editor to manage widgets.
    18321832 */
    18331833function wp_use_widgets_block_editor() {
     
    18371837     * @since 5.8.0
    18381838     *
    1839      * @param boolean $use_widgets_block_editor Whether or not to use the block editor to manage widgets.
     1839     * @param bool $use_widgets_block_editor Whether to use the block editor to manage widgets.
    18401840     */
    18411841    return apply_filters(
  • trunk/src/wp-includes/wp-db.php

    r49942 r51298  
    10081008     * @param int    $blog_id Optional. The blog_id to prefix. Used only when prefix is requested.
    10091009     *                        Defaults to wpdb::$blogid.
    1010      * @return array Table names. When a prefix is requested, the key is the unprefixed table name.
     1010     * @return string[] Table names. When a prefix is requested, the key is the unprefixed table name.
    10111011     */
    10121012    public function tables( $scope = 'all', $prefix = true, $blog_id = 0 ) {
  • trunk/tests/phpunit/includes/factory/class-wp-unittest-factory-for-term.php

    r46986 r51298  
    8383     * @param null  $generation_definitions The default values.
    8484     *
    85      * @return WP_Term|WP_Error|null WP_Term on success. WP_error if taxonomy does not exist. Null for miscellaneous failure.
     85     * @return WP_Term|WP_Error|null WP_Term on success. WP_Error if taxonomy does not exist. Null for miscellaneous failure.
    8686     */
    8787    public function create_and_get( $args = array(), $generation_definitions = null ) {
     
    101101     * @param int $term_id ID of the term to retrieve.
    102102     *
    103      * @return WP_Term|WP_Error|null WP_Term on success. WP_error if taxonomy does not exist. Null for miscellaneous failure.
     103     * @return WP_Term|WP_Error|null WP_Term on success. WP_Error if taxonomy does not exist. Null for miscellaneous failure.
    104104     */
    105105    public function get_object_by_id( $term_id ) {
Note: See TracChangeset for help on using the changeset viewer.