mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
Coding Standards: Fix/ignore the WordPress.NamingConventions.ValidFunctionName violations.
See #47632 git-svn-id: https://develop.svn.wordpress.org/trunk@45580 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -37,6 +37,7 @@ class Basic_Object {
|
||||
return call_user_func_array( array( $this, $name ), $arguments );
|
||||
}
|
||||
|
||||
// phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid
|
||||
private function callMe() {
|
||||
return 'maybe';
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ function tests_get_phpunit_version() {
|
||||
/**
|
||||
* Resets various `$_SERVER` variables that can get altered during tests.
|
||||
*/
|
||||
function tests_reset__SERVER() {
|
||||
function tests_reset__SERVER() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid
|
||||
$_SERVER['HTTP_HOST'] = WP_TESTS_DOMAIN;
|
||||
$_SERVER['REMOTE_ADDR'] = '127.0.0.1';
|
||||
$_SERVER['REQUEST_METHOD'] = 'GET';
|
||||
|
||||
@@ -761,6 +761,7 @@ function wp_cache_add_non_persistent_groups( $groups ) {
|
||||
$wp_object_cache->add_non_persistent_groups( $groups );
|
||||
}
|
||||
|
||||
// phpcs:disable WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid
|
||||
class WP_Object_Cache {
|
||||
|
||||
/**
|
||||
@@ -2160,3 +2161,4 @@ class WP_Object_Cache {
|
||||
$this->blog_prefix = ( is_multisite() ? $blog_id : $table_prefix ) . ':';
|
||||
}
|
||||
}
|
||||
// phpcs:enable
|
||||
|
||||
@@ -17,6 +17,7 @@ if ( class_exists( 'PHPUnit\Runner\Version' ) && version_compare( PHPUnit\Runner
|
||||
|
||||
class PHPUnit_Util_Test {
|
||||
|
||||
// phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid
|
||||
public static function getTickets( $className, $methodName ) {
|
||||
$annotations = PHPUnit\Util\Test::parseTestMethodAnnotations( $className, $methodName );
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ class TracTickets {
|
||||
*
|
||||
* @return bool|null true if the ticket is resolved, false if not resolved, null on error
|
||||
*/
|
||||
public static function isTracTicketClosed( $trac_url, $ticket_id ) {
|
||||
public static function isTracTicketClosed( $trac_url, $ticket_id ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid
|
||||
if ( ! extension_loaded( 'openssl' ) ) {
|
||||
$trac_url = preg_replace( '/^https:/', 'http:', $trac_url );
|
||||
}
|
||||
@@ -44,12 +44,14 @@ class TracTickets {
|
||||
return ! in_array( $ticket_id, self::$trac_ticket_cache[ $trac_url ] );
|
||||
}
|
||||
|
||||
// phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid
|
||||
public static function usingLocalCache() {
|
||||
echo PHP_EOL . "\x1b[0m\x1b[30;43m\x1b[2K";
|
||||
echo 'INFO: Trac was inaccessible, so a local ticket status cache was used.' . PHP_EOL;
|
||||
echo "\x1b[0m\x1b[2K";
|
||||
}
|
||||
|
||||
// phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid
|
||||
public static function forcingKnownBugs() {
|
||||
echo PHP_EOL . "\x1b[0m\x1b[37;41m\x1b[2K";
|
||||
echo "ERROR: Trac was inaccessible, so known bugs weren't able to be skipped." . PHP_EOL;
|
||||
|
||||
@@ -182,7 +182,7 @@ class MockAction {
|
||||
|
||||
// convert valid xml to an array tree structure
|
||||
// kinda lame but it works with a default php 4 installation
|
||||
class testXMLParser {
|
||||
class TestXMLParser {
|
||||
var $xml;
|
||||
var $data = array();
|
||||
|
||||
@@ -193,8 +193,8 @@ class testXMLParser {
|
||||
$this->xml = xml_parser_create();
|
||||
xml_set_object( $this->xml, $this );
|
||||
xml_parser_set_option( $this->xml, XML_OPTION_CASE_FOLDING, 0 );
|
||||
xml_set_element_handler( $this->xml, array( $this, 'startHandler' ), array( $this, 'endHandler' ) );
|
||||
xml_set_character_data_handler( $this->xml, array( $this, 'dataHandler' ) );
|
||||
xml_set_element_handler( $this->xml, array( $this, 'start_handler' ), array( $this, 'end_handler' ) );
|
||||
xml_set_character_data_handler( $this->xml, array( $this, 'data_handler' ) );
|
||||
$this->parse( $in );
|
||||
}
|
||||
|
||||
@@ -214,19 +214,19 @@ class testXMLParser {
|
||||
return true;
|
||||
}
|
||||
|
||||
function startHandler( $parser, $name, $attributes ) {
|
||||
function start_handler( $parser, $name, $attributes ) {
|
||||
$data['name'] = $name;
|
||||
if ( $attributes ) {
|
||||
$data['attributes'] = $attributes; }
|
||||
$this->data[] = $data;
|
||||
}
|
||||
|
||||
function dataHandler( $parser, $data ) {
|
||||
function data_handler( $parser, $data ) {
|
||||
$index = count( $this->data ) - 1;
|
||||
@$this->data[ $index ]['content'] .= $data;
|
||||
}
|
||||
|
||||
function endHandler( $parser, $name ) {
|
||||
function end_handler( $parser, $name ) {
|
||||
if ( count( $this->data ) > 1 ) {
|
||||
$data = array_pop( $this->data );
|
||||
$index = count( $this->data ) - 1;
|
||||
@@ -236,7 +236,7 @@ class testXMLParser {
|
||||
}
|
||||
|
||||
function xml_to_array( $in ) {
|
||||
$p = new testXMLParser( $in );
|
||||
$p = new TestXMLParser( $in );
|
||||
return $p->data;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user