WordPress.org

Make WordPress Core

Ticket #51426: 51426-php-code-standards.patch

File 51426-php-code-standards.patch, 14.0 KB (added by ravipatel, 14 months ago)

Per core's PHP documentation standards: use bool and int

  • src/wp-admin/includes/media.php

     
    176176 * @since 2.6.0
    177177 *
    178178 * @param string  $html    The image HTML markup to send.
    179  * @param integer $id      Image attachment ID.
     179 * @param int    $id      Image attachment ID.
    180180 * @param string  $caption Image caption.
    181181 * @param string  $title   Image title attribute (not used).
    182182 * @param string  $align   Image CSS alignment property.
     
    13191319 * @since 2.5.0
    13201320 *
    13211321 * @param string  $html
    1322  * @param integer $attachment_id
     1322 * @param int    $attachment_id
    13231323 * @param array   $attachment
    13241324 * @return string
    13251325 */
     
    22752275 *
    22762276 * @param string  $type
    22772277 * @param object  $errors
    2278  * @param integer $id
     2278 * @param int    $id
    22792279 */
    22802280function media_upload_type_form( $type = 'file', $errors = null, $id = null ) {
    22812281
     
    23492349 *
    23502350 * @param string  $type
    23512351 * @param object  $errors
    2352  * @param integer $id
     2352 * @param int    $id
    23532353 */
    23542354function media_upload_type_url_form( $type = null, $errors = null, $id = null ) {
    23552355        if ( null === $type ) {
  • src/wp-content/themes/twentyseventeen/inc/template-tags.php

     
    127127 * Display a front page section.
    128128 *
    129129 * @param WP_Customize_Partial $partial Partial associated with a selective refresh request.
    130  * @param integer              $id Front page section to display.
     130 * @param int $id Front page section to display.
    131131 */
    132132function twentyseventeen_front_page_section( $partial = null, $id = 0 ) {
    133133        if ( is_a( $partial, 'WP_Customize_Partial' ) ) {
  • src/wp-content/themes/twentythirteen/functions.php

     
    515515         *
    516516         * @since Twenty Thirteen 1.0
    517517         *
    518          * @param boolean $echo (optional) Whether to echo the date. Default true.
     518         * @param bool $echo (optional) Whether to echo the date. Default true.
    519519         * @return string The HTML-formatted post date.
    520520         */
    521521        function twentythirteen_entry_date( $echo = true ) {
  • src/wp-includes/class-json.php

     
    950950     * @deprecated 5.3.0 Use the PHP native JSON extension instead.
    951951     *
    952952     * @param string
    953      * @param integer start
    954      * @param integer length
     953     * @param int start
     954     * @param int length
    955955     * @return integer length
    956956     */
    957957    function substr8( $string, $start, $length=false )
  • src/wp-includes/class-requests.php

     
    498498         * Get the default options
    499499         *
    500500         * @see Requests::request() for values returned by this method
    501          * @param boolean $multirequest Is this a multirequest?
     501         * @param bool $multirequest Is this a multirequest?
    502502         * @return array Default option values
    503503         */
    504504        protected static function get_default_options($multirequest = false) {
  • src/wp-includes/class-simplepie.php

     
    13041304        /**
    13051305         * Set the limit for items returned per-feed with multifeeds
    13061306         *
    1307          * @param integer $limit The maximum number of items to return.
     1307         * @param int $limit The maximum number of items to return.
    13081308         */
    13091309        public function set_item_limit($limit = 0)
    13101310        {
  • src/wp-includes/class-wp-simplepie-file.php

     
    2323         * @since 3.2.0 Updated to use a PHP5 constructor.
    2424         *
    2525         * @param string       $url             Remote file URL.
    26          * @param integer      $timeout         Optional. How long the connection should stay open in seconds.
     26         * @param int          $timeout         Optional. How long the connection should stay open in seconds.
    2727         *                                      Default 10.
    28          * @param integer      $redirects       Optional. The number of allowed redirects. Default 5.
     28         * @param int          $redirects       Optional. The number of allowed redirects. Default 5.
    2929         * @param string|array $headers         Optional. Array or string of headers to send with the request.
    3030         *                                      Default null.
    3131         * @param string       $useragent       Optional. User-agent value sent. Default null.
    32          * @param boolean      $force_fsockopen Optional. Whether to force opening internet or unix domain socket
     32         * @param bool      $force_fsockopen Optional. Whether to force opening internet or unix domain socket
    3333         *                                      connection or not. Default false.
    3434         */
    3535        public function __construct( $url, $timeout = 10, $redirects = 5, $headers = null, $useragent = null, $force_fsockopen = false ) {
  • src/wp-includes/class-wp-simplepie-sanitize-kses.php

     
    2727         * @since 3.5.0
    2828         *
    2929         * @param mixed   $data The data that needs to be sanitized.
    30          * @param integer $type The type of data that it's supposed to be.
     30         * @param int $type The type of data that it's supposed to be.
    3131         * @param string  $base Optional. The `xml:base` value to use when converting relative
    3232         *                      URLs to absolute ones. Default empty.
    3333         * @return mixed Sanitized data.
  • src/wp-includes/class-wp-widget.php

     
    544544         *
    545545         * @since 2.8.0
    546546         *
    547          * @param integer $number Optional. The unique order number of this widget instance
     547         * @param int $number Optional. The unique order number of this widget instance
    548548         *                        compared to other instances of the same class. Default -1.
    549549         */
    550550        public function _register_one( $number = -1 ) {
  • src/wp-includes/class-wp-xmlrpc-server.php

     
    55735573         *
    55745574         * @since 2.8.0
    55755575         *
    5576          * @param integer $post_ID   Post ID.
     5576         * @param int $post_ID   Post ID.
    55775577         * @param array   $enclosure Enclosure data.
    55785578         */
    55795579        public function add_enclosure_if_new( $post_ID, $enclosure ) {
  • src/wp-includes/pomo/streams.php

     
    6262                /**
    6363                 * Reads an array of 32-bit Integers from the Stream
    6464                 *
    65                  * @param integer $count How many elements should be read
     65                 * @param int $count How many elements should be read
    6666                 * @return mixed Array of integers or false if there isn't
    6767                 *  enough data or on error
    6868                 */
  • src/wp-includes/pomo/translations.php

     
    116116                 * This function should be overridden by the subclasses. For example MO/PO can derive the logic
    117117                 * from their headers.
    118118                 *
    119                  * @param integer $count number of items
     119                 * @param int $count number of items
    120120                 */
    121121                function select_plural_form( $count ) {
    122122                        return 1 == $count ? 0 : 1;
  • src/wp-includes/Requests/Exception.php

     
    3131         * @param string $message Exception message
    3232         * @param string $type Exception type
    3333         * @param mixed $data Associated data
    34          * @param integer $code Exception numerical code, if applicable
     34         * @param int $code Exception numerical code, if applicable
    3535         */
    3636        public function __construct($message, $type, $data = null, $code = 0) {
    3737                parent::__construct($message, $code);
  • src/wp-includes/Requests/Response.php

     
    105105         *
    106106         * @throws Requests_Exception If `$allow_redirects` is false, and code is 3xx (`response.no_redirects`)
    107107         * @throws Requests_Exception_HTTP On non-successful status code. Exception class corresponds to code (e.g. {@see Requests_Exception_HTTP_404})
    108          * @param boolean $allow_redirects Set to false to throw on a 3xx as well
     108         * @param bool $allow_redirects Set to false to throw on a 3xx as well
    109109         */
    110110        public function throw_for_status($allow_redirects = true) {
    111111                if ($this->is_redirect()) {
  • src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php

     
    13711371         * @since 4.9.0 Added the `$validate` parameter.
    13721372         *
    13731373         * @param string  $template Page template filename.
    1374          * @param integer $post_id  Post ID.
     1374         * @param int    $post_id  Post ID.
    13751375         * @param bool    $validate Whether to validate that the template selected is valid.
    13761376         */
    13771377        public function handle_template( $template, $post_id, $validate = false ) {
  • src/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php

     
    11731173         *
    11741174         * @since 4.7.0
    11751175         *
    1176          * @param integer $user_id User ID.
     1176         * @param int $user_id User ID.
    11771177         * @param array   $roles   New user roles.
    11781178         * @return true|WP_Error True if the current user is allowed to make the role change,
    11791179         *                       otherwise a WP_Error object.
  • src/wp-includes/SimplePie/HTTP/Parser.php

     
    498498        /**
    499499         * Prepare headers (take care of proxies headers)
    500500         *
    501          * @param string  $headers Raw headers
    502          * @param integer $count  Redirection count. Default to 1.
     501         * @param string $headers Raw headers
     502         * @param int $count Redirection count. Default to 1.
    503503         *
    504504         * @return string
    505505         */
  • src/wp-includes/Text/Diff.php

     
    210210     * with array_walk().
    211211     *
    212212     * @param string $line  The line to trim.
    213      * @param integer $key  The index of the line in the array. Not used.
     213     * @param int $key  The index of the line in the array. Not used.
    214214     */
    215215    static function trimNewlines(&$line, $key)
    216216    {
  • src/wp-includes/widgets/class-wp-widget-custom-html.php

     
    5858         *
    5959         * @since 4.9.0
    6060         *
    61          * @param integer $number Optional. The unique order number of this widget instance
     61         * @param int $number Optional. The unique order number of this widget instance
    6262         *                        compared to other instances of the same class. Default -1.
    6363         */
    6464        public function _register_one( $number = -1 ) {
  • src/wp-includes/widgets/class-wp-widget-media.php

     
    9696         *
    9797         * @since 4.8.0
    9898         *
    99          * @param integer $number Optional. The unique order number of this widget instance
     99         * @param int $number Optional. The unique order number of this widget instance
    100100         *                        compared to other instances of the same class. Default -1.
    101101         */
    102102        public function _register_one( $number = -1 ) {
  • src/wp-includes/widgets/class-wp-widget-text.php

     
    4545        /**
    4646         * Add hooks for enqueueing assets when registering all widget instances of this widget class.
    4747         *
    48          * @param integer $number Optional. The unique order number of this widget instance
     48         * @param int $number Optional. The unique order number of this widget instance
    4949         *                        compared to other instances of the same class. Default -1.
    5050         */
    5151        public function _register_one( $number = -1 ) {