Make WordPress Core

Changeset 45580


Ignore:
Timestamp:
07/01/2019 08:00:12 AM (7 years ago)
Author:
pento
Message:

Coding Standards: Fix/ignore the WordPress.NamingConventions.ValidFunctionName violations.

See #47632

Location:
trunk
Files:
26 edited

Legend:

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

    r45519 r45580  
    17211721 * @return bool|null True on success, false on failure, null if the filesystem method class file does not exist.
    17221722 */
    1723 function WP_Filesystem( $args = false, $context = false, $allow_relaxed_file_ownership = false ) {
     1723function WP_Filesystem( $args = false, $context = false, $allow_relaxed_file_ownership = false ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid
    17241724        global $wp_filesystem;
    17251725
  • trunk/src/wp-admin/includes/misc.php

    r45448 r45580  
    832832 * @param string $filename
    833833 */
    834 function saveDomDocument( $doc, $filename ) {
     834function saveDomDocument( $doc, $filename ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid
    835835        $config = $doc->saveXML();
    836836        $config = preg_replace( "/([^\r])\n/", "$1\r\n", $config );
  • trunk/src/wp-admin/includes/upgrade.php

    r45448 r45580  
    24542454 * @return mixed
    24552455 */
    2456 function __get_option( $setting ) {
     2456function __get_option( $setting ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionDoubleUnderscore
    24572457        global $wpdb;
    24582458
    … …  
    25232523 * @return array Strings containing the results of the various update queries.
    25242524 */
    2525 function dbDelta( $queries = '', $execute = true ) {
     2525function dbDelta( $queries = '', $execute = true ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid
    25262526        global $wpdb;
    25272527
  • trunk/src/wp-admin/link-parse-opml.php

    r42343 r45580  
    3232 * @param array $attrs XML element attributes.
    3333 */
    34 function startElement( $parser, $tagName, $attrs ) {
     34function startElement( $parser, $tagName, $attrs ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid
    3535        global $names, $urls, $targets, $descriptions, $feeds;
    3636
    … …  
    6969 * @param string $tagName XML tag name.
    7070 */
    71 function endElement( $parser, $tagName ) {
     71function endElement( $parser, $tagName ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid
    7272        // Nothing to do.
    7373}
  • trunk/src/wp-includes/author-template.php

    r45235 r45580  
    564564 * @access private
    565565 */
    566 function __clear_multi_author_cache() {
     566function __clear_multi_author_cache() { //phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionDoubleUnderscore
    567567        delete_transient( 'is_multi_author' );
    568568}
  • trunk/src/wp-includes/category-template.php

    r44572 r45580  
    106106 * @return string|WP_Error Category name on success, WP_Error on failure.
    107107 */
    108 function get_the_category_by_ID( $cat_ID ) {
     108function get_the_category_by_ID( $cat_ID ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid
    109109        $cat_ID   = (int) $cat_ID;
    110110        $category = get_term( $cat_ID );
  • trunk/src/wp-includes/category.php

    r43571 r45580  
    198198 * @return int 0, if failure and ID of category on success.
    199199 */
    200 function get_cat_ID( $cat_name ) {
     200function get_cat_ID( $cat_name ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid
    201201        $cat = get_term_by( 'name', $cat_name, 'category' );
    202202        if ( $cat ) {
  • trunk/src/wp-includes/class-http.php

    r45504 r45580  
    648648         * @return array Array with 'headers' and 'body' keys.
    649649         */
    650         public static function processResponse( $strResponse ) {
     650        public static function processResponse( $strResponse ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid
    651651                $res = explode( "\r\n\r\n", $strResponse, 2 );
    652652
    … …  
    670670         *                  Then a numbered array is returned as the value of that header-key.
    671671         */
    672         public static function processHeaders( $headers, $url = '' ) {
     672        public static function processHeaders( $headers, $url = '' ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid
    673673                // Split headers, one per array element.
    674674                if ( is_string( $headers ) ) {
    … …  
    753753         * @param array $r Full array of args passed into ::request()
    754754         */
    755         public static function buildCookieHeader( &$r ) {
     755        public static function buildCookieHeader( &$r ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid
    756756                if ( ! empty( $r['cookies'] ) ) {
    757757                        // Upgrade any name => value cookie pairs to WP_HTTP_Cookie instances.
    … …  
    789789         * @return string Chunked decoded body on success or raw body on failure.
    790790         */
    791         public static function chunkTransferDecode( $body ) {
     791        public static function chunkTransferDecode( $body ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid
    792792                // The body is not chunked encoded or is malformed.
    793793                if ( ! preg_match( '/^([0-9a-f]+)[^\r\n]*\r\n/i', trim( $body ) ) ) {
  • trunk/src/wp-includes/class-wp-http-cookie.php

    r45135 r45580  
    212212         * @return string Header encoded cookie name and value.
    213213         */
    214         public function getHeaderValue() {
     214        public function getHeaderValue() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid
    215215                if ( ! isset( $this->name ) || ! isset( $this->value ) ) {
    216216                        return '';
    … …  
    235235         * @return string
    236236         */
    237         public function getFullHeader() {
     237        public function getFullHeader() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid
    238238                return 'Cookie: ' . $this->getHeaderValue();
    239239        }
  • trunk/src/wp-includes/class-wp-http-response.php

    r41707 r45580  
    148148         * @return mixed Any JSON-serializable value.
    149149         */
    150         public function jsonSerialize() {
     150        public function jsonSerialize() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid
    151151                return $this->get_data();
    152152        }
  • trunk/src/wp-includes/comment-template.php

    r45505 r45580  
    263263 * @return string Comment author's IP address.
    264264 */
    265 function get_comment_author_IP( $comment_ID = 0 ) {
     265function get_comment_author_IP( $comment_ID = 0 ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid
    266266        $comment = get_comment( $comment_ID );
    267267
    … …  
    288288 *                                   Default current comment.
    289289 */
    290 function comment_author_IP( $comment_ID = 0 ) {
     290function comment_author_IP( $comment_ID = 0 ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid
    291291        echo esc_html( get_comment_author_IP( $comment_ID ) );
    292292}
    … …  
    652652 * @return int The comment ID.
    653653 */
    654 function get_comment_ID() {
     654function get_comment_ID() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid
    655655        $comment = get_comment();
    656656
    … …  
    672672 * @since 0.71
    673673 */
    674 function comment_ID() {
     674function comment_ID() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid
    675675        echo get_comment_ID();
    676676}
  • trunk/src/wp-includes/compat.php

    r44953 r45580  
    435435         */
    436436        interface JsonSerializable {
     437                // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid
    437438                public function jsonSerialize();
    438439        }
  • trunk/src/wp-includes/formatting.php

    r45578 r45580  
    24282428 * @return string Balanced text
    24292429 */
    2430 function balanceTags( $text, $force = false ) {
     2430function balanceTags( $text, $force = false ) {  // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid
    24312431        if ( $force || get_option( 'use_balanceTags' ) == 1 ) {
    24322432                return force_balance_tags( $text );
  • trunk/src/wp-includes/functions.php

    r45555 r45580  
    56325632 * @return true True.
    56335633 */
    5634 function __return_true() {
     5634function __return_true() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionDoubleUnderscore
    56355635        return true;
    56365636}
    … …  
    56475647 * @return false False.
    56485648 */
    5649 function __return_false() {
     5649function __return_false() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionDoubleUnderscore
    56505650        return false;
    56515651}
    … …  
    56605660 * @return int 0.
    56615661 */
    5662 function __return_zero() {
     5662function __return_zero() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionDoubleUnderscore
    56635663        return 0;
    56645664}
    … …  
    56735673 * @return array Empty array.
    56745674 */
    5675 function __return_empty_array() {
     5675function __return_empty_array() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionDoubleUnderscore
    56765676        return array();
    56775677}
    … …  
    56865686 * @return null Null value.
    56875687 */
    5688 function __return_null() {
     5688function __return_null() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionDoubleUnderscore
    56895689        return null;
    56905690}
    … …  
    57015701 * @return string Empty string.
    57025702 */
    5703 function __return_empty_string() {
     5703function __return_empty_string() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionDoubleUnderscore
    57045704        return '';
    57055705}
  • trunk/src/wp-includes/general-template.php

    r45424 r45580  
    45494549 * @return string html attribute or empty string
    45504550 */
    4551 function __checked_selected_helper( $helper, $current, $echo, $type ) {
     4551function __checked_selected_helper( $helper, $current, $echo, $type ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionDoubleUnderscore
    45524552        if ( (string) $helper === (string) $current ) {
    45534553                $result = " $type='$type'";
  • trunk/src/wp-includes/load.php

    r45400 r45580  
    2727 * @access private
    2828 */
    29 function wp_unregister_GLOBALS() {
     29function wp_unregister_GLOBALS() {  // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid
    3030        if ( ! ini_get( 'register_globals' ) ) {
    3131                return;
  • trunk/src/wp-includes/ms-functions.php

    r45204 r45580  
    22532253 * @return string URL with https as the scheme
    22542254 */
    2255 function filter_SSL( $url ) {
     2255function filter_SSL( $url ) {  // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid
    22562256        if ( ! is_string( $url ) ) {
    22572257                return get_bloginfo( 'url' ); // Return home blog url with proper scheme
  • trunk/src/wp-includes/pomo/streams.php

    r44614 r45580  
    3535                 * @param string $endian Set the endianness of the file. Accepts 'big', or 'little'.
    3636                 */
    37                 function setEndian( $endian ) {
     37                function setEndian( $endian ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid
    3838                        $this->endian = $endian;
    3939                }
  • trunk/src/wp-includes/post-template.php

    r45491 r45580  
    1414 * @since 0.71
    1515 */
    16 function the_ID() {
     16function the_ID() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid
    1717        echo get_the_ID();
    1818}
    … …  
    2525 * @return int|false The ID of the current item in the WordPress Loop. False if $post is not set.
    2626 */
    27 function get_the_ID() {
     27function get_the_ID() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid
    2828        $post = get_post();
    2929        return ! empty( $post ) ? $post->ID : false;
  • trunk/src/xmlrpc.php

    r43571 r45580  
    9797 * @param string $msg Information describing logging reason.
    9898 */
    99 function logIO( $io, $msg ) {
     99function logIO( $io, $msg ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid
    100100        _deprecated_function( __FUNCTION__, '3.4.0', 'error_log()' );
    101101        if ( ! empty( $GLOBALS['xmlrpc_logging'] ) ) {
  • trunk/tests/phpunit/includes/class-basic-object.php

    r42381 r45580  
    3838        }
    3939
     40        // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid
    4041        private function callMe() {
    4142                return 'maybe';
  • trunk/tests/phpunit/includes/functions.php

    r45160 r45580  
    2222 * Resets various `$_SERVER` variables that can get altered during tests.
    2323 */
    24 function tests_reset__SERVER() {
     24function tests_reset__SERVER() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid
    2525        $_SERVER['HTTP_HOST']       = WP_TESTS_DOMAIN;
    2626        $_SERVER['REMOTE_ADDR']     = '127.0.0.1';
  • trunk/tests/phpunit/includes/object-cache.php

    r42343 r45580  
    762762}
    763763
     764// phpcs:disable WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid
    764765class WP_Object_Cache {
    765766
    … …  
    21612162        }
    21622163}
     2164// phpcs:enable
  • trunk/tests/phpunit/includes/phpunit6/compat.php

    r44701 r45580  
    1818        class PHPUnit_Util_Test {
    1919
     20                // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid
    2021                public static function getTickets( $className, $methodName ) {
    2122                        $annotations = PHPUnit\Util\Test::parseTestMethodAnnotations( $className, $methodName );
  • trunk/tests/phpunit/includes/trac.php

    r42343 r45580  
    1414         * @return bool|null true if the ticket is resolved, false if not resolved, null on error
    1515         */
    16         public static function isTracTicketClosed( $trac_url, $ticket_id ) {
     16        public static function isTracTicketClosed( $trac_url, $ticket_id ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid
    1717                if ( ! extension_loaded( 'openssl' ) ) {
    1818                        $trac_url = preg_replace( '/^https:/', 'http:', $trac_url );
    … …  
    4545        }
    4646
     47        // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid
    4748        public static function usingLocalCache() {
    4849                echo PHP_EOL . "\x1b[0m\x1b[30;43m\x1b[2K";
    … …  
    5152        }
    5253
     54        // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid
    5355        public static function forcingKnownBugs() {
    5456                echo PHP_EOL . "\x1b[0m\x1b[37;41m\x1b[2K";
  • trunk/tests/phpunit/includes/utils.php

    r43653 r45580  
    183183// convert valid xml to an array tree structure
    184184// kinda lame but it works with a default php 4 installation
    185 class testXMLParser {
     185class TestXMLParser {
    186186        var $xml;
    187187        var $data = array();
    … …  
    194194                xml_set_object( $this->xml, $this );
    195195                xml_parser_set_option( $this->xml, XML_OPTION_CASE_FOLDING, 0 );
    196                 xml_set_element_handler( $this->xml, array( $this, 'startHandler' ), array( $this, 'endHandler' ) );
    197                 xml_set_character_data_handler( $this->xml, array( $this, 'dataHandler' ) );
     196                xml_set_element_handler( $this->xml, array( $this, 'start_handler' ), array( $this, 'end_handler' ) );
     197                xml_set_character_data_handler( $this->xml, array( $this, 'data_handler' ) );
    198198                $this->parse( $in );
    199199        }
    … …  
    215215        }
    216216
    217         function startHandler( $parser, $name, $attributes ) {
     217        function start_handler( $parser, $name, $attributes ) {
    218218                $data['name'] = $name;
    219219                if ( $attributes ) {
    … …  
    222222        }
    223223
    224         function dataHandler( $parser, $data ) {
     224        function data_handler( $parser, $data ) {
    225225                $index                             = count( $this->data ) - 1;
    226226                @$this->data[ $index ]['content'] .= $data;
    227227        }
    228228
    229         function endHandler( $parser, $name ) {
     229        function end_handler( $parser, $name ) {
    230230                if ( count( $this->data ) > 1 ) {
    231231                        $data                            = array_pop( $this->data );
    … …  
    237237
    238238function xml_to_array( $in ) {
    239         $p = new testXMLParser( $in );
     239        $p = new TestXMLParser( $in );
    240240        return $p->data;
    241241}
Note: See TracChangeset for help on using the changeset viewer.