Make WordPress Core

Changeset 32568


Ignore:
Timestamp:
05/24/2015 05:39:47 AM (10 years ago)
Author:
wonderboymusic
Message:

Use void instead of null where appropriate when pipe-delimiting @return types. If a @return only contains void, remove it.

See #32444.

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

Legend:

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

    r32538 r32568  
    7171 * @since 2.8.0
    7272 *
    73  * @return string|null The author's display name.
     73 * @return string|void The author's display name.
    7474 */
    7575function get_the_modified_author() {
     
    333333 *     @type string $exclude       An array, comma-, or space-separated list of author IDs to include. Default empty.
    334334 * }
    335  * @return null|string The output, if echo is set to false. Otherwise null.
     335 * @return string|void The output, if echo is set to false.
    336336 */
    337337function wp_list_authors( $args = '' ) {
  • trunk/src/wp-includes/bookmark-template.php

    r30536 r32568  
    196196 *                                      Default 'ASC'.
    197197 * }
    198  * @return string|null Will only return if echo option is set to not echo. Default is not return anything.
     198 * @return string|void Will only return if echo option is set to not echo. Default is not return anything.
    199199 */
    200200function wp_list_bookmarks( $args = '' ) {
  • trunk/src/wp-includes/canonical.php

    r32540 r32568  
    3737 *      figure if redirect is needed.
    3838 * @param bool $do_redirect Optional. Redirect to the new URL.
    39  * @return null|string Null, if redirect not needed, or the string of the URL
     39 * @return string|void The string of the URL, if redirect needed.
    4040 */
    4141function redirect_canonical( $requested_url = null, $do_redirect = true ) {
  • trunk/src/wp-includes/capabilities.php

    r32548 r32568  
    177177     * @param string $display_name Role display name.
    178178     * @param array $capabilities List of role capabilities in the above format.
    179      * @return WP_Role|null WP_Role object if role is added, null if already exists.
     179     * @return WP_Role|void WP_Role object, if role is added.
    180180     */
    181181    public function add_role( $role, $display_name, $capabilities = array() ) {
  • trunk/src/wp-includes/category-template.php

    r32542 r32568  
    632632 *
    633633 * @param array|string|null $args Optional. Override default arguments.
    634  * @return null|array Generated tag cloud, only if no failures and 'array' is set for the 'format' argument.
     634 * @return void|array Generated tag cloud, only if no failures and 'array' is set for the 'format' argument.
    635635 *                    Otherwise, this function outputs the tag cloud.
    636636 */
     
    14061406 * @param string $sep Optional. Separate items using this.
    14071407 * @param string $after Optional. After list.
    1408  * @return false|null False on WordPress error. Returns null when displaying.
     1408 * @return false|void False on WordPress error.
    14091409 */
    14101410function the_terms( $id, $taxonomy, $before = '', $sep = ', ', $after = '' ) {
  • trunk/src/wp-includes/category.php

    r32532 r32568  
    100100 * @param bool $full_match Optional. Whether full path should be matched.
    101101 * @param string $output Optional. Constant OBJECT, ARRAY_A, or ARRAY_N
    102  * @return null|object|array|WP_Error Null on failure. Type is based on $output value.
     102 * @return object|array|WP_Error|void Type is based on $output value.
    103103 */
    104104function get_category_by_path( $category_path, $full_match = true, $output = OBJECT ) {
  • trunk/src/wp-includes/class-wp-admin-bar.php

    r32534 r32568  
    1515    /**
    1616     * @param string $name
    17      * @return string|array|null
     17     * @return string|array|void
    1818     */
    1919    public function __get( $name ) {
     
    174174    /**
    175175     * @param string $id
    176      * @return object|null
     176     * @return object|void
    177177     */
    178178    final protected function _get_node( $id ) {
     
    188188
    189189    /**
    190      * @return array|null
     190     * @return array|void
    191191     */
    192192    final public function get_nodes() {
     
    201201
    202202    /**
    203      * @return array|null
     203     * @return array|void
    204204     */
    205205    final protected function _get_nodes() {
     
    253253
    254254    /**
    255      * @return object|null
     255     * @return object|void
    256256     */
    257257    final protected function _bind() {
  • trunk/src/wp-includes/class-wp-customize-control.php

    r32542 r32568  
    11311131
    11321132    /**
    1133      * @return string|null
     1133     * @return string|void
    11341134     */
    11351135    public function get_current_image_src() {
  • trunk/src/wp-includes/class-wp-customize-manager.php

    r32535 r32568  
    900900     *
    901901     * @param string $id Customize Setting ID.
    902      * @return WP_Customize_Setting|null The setting, if set.
     902     * @return WP_Customize_Setting|void The setting, if set.
    903903     */
    904904    public function get_setting( $id ) {
     
    945945     *
    946946     * @param string $id Panel ID to get.
    947      * @return WP_Customize_Panel|null Requested panel instance, if set.
     947     * @return WP_Customize_Panel|void Requested panel instance, if set.
    948948     */
    949949    public function get_panel( $id ) {
     
    988988     *
    989989     * @param string $id Section ID.
    990      * @return WP_Customize_Section|null The section, if set.
     990     * @return WP_Customize_Section|void The section, if set.
    991991     */
    992992    public function get_section( $id ) {
     
    10301030     *
    10311031     * @param string $id ID of the control.
    1032      * @return WP_Customize_Control|null The control object, if set.
     1032     * @return WP_Customize_Control|void The control object, if set.
    10331033     */
    10341034    public function get_control( $id ) {
     
    15331533 * Sanitizes a hex color.
    15341534 *
    1535  * Returns either '', a 3 or 6 digit hex color (with #), or null.
     1535 * Returns either '', a 3 or 6 digit hex color (with #), or nothing.
    15361536 * For sanitizing values without a #, see sanitize_hex_color_no_hash().
    15371537 *
     
    15391539 *
    15401540 * @param string $color
    1541  * @return string|null
     1541 * @return string|void
    15421542 */
    15431543function sanitize_hex_color( $color ) {
  • trunk/src/wp-includes/class-wp-customize-setting.php

    r32542 r32568  
    130130     * @access public
    131131     *
    132      * @return bool|null Returns null if preview() has not been called yet.
     132     * @return bool|void If preview() has been called.
    133133     */
    134134    public function is_current_blog_previewed() {
     
    236236     * @since 3.4.0
    237237     *
    238      * @return false|null False if cap check fails or value isn't set.
     238     * @return false|void False if cap check fails or value isn't set.
    239239     */
    240240    final public function save() {
     
    462462     * @param $keys
    463463     * @param bool $create Default is false.
    464      * @return null|array Keys are 'root', 'node', and 'key'.
     464     * @return array|void Keys are 'root', 'node', and 'key'.
    465465     */
    466466    final protected function multidimensional( &$root, $keys, $create = false ) {
  • trunk/src/wp-includes/class-wp-customize-widgets.php

    r32542 r32568  
    110110     *
    111111     * @param $setting_id Setting ID.
    112      * @return string|null Setting type. Null otherwise.
     112     * @return string|void Setting type.
    113113     */
    114114    protected function get_setting_type( $setting_id ) {
     
    11371137     *
    11381138     * @param array $value Widget instance to sanitize.
    1139      * @return array|null Sanitized widget instance.
     1139     * @return array|void Sanitized widget instance.
    11401140     */
    11411141    public function sanitize_widget_instance( $value ) {
  • trunk/src/wp-includes/class-wp-error.php

    r31188 r32568  
    145145     *
    146146     * @param string|int $code Optional. Error code.
    147      * @return mixed Null, if no errors.
     147     * @return mixed Error data, if it exists.
    148148     */
    149149    public function get_error_data($code = '') {
     
    153153        if ( isset($this->error_data[$code]) )
    154154            return $this->error_data[$code];
    155         return null;
    156155    }
    157156
  • trunk/src/wp-includes/class-wp-theme.php

    r32550 r32568  
    185185     * @param string $theme_dir Directory of the theme within the theme_root.
    186186     * @param string $theme_root Theme root.
    187      * @param WP_Error|null $_child If this theme is a parent theme, the child may be passed for validation purposes.
     187     * @param WP_Error|void $_child If this theme is a parent theme, the child may be passed for validation purposes.
    188188     */
    189189    public function __construct( $theme_dir, $theme_root, $_child = null ) {
  • trunk/src/wp-includes/class-wp-xmlrpc-server.php

    r32565 r32568  
    292292     *
    293293     * @param string|array $data Escape single string or array of strings.
    294      * @return string|null Returns with string is passed, alters by-reference
     294     * @return string|void Returns with string is passed, alters by-reference
    295295     *                     when array is passed.
    296296     */
  • trunk/src/wp-includes/class.wp-scripts.php

    r32566 r32568  
    6868     * @param string $handle
    6969     * @param bool   $echo
    70      * @return bool|string|null
     70     * @return bool|string|void
    7171     */
    7272    public function print_scripts_l10n( $handle, $echo = true ) {
     
    7878     * @param string $handle
    7979     * @param bool   $echo
    80      * @return bool|string|null
     80     * @return bool|string|void
    8181     */
    8282    public function print_extra_script( $handle, $echo = true ) {
  • trunk/src/wp-includes/comment-template.php

    r32567 r32568  
    389389 * @param bool         $echo       Optional. Whether to cho or return the output.
    390390 *                                 Default true.
    391  * @return string|null
     391 * @return string|void
    392392 */
    393393function comment_class( $class = '', $comment_id = null, $post_id = null, $echo = true ) {
     
    11431143 * @param bool   $separate_comments Optional. Whether to separate the comments by comment type.
    11441144 *                                  Default false.
    1145  * @return null Returns null if no comments appear.
    11461145 */
    11471146function comments_template( $file = '/comments.php', $separate_comments = false ) {
     
    12881287 * @param string $none      Optional. String to display when comments have been turned off.
    12891288 *                          Default false.
    1290  * @return null Returns null on single posts and pages.
    12911289 */
    12921290function comments_popup_link( $zero = false, $one = false, $more = false, $css_class = '', $none = false ) {
     
    13871385 * @param int|WP_Post $post    Post ID or WP_Post object the comment is going to be displayed on.
    13881386 *                             Default current post.
    1389  * @return null|false|string Link to show comment form, if successful. False, if comments are closed.
     1387 * @return void|false|string Link to show comment form, if successful. False, if comments are closed.
    13901388 */
    13911389function get_comment_reply_link( $args = array(), $comment = null, $post = null ) {
     
    17901788     * @param array  $args              An array of arguments.
    17911789     * @param string $output            Passed by reference. Used to append additional content.
    1792      * @return null Null on failure with no changes to parameters.
    17931790     */
    17941791    public function display_element( $element, &$children_elements, $max_depth, $depth, $args, &$output ) {
    1795 
    17961792        if ( !$element )
    17971793            return;
Note: See TracChangeset for help on using the changeset viewer.