Make WordPress Core


Ignore:
Timestamp:
11/04/2021 01:15:33 PM (4 years ago)
Author:
hellofromTonya
Message:

Coding Standards: Add public visibility to methods in tests/phpunit/includes/.

This commit adds the public visibility keyword to each method which did not have an explicit visibility keyword.

Why public?

With no visibility previously declared, these methods are implicitly public and available for use. As these are part of the WordPress testing framework (for Core and extenders), changing them to anything else would be a backwards-compatibility break.

Props costdev, jrf, hellofromTonya.
See #54177.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/includes/utils.php

    r51552 r52009  
    6565     * PHP5 constructor.
    6666     */
    67     function __construct( $debug = 0 ) {
     67    public function __construct( $debug = 0 ) {
    6868        $this->reset();
    6969        $this->debug = $debug;
    7070    }
    7171
    72     function reset() {
     72    public function reset() {
    7373        $this->events = array();
    7474    }
    7575
    76     function current_filter() {
     76    public function current_filter() {
    7777        if ( is_callable( 'current_filter' ) ) {
    7878            return current_filter();
     
    8282    }
    8383
    84     function action( $arg ) {
     84    public function action( $arg ) {
    8585        if ( $this->debug ) {
    8686            dmp( __FUNCTION__, $this->current_filter() );
     
    9595    }
    9696
    97     function action2( $arg ) {
     97    public function action2( $arg ) {
    9898        if ( $this->debug ) {
    9999            dmp( __FUNCTION__, $this->current_filter() );
     
    109109    }
    110110
    111     function filter( $arg ) {
     111    public function filter( $arg ) {
    112112        if ( $this->debug ) {
    113113            dmp( __FUNCTION__, $this->current_filter() );
     
    123123    }
    124124
    125     function filter2( $arg ) {
     125    public function filter2( $arg ) {
    126126        if ( $this->debug ) {
    127127            dmp( __FUNCTION__, $this->current_filter() );
     
    137137    }
    138138
    139     function filter_append( $arg ) {
     139    public function filter_append( $arg ) {
    140140        if ( $this->debug ) {
    141141            dmp( __FUNCTION__, $this->current_filter() );
     
    151151    }
    152152
    153     function filterall( $tag, ...$args ) {
     153    public function filterall( $tag, ...$args ) {
    154154        // This one doesn't return the result, so it's safe to use with the new 'all' filter.
    155155        if ( $this->debug ) {
     
    165165
    166166    // Return a list of all the actions, tags and args.
    167     function get_events() {
     167    public function get_events() {
    168168        return $this->events;
    169169    }
    170170
    171171    // Return a count of the number of times the action was called since the last reset.
    172     function get_call_count( $tag = '' ) {
     172    public function get_call_count( $tag = '' ) {
    173173        if ( $tag ) {
    174174            $count = 0;
     
    184184
    185185    // Return an array of the tags that triggered calls to this action.
    186     function get_tags() {
     186    public function get_tags() {
    187187        $out = array();
    188188        foreach ( $this->events as $e ) {
     
    193193
    194194    // Return an array of args passed in calls to this action.
    195     function get_args() {
     195    public function get_args() {
    196196        $out = array();
    197197        foreach ( $this->events as $e ) {
     
    211211     * PHP5 constructor.
    212212     */
    213     function __construct( $in ) {
     213    public function __construct( $in ) {
    214214        $this->xml = xml_parser_create();
    215215        xml_set_object( $this->xml, $this );
     
    220220    }
    221221
    222     function parse( $in ) {
     222    public function parse( $in ) {
    223223        $parse = xml_parse( $this->xml, $in, true );
    224224        if ( ! $parse ) {
     
    236236    }
    237237
    238     function start_handler( $parser, $name, $attributes ) {
     238    public function start_handler( $parser, $name, $attributes ) {
    239239        $data['name'] = $name;
    240240        if ( $attributes ) {
     
    243243    }
    244244
    245     function data_handler( $parser, $data ) {
     245    public function data_handler( $parser, $data ) {
    246246        $index = count( $this->data ) - 1;
    247247
     
    252252    }
    253253
    254     function end_handler( $parser, $name ) {
     254    public function end_handler( $parser, $name ) {
    255255        if ( count( $this->data ) > 1 ) {
    256256            $data                            = array_pop( $this->data );
Note: See TracChangeset for help on using the changeset viewer.