Make WordPress Core

Changeset 44915


Ignore:
Timestamp:
03/15/2019 09:58:01 PM (8 years ago)
Author:
SergeyBiryukov
Message:

Build/Test Tools: Add missing access modifiers in phpunit/includes/wp-profiler.php.

Props andizer.
Fixes #46505.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/includes/wp-profiler.php

    r42343 r44915  
    1919
    2020class WPProfiler {
    21         var $stack;
    22         var $profile;
     21        public $stack;
     22        public $profile;
    2323
    2424        /**
    2525         * PHP5 constructor.
    2626         */
    27         function __construct() {
     27        public function __construct() {
    2828                $this->stack   = array();
    2929                $this->profile = array();
    3030        }
    3131
    32         function start( $name ) {
     32        public function start( $name ) {
    3333                $time = $this->microtime();
    3434
    … …  
    6161        }
    6262
    63         function stop() {
     63        public function stop() {
    6464                $item = array_pop( $this->stack );
    6565                $time = $this->microtime( $item['start'] );
    … …  
    107107        }
    108108
    109         function microtime( $since = 0.0 ) {
     109        public function microtime( $since = 0.0 ) {
    110110                list($usec, $sec) = explode( ' ', microtime() );
    111111                return (float) $sec + (float) $usec - $since;
    112112        }
    113113
    114         function log_filter( $tag ) {
     114        public function log_filter( $tag ) {
    115115                if ( $this->stack ) {
    116116                        global $wp_actions;
    … …  
    124124        }
    125125
    126         function log_action( $tag ) {
     126        public function log_action( $tag ) {
    127127                if ( $this->stack ) {
    128128                        @$this->stack[ count( $this->stack ) - 1 ]['actions'][ $tag ] ++;
    … …  
    130130        }
    131131
    132         function _current_action() {
     132        public function _current_action() {
    133133                global $wp_actions;
    134134                return $wp_actions[ count( $wp_actions ) - 1 ];
    135135        }
    136136
    137         function results() {
     137        public function results() {
    138138                return $this->profile;
    139139        }
    140140
    141         function _query_summary( $queries, &$out ) {
     141        public function _query_summary( $queries, &$out ) {
    142142                foreach ( $queries as $q ) {
    143143                        $sql = $q[0];
    … …  
    151151        }
    152152
    153         function _query_count( $queries ) {
     153        public function _query_count( $queries ) {
    154154                // this requires the savequeries patch at https://core.trac.wordpress.org/ticket/5218
    155155                $out = array();
    … …  
    164164        }
    165165
    166         function _dirty_objects_count( $dirty_objects ) {
     166        public function _dirty_objects_count( $dirty_objects ) {
    167167                $out = array();
    168168                foreach ( array_keys( $dirty_objects ) as $group ) {
    … …  
    172172        }
    173173
    174         function array_add( $a, $b ) {
     174        public function array_add( $a, $b ) {
    175175                $out = $a;
    176176                foreach ( array_keys( $b ) as $key ) {
    … …  
    184184        }
    185185
    186         function array_sub( $a, $b ) {
     186        public function array_sub( $a, $b ) {
    187187                $out = $a;
    188188                foreach ( array_keys( $b ) as $key ) {
    … …  
    194194        }
    195195
    196         function print_summary() {
     196        public function print_summary() {
    197197                $results = $this->results();
    198198
Note: See TracChangeset for help on using the changeset viewer.