Make WordPress Core

Changeset 32964


Ignore:
Timestamp:
06/27/2015 01:02:12 AM (10 years ago)
Author:
wonderboymusic
Message:

For doc block types, favor bool over the few remaining booleans

See #32444.

Location:
trunk/src
Files:
20 edited

Legend:

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

    r32730 r32964  
    320320     * @param bool   $return_me
    321321     * @param string $meta_key
    322      * @return boolean
     322     * @return bool
    323323     */
    324324    function wxr_filter_postmeta( $return_me, $meta_key ) {
  • trunk/src/wp-admin/includes/file.php

    r32642 r32964  
    838838 * @param string|false $context                      Optional. Context for get_filesystem_method(). Default false.
    839839 * @param bool         $allow_relaxed_file_ownership Optional. Whether to allow Group/World writable. Default false.
    840  * @return null|boolean false on failure, true on success.
     840 * @return null|bool false on failure, true on success.
    841841 */
    842842function WP_Filesystem( $args = false, $context = false, $allow_relaxed_file_ownership = false ) {
     
    997997 * @todo Properly mark optional arguments as such
    998998 *
    999  * @param string $form_post the URL to post the form to
    1000  * @param string $type the chosen Filesystem method in use
    1001  * @param boolean $error if the current request has failed to connect
    1002  * @param string $context The directory which is needed access to, The write-test will be performed on this directory by get_filesystem_method()
    1003  * @param array $extra_fields Extra POST fields which should be checked for to be included in the post.
    1004  * @param bool $allow_relaxed_file_ownership Whether to allow Group/World writable.
    1005  * @return boolean False on failure. True on success.
     999 * @param string $form_post    the URL to post the form to
     1000 * @param string $type         the chosen Filesystem method in use
     1001 * @param bool   $error        if the current request has failed to connect
     1002 * @param string $context      The directory which is needed access to, The write-test will be performed on this directory by get_filesystem_method()
     1003 * @param array  $extra_fields Extra POST fields which should be checked for to be included in the post.
     1004 * @param bool   $allow_relaxed_file_ownership Whether to allow Group/World writable.
     1005 * @return bool False on failure. True on success.
    10061006 */
    10071007function request_filesystem_credentials($form_post, $type = '', $error = false, $context = false, $extra_fields = null, $allow_relaxed_file_ownership = false ) {
  • trunk/src/wp-admin/includes/image-edit.php

    r32642 r32964  
    209209 * @param string $mime_type
    210210 * @param int $post_id
    211  * @return boolean
     211 * @return bool
    212212 */
    213213function wp_stream_image( $image, $mime_type, $post_id ) {
     
    265265 * @param string $mime_type
    266266 * @param int $post_id
    267  * @return boolean
     267 * @return bool
    268268 */
    269269function wp_save_image_file( $filename, $image, $mime_type, $post_id ) {
     
    553553 *
    554554 * @param int $post_id
    555  * @return boolean
     555 * @return bool
    556556 */
    557557function stream_preview_image( $post_id ) {
  • trunk/src/wp-admin/includes/media.php

    r32673 r32964  
    14941494    if ( 'image' == $type && $calling_post_id && current_theme_supports( 'post-thumbnails', get_post_type( $calling_post_id ) )
    14951495        && post_type_supports( get_post_type( $calling_post_id ), 'thumbnail' ) && get_post_thumbnail_id( $calling_post_id ) != $attachment_id ) {
    1496        
     1496
    14971497        $calling_post = get_post( $calling_post_id );
    14981498        $calling_post_type_object = get_post_type_object( $calling_post->post_type );
     
    17441744    $post_id = isset( $_REQUEST['post_id'] ) ? intval( $_REQUEST['post_id'] ) : 0;
    17451745
    1746     if ( ! empty( $post_id ) ) { 
    1747         $post_type = get_post_type( $post_id ); 
     1746    if ( ! empty( $post_id ) ) {
     1747        $post_type = get_post_type( $post_id );
    17481748    } else {
    1749         $post_type = ''; 
    1750     } 
     1749        $post_type = '';
     1750    }
    17511751
    17521752    echo '<script type="text/javascript">post_id = ' . $post_id . ';post_type = ' . $post_type . ';</script>';
     
    30253025 *
    30263026 * @param string $file Path to file.
    3027  * @return array|boolean Returns array of metadata, if found.
     3027 * @return array|bool Returns array of metadata, if found.
    30283028 */
    30293029function wp_read_audio_metadata( $file ) {
  • trunk/src/wp-admin/includes/template.php

    r32945 r32964  
    14831483 * @since 3.0.0
    14841484 *
    1485  * @param string $setting Optional slug title of a specific setting who's errors you want.
    1486  * @param boolean $sanitize Whether to re-sanitize the setting value before returning errors.
    1487  * @param boolean $hide_on_update If set to true errors will not be shown if the settings page has already been submitted.
     1485 * @param string $setting        Optional slug title of a specific setting who's errors you want.
     1486 * @param bool   $sanitize      Whether to re-sanitize the setting value before returning errors.
     1487 * @param bool  $hide_on_update If set to true errors will not be shown if the settings page has already been submitted.
    14881488 */
    14891489function settings_errors( $setting = '', $sanitize = false, $hide_on_update = false ) {
  • trunk/src/wp-includes/class-IXR.php

    r31004 r32964  
    153153     *
    154154     * @param array $array
    155      * @return boolean
     155     * @return bool
    156156     */
    157157    function isStruct($array)
  • trunk/src/wp-includes/class-http.php

    r32712 r32964  
    12561256     * @since 3.7.0 Combined with the fsockopen transport and switched to stream_socket_client().
    12571257     *
    1258      * @return boolean False means this class can not be used, true means it can.
     1258     * @return bool False means this class can not be used, true means it can.
    12591259     */
    12601260    public static function test( $args = array() ) {
     
    16351635     * @since 2.7.0
    16361636     *
    1637      * @return boolean False means this class can not be used, true means it can.
     1637     * @return bool False means this class can not be used, true means it can.
    16381638     */
    16391639    public static function test( $args = array() ) {
     
    20102010     *
    20112011     * @param string $url URL you intend to send this cookie to
    2012      * @return boolean true if allowed, false otherwise.
     2012     * @return bool true if allowed, false otherwise.
    20132013     */
    20142014    public function test( $url ) {
  • trunk/src/wp-includes/class-wp-customize-manager.php

    r32806 r32964  
    3939     * Whether this is a Customizer pageload.
    4040     *
    41      * @var boolean
     41     * @var bool
    4242     */
    4343    protected $previewing = false;
  • trunk/src/wp-includes/class-wp-customize-widgets.php

    r32874 r32964  
    14321432     *
    14331433     * @param string $option_name Option name.
    1434      * @return boolean Whether the option capture is ignored.
     1434     * @return bool Whether the option capture is ignored.
    14351435     */
    14361436    protected function is_option_capture_ignored( $option_name ) {
  • trunk/src/wp-includes/class-wp-image-editor-gd.php

    r32650 r32964  
    8888     * @access protected
    8989     *
    90      * @return boolean|WP_Error True if loaded successfully; WP_Error on failure.
     90     * @return bool|WP_Error True if loaded successfully; WP_Error on failure.
    9191     */
    9292    public function load() {
     
    161161     * @param  int|null $max_w Image width.
    162162     * @param  int|null $max_h Image height.
    163      * @param  boolean  $crop
     163     * @param  bool     $crop
    164164     * @return true|WP_Error
    165165     */
     
    273273     * @access public
    274274     *
    275      * @param int $src_x The start x position to crop from.
    276      * @param int $src_y The start y position to crop from.
    277      * @param int $src_w The width to crop.
    278      * @param int $src_h The height to crop.
    279      * @param int $dst_w Optional. The destination width.
    280      * @param int $dst_h Optional. The destination height.
    281      * @param boolean $src_abs Optional. If the source crop points are absolute.
    282      * @return boolean|WP_Error
     275     * @param int  $src_x  The start x position to crop from.
     276     * @param int  $src_y  The start y position to crop from.
     277     * @param int  $src_w  The width to crop.
     278     * @param int  $src_h  The height to crop.
     279     * @param int  $dst_w  Optional. The destination width.
     280     * @param int  $dst_h  Optional. The destination height.
     281     * @param bool $src_abs Optional. If the source crop points are absolute.
     282     * @return bool|WP_Error
    283283     */
    284284    public function crop( $src_x, $src_y, $src_w, $src_h, $dst_w = null, $dst_h = null, $src_abs = false ) {
     
    345345     * @access public
    346346     *
    347      * @param boolean $horz Flip along Horizontal Axis
    348      * @param boolean $vert Flip along Vertical Axis
     347     * @param bool $horz Flip along Horizontal Axis
     348     * @param bool $vert Flip along Vertical Axis
    349349     * @returns true|WP_Error
    350350     */
     
    477477     * @param callable $function
    478478     * @param array $arguments
    479      * @return boolean
     479     * @return bool
    480480     */
    481481    protected function make_image( $filename, $function, $arguments ) {
  • trunk/src/wp-includes/class-wp-image-editor-imagick.php

    r32800 r32964  
    4444     *
    4545     * @param array $args
    46      * @return boolean
     46     * @return bool
    4747     */
    4848    public static function test( $args = array() ) {
     
    9494     *
    9595     * @param string $mime_type
    96      * @return boolean
     96     * @return bool
    9797     */
    9898    public static function supports_mime_type( $mime_type ) {
     
    234234     * @param  int|null $max_w Image width.
    235235     * @param  int|null $max_h Image height.
    236      * @param  boolean  $crop
    237      * @return boolean|WP_Error
     236     * @param  bool     $crop
     237     * @return bool|WP_Error
    238238     */
    239239    public function resize( $max_w, $max_h, $crop = false ) {
     
    339339     * @access public
    340340     *
    341      * @param int $src_x The start x position to crop from.
    342      * @param int $src_y The start y position to crop from.
    343      * @param int $src_w The width to crop.
    344      * @param int $src_h The height to crop.
    345      * @param int $dst_w Optional. The destination width.
    346      * @param int $dst_h Optional. The destination height.
    347      * @param boolean $src_abs Optional. If the source crop points are absolute.
    348      * @return boolean|WP_Error
     341     * @param int  $src_x The start x position to crop from.
     342     * @param int  $src_y The start y position to crop from.
     343     * @param int  $src_w The width to crop.
     344     * @param int  $src_h The height to crop.
     345     * @param int  $dst_w Optional. The destination width.
     346     * @param int  $dst_h Optional. The destination height.
     347     * @param bool $src_abs Optional. If the source crop points are absolute.
     348     * @return bool|WP_Error
    349349     */
    350350    public function crop( $src_x, $src_y, $src_w, $src_h, $dst_w = null, $dst_h = null, $src_abs = false ) {
     
    412412     * @access public
    413413     *
    414      * @param boolean $horz Flip along Horizontal Axis
    415      * @param boolean $vert Flip along Vertical Axis
     414     * @param bool $horz Flip along Horizontal Axis
     415     * @param bool $vert Flip along Vertical Axis
    416416     * @returns true|WP_Error
    417417     */
  • trunk/src/wp-includes/class-wp-image-editor.php

    r32800 r32964  
    3838     *
    3939     * @param array $args
    40      * @return boolean
     40     * @return bool
    4141     */
    4242    public static function test( $args = array() ) {
     
    5555     *
    5656     * @param string $mime_type
    57      * @return boolean
     57     * @return bool
    5858     */
    5959    public static function supports_mime_type( $mime_type ) {
     
    6868     * @abstract
    6969     *
    70      * @return boolean|WP_Error True if loaded; WP_Error on failure.
     70     * @return bool|WP_Error True if loaded; WP_Error on failure.
    7171     */
    7272    abstract public function load();
     
    9898     * @param  int|null $max_w Image width.
    9999     * @param  int|null $max_h Image height.
    100      * @param  boolean  $crop
    101      * @return boolean|WP_Error
     100     * @param  bool     $crop
     101     * @return bool|WP_Error
    102102     */
    103103    abstract public function resize( $max_w, $max_h, $crop = false );
     
    136136     * @param int $dst_w Optional. The destination width.
    137137     * @param int $dst_h Optional. The destination height.
    138      * @param boolean $src_abs Optional. If the source crop points are absolute.
    139      * @return boolean|WP_Error
     138     * @param bool $src_abs Optional. If the source crop points are absolute.
     139     * @return bool|WP_Error
    140140     */
    141141    abstract public function crop( $src_x, $src_y, $src_w, $src_h, $dst_w = null, $dst_h = null, $src_abs = false );
     
    149149     *
    150150     * @param float $angle
    151      * @return boolean|WP_Error
     151     * @return bool|WP_Error
    152152     */
    153153    abstract public function rotate( $angle );
     
    160160     * @abstract
    161161     *
    162      * @param boolean $horz Flip along Horizontal Axis
    163      * @param boolean $vert Flip along Vertical Axis
    164      * @return boolean|WP_Error
     162     * @param bool $horz Flip along Horizontal Axis
     163     * @param bool $vert Flip along Vertical Axis
     164     * @return bool|WP_Error
    165165     */
    166166    abstract public function flip( $horz, $vert );
     
    174174     *
    175175     * @param string $mime_type
    176      * @return boolean|WP_Error
     176     * @return bool|WP_Error
    177177     */
    178178    abstract public function stream( $mime_type = null );
     
    411411     * @param callable $function
    412412     * @param array $arguments
    413      * @return boolean
     413     * @return bool
    414414     */
    415415    protected function make_image( $filename, $function, $arguments ) {
  • trunk/src/wp-includes/class.wp-dependencies.php

    r32483 r32964  
    332332     * @param array  $queue  An array of queued _WP_Dependency handle objects.
    333333     * @param string $handle Name of the item. Should be unique.
    334      * @return boolean Whether the handle is found after recursively searching the dependency tree.
     334     * @return bool Whether the handle is found after recursively searching the dependency tree.
    335335     */
    336336    protected function recurse_deps( $queue, $handle ) {
  • trunk/src/wp-includes/comment.php

    r32911 r32964  
    14941494 *
    14951495 * @param array $comments Optional array of comment objects. Defaults to $wp_query->comments
    1496  * @param int $per_page Optional comments per page.
    1497  * @param boolean $threaded Optional control over flat or threaded comments.
     1496 * @param int   $per_page Optional comments per page.
     1497 * @param bool  $threaded Optional control over flat or threaded comments.
    14981498 * @return int Number of comment pages.
    14991499 */
  • trunk/src/wp-includes/deprecated.php

    r32899 r32964  
    24462446 * @deprecated Use add_theme_support( 'automatic-feed-links' )
    24472447 *
    2448  * @param boolean $add Optional, default is true. Add or remove links. Defaults to true.
     2448 * @param bool $add Optional, default is true. Add or remove links. Defaults to true.
    24492449 */
    24502450function automatic_feed_links( $add = true ) {
  • trunk/src/wp-includes/link-template.php

    r32954 r32964  
    20582058 * @since 0.71
    20592059 *
    2060  * @param int     $max_page Optional. Max pages.
    2061  * @param boolean $echo     Optional. Echo or return;
     2060 * @param int   $max_page Optional. Max pages.
     2061 * @param bool  $echo     Optional. Echo or return;
    20622062 * @return string|void The link URL for next posts page if `$echo = false`.
    20632063 */
     
    21522152 * @since 0.71
    21532153 *
    2154  * @param boolean $echo Optional. Echo or return;
     2154 * @param bool $echo Optional. Echo or return;
    21552155 * @return string|void The previous posts page link if `$echo = false`.
    21562156 */
  • trunk/src/wp-includes/plugin.php

    r32829 r32964  
    616616 * @param callback $function_to_remove The name of the function which should be removed.
    617617 * @param int      $priority           Optional. The priority of the function. Default 10.
    618  * @return boolean Whether the function is removed.
     618 * @return bool Whether the function is removed.
    619619 */
    620620function remove_action( $tag, $function_to_remove, $priority = 10 ) {
  • trunk/src/wp-includes/theme.php

    r32928 r32964  
    11601160 *
    11611161 * @param string $type The random pool to use. any|default|uploaded
    1162  * @return boolean
     1162 * @return bool
    11631163 */
    11641164function is_random_header_image( $type = 'any' ) {
  • trunk/src/wp-includes/wp-db.php

    r32641 r32964  
    177177     * @access private
    178178     * @see wpdb::check_safe_collation()
    179      * @var boolean
     179     * @var bool
    180180     */
    181181    private $checking_collation = false;
  • trunk/src/wp-signup.php

    r32733 r32964  
    300300 * @since MU
    301301 *
    302  * @return null|boolean True if blog signup was validated, false if error.
    303  *                      The function halts all execution if the user is not logged in.
     302 * @return null|bool True if blog signup was validated, false if error.
     303 *                   The function halts all execution if the user is not logged in.
    304304 */
    305305function validate_another_blog_signup() {
Note: See TracChangeset for help on using the changeset viewer.