WordPress.org

Make WordPress Core

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

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

include this patch with 2 replaced @return integer to int

  • src/wp-includes/class-http.php

     
    10761076         * @since 3.7.0
    10771077         *
    10781078         * @param string $maybe_ip A suspected IP address.
    1079          * @return integer|bool Upon success, '4' or '6' to represent a IPv4 or IPv6 address, false upon failure
     1079         * @return int|bool Upon success, '4' or '6' to represent a IPv4 or IPv6 address, false upon failure
    10801080         */
    10811081        public static function is_ip_address( $maybe_ip ) {
    10821082                if ( preg_match( '/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/', $maybe_ip ) ) {
  • src/wp-includes/class-json.php

     
    932932     * @deprecated 5.3.0 Use the PHP native JSON extension instead.
    933933     *
    934934     * @param string
    935      * @return integer length
     935     * @return int length
    936936     */
    937937    function strlen8( $str )
    938938    {
     
    950950     * @deprecated 5.3.0 Use the PHP native JSON extension instead.
    951951     *
    952952     * @param string
    953      * @param integer start
    954      * @param integer length
    955      * @return integer length
     953     * @param int start
     954     * @param int length
     955     * @return int length
    956956     */
    957957    function substr8( $string, $start, $length=false )
    958958    {
  • src/wp-includes/Requests/Transport/cURL.php

     
    432432         *
    433433         * @param resource $handle cURL resource
    434434         * @param string $headers Header string
    435          * @return integer Length of provided header
     435         * @return int Length of provided header
    436436         */
    437437        public function stream_headers($handle, $headers) {
    438438                // Why do we do this? cURL will send both the final response and any
     
    457457         *
    458458         * @param resource $handle cURL resource
    459459         * @param string $data Body data
    460          * @return integer Length of provided data
     460         * @return int Length of provided data
    461461         */
    462462        public function stream_body($handle, $data) {
    463463                $this->hooks->dispatch('request.progress', array($data, $this->response_bytes, $this->response_byte_limit));
  • src/wp-includes/rest-api.php

     
    11611161 *
    11621162 * @since 4.7.0
    11631163 *
    1164  * @return integer 401 if the user is not logged in, 403 if the user is logged in.
     1164 * @return int 401 if the user is not logged in, 403 if the user is logged in.
    11651165 */
    11661166function rest_authorization_required_code() {
    11671167        return is_user_logged_in() ? 403 : 401;
  • src/wp-includes/Text/Diff.php

     
    7575     *
    7676     * @since Text_Diff 1.1.0
    7777     *
    78      * @return integer The number of new lines
     78     * @return int The number of new lines
    7979     */
    8080    function countAddedLines()
    8181    {
     
    9494     *
    9595     * @since Text_Diff 1.1.0
    9696     *
    97      * @return integer The number of deleted lines
     97     * @return int The number of deleted lines
    9898     */
    9999    function countDeletedLines()
    100100    {
     
    156156     *
    157157     * This is mostly for diagnostic purposes.
    158158     *
    159      * @return integer  The length of the LCS.
     159     * @return int  The length of the LCS.
    160160     */
    161161    function lcs()
    162162    {
     
    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    {