Completed
Branch FET-8365-add-indexes (4b9253)
by
unknown
531:58 queued 519:27
created
strategies/EE_Restriction_Generator_Taxonomy_Protected.strategy.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( !defined( 'EVENT_ESPRESSO_VERSION' ) ) {
3
-	exit( 'No direct script access allowed' );
2
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
3
+	exit('No direct script access allowed');
4 4
 }
5 5
 
6 6
 /**
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
  * @author				Mike Nelson
14 14
  *
15 15
  */
16
-class EE_Restriction_Generator_Taxonomy_Protected extends EE_Restriction_Generator_Base{
16
+class EE_Restriction_Generator_Taxonomy_Protected extends EE_Restriction_Generator_Base {
17 17
 
18 18
 	/**
19 19
 	 * Model chain/path to taxonomy model, including the term_taxonomy model itself
@@ -24,28 +24,28 @@  discard block
 block discarded – undo
24 24
 	 *
25 25
 	 * @param string $path_to_taxonomy_model Model chain/path to taxonomy model, including the term_taxonomy model itself
26 26
 	 */
27
-	public function __construct( $path_to_taxonomy_model ){
28
-		if( $path_to_taxonomy_model !== '' && substr( $path_to_taxonomy_model, -1, 1 ) != '.' ) {
27
+	public function __construct($path_to_taxonomy_model) {
28
+		if ($path_to_taxonomy_model !== '' && substr($path_to_taxonomy_model, -1, 1) != '.') {
29 29
 			$path_to_taxonomy_model .= '.';
30 30
 		}
31 31
 		$this->_path_to_taxonomy_model = $path_to_taxonomy_model;
32 32
 	}
33 33
 	protected function _generate_restrictions() {
34 34
 		//if there are no standard caps for this model, then for allow full access
35
-		if( ! $this->model()->cap_slug() ) {
35
+		if ( ! $this->model()->cap_slug()) {
36 36
 			return array(
37 37
 			);
38 38
 		}
39 39
 
40 40
 		return array(
41
-			'ee_manage_event_categories' => new EE_Default_Where_Conditions( array(
42
-				$this->_path_to_taxonomy_model . 'taxonomy*no_ee_manage_event_categories' => array( '!=', 'espresso_event_categories' )
41
+			'ee_manage_event_categories' => new EE_Default_Where_Conditions(array(
42
+				$this->_path_to_taxonomy_model.'taxonomy*no_ee_manage_event_categories' => array('!=', 'espresso_event_categories')
43 43
 			)),
44
-			'ee_manage_venue_categories' => new EE_Default_Where_Conditions( array(
45
-				$this->_path_to_taxonomy_model . 'taxonomy*no_ee_manage_venue_categories' => array( '!=', 'espresso_venue_categories' )
44
+			'ee_manage_venue_categories' => new EE_Default_Where_Conditions(array(
45
+				$this->_path_to_taxonomy_model.'taxonomy*no_ee_manage_venue_categories' => array('!=', 'espresso_venue_categories')
46 46
 			)),
47
-			'ee_manage_event_types' => new EE_Default_Where_Conditions( array(
48
-				$this->_path_to_taxonomy_model . 'taxonomy*ee_manage_event_types' => array( '!=', 'espresso_event_types' )
47
+			'ee_manage_event_types' => new EE_Default_Where_Conditions(array(
48
+				$this->_path_to_taxonomy_model.'taxonomy*ee_manage_event_types' => array('!=', 'espresso_event_types')
49 49
 			)),
50 50
 		);
51 51
 	}
Please login to merge, or discard this patch.
core/db_models/strategies/EE_Restriction_Generator_WP_User.strategy.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( !defined( 'EVENT_ESPRESSO_VERSION' ) ) {
3
-	exit( 'No direct script access allowed' );
2
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
3
+	exit('No direct script access allowed');
4 4
 }
5 5
 
6 6
 /**
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
  * @author				Mike Nelson
16 16
  *
17 17
  */
18
-class EE_Restriction_Generator_WP_User extends EE_Restriction_Generator_Base{
18
+class EE_Restriction_Generator_WP_User extends EE_Restriction_Generator_Base {
19 19
 
20 20
 	/**
21 21
 	 * @return \EE_Default_Where_Conditions
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 
25 25
 		return array(
26 26
 			//if they can't access users, they can still access themselves
27
-			EE_Restriction_Generator_Base::get_cap_name( $this->model(), $this->action() ) => new EE_Default_Where_Conditions( array(
27
+			EE_Restriction_Generator_Base::get_cap_name($this->model(), $this->action()) => new EE_Default_Where_Conditions(array(
28 28
 				EE_Default_Where_Conditions::user_field_name_placeholder => EE_Default_Where_Conditions::current_user_placeholder
29 29
 			)),
30 30
 
Please login to merge, or discard this patch.
core/db_models/strategies/EE_Return_None_Where_Conditions.strategy.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( !defined( 'EVENT_ESPRESSO_VERSION' ) ) {
3
-	exit( 'No direct script access allowed' );
2
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
3
+	exit('No direct script access allowed');
4 4
 }
5 5
 
6 6
 /**
@@ -14,12 +14,12 @@  discard block
 block discarded – undo
14 14
  *
15 15
  */
16 16
 class EE_Return_None_Where_Conditions extends EE_Default_Where_Conditions {
17
-	protected function _get_default_where_conditions(){
18
-		if( $this->_model->has_primary_key_field() ) {
19
-			return array( $this->_model->primary_key_name() => array('<', 0 ) );
20
-		}else{
21
-			$fk_field = $this->_model->get_a_field_of_type( 'EE_Foreign_Key_Field_Base' );
22
-			return array( 'AND*impossible' => array( $fk_field->get_name() => array('IS_NULL'), $fk_field->get_name() => 'IS_NOT_NULL' ) );
17
+	protected function _get_default_where_conditions() {
18
+		if ($this->_model->has_primary_key_field()) {
19
+			return array($this->_model->primary_key_name() => array('<', 0));
20
+		} else {
21
+			$fk_field = $this->_model->get_a_field_of_type('EE_Foreign_Key_Field_Base');
22
+			return array('AND*impossible' => array($fk_field->get_name() => array('IS_NULL'), $fk_field->get_name() => 'IS_NOT_NULL'));
23 23
 		}
24 24
 	}
25 25
 }
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@
 block discarded – undo
90 90
 		//so in case teh IPN is arriving later, let's try to process an IPN!
91 91
 		if($_SERVER['REQUEST_METHOD'] == 'POST'){
92 92
 			return $this->handle_ipn($_POST, $transaction );
93
-		}else{
93
+		} else{
94 94
 			return parent::finalize_payment_for( $transaction );
95 95
 		}
96 96
 	}
Please login to merge, or discard this patch.
core/db_models/strategies/EE_Soft_Delete_Where_Conditions.strategy.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  discard block
 block discarded – undo
3 3
 /*
4 4
  * Strategy specifically for adding where conditions specific to CPT models.
5 5
  */
6
-class EE_Soft_Delete_Where_Conditions extends EE_Default_Where_Conditions{
6
+class EE_Soft_Delete_Where_Conditions extends EE_Default_Where_Conditions {
7 7
 	/**
8 8
 	 * Strategy for setting default soft delete where conditions. This strategy will find
9 9
 	 * the field of type 'EE_Trashed_Flag_Field', and add a condition that it be FALSE on all queries involving
@@ -12,12 +12,12 @@  discard block
 block discarded – undo
12 12
 	 * Eg,
13 13
 	 *
14 14
 	 */
15
-	function __construct(){}
15
+	function __construct() {}
16 16
 	/**
17 17
 	 * Gets the where default where conditions for a custom post type model
18 18
 	 * @return array like EEM_Base::get_all's $query_params's index [0] (where conditions)
19 19
 	 */
20
-	protected function _get_default_where_conditions(){
20
+	protected function _get_default_where_conditions() {
21 21
 		$trashed_field_name = $this->deleted_field_name();
22 22
 		return array(
23 23
 			$trashed_field_name => false
@@ -29,12 +29,12 @@  discard block
 block discarded – undo
29 29
 	 * @return string
30 30
 	 * @throws EE_Error
31 31
 	 */
32
-	private function deleted_field_name(){
32
+	private function deleted_field_name() {
33 33
 		$field = $this->_model->get_a_field_of_type('EE_Trashed_Flag_Field');
34
-		if($field){
34
+		if ($field) {
35 35
 			return $field->get_name();
36
-		}else{
37
-			throw new EE_Error(sprintf(__('We are trying to find the deleted flag field on %s, but none was found. Are you sure there is a field of type EE_Trashed_Flag_Field in %s constructor?','event_espresso'),get_class($this),get_class($this)));
36
+		} else {
37
+			throw new EE_Error(sprintf(__('We are trying to find the deleted flag field on %s, but none was found. Are you sure there is a field of type EE_Trashed_Flag_Field in %s constructor?', 'event_espresso'), get_class($this), get_class($this)));
38 38
 		}
39 39
 	}
40 40
 }
41 41
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@
 block discarded – undo
90 90
 		//so in case teh IPN is arriving later, let's try to process an IPN!
91 91
 		if($_SERVER['REQUEST_METHOD'] == 'POST'){
92 92
 			return $this->handle_ipn($_POST, $transaction );
93
-		}else{
93
+		} else{
94 94
 			return parent::finalize_payment_for( $transaction );
95 95
 		}
96 96
 	}
Please login to merge, or discard this patch.
core/helpers/EEH_Array.helper.php 2 patches
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -61,10 +61,10 @@
 block discarded – undo
61 61
 			$first_item = reset($arr);
62 62
 			if(is_array($first_item)){
63 63
 				return true;//yep, there's at least 2 levels to this array
64
-			}else{
64
+			} else{
65 65
 				return false;//nope, only 1 level
66 66
 			}
67
-		}else{
67
+		} else{
68 68
 			return false;//its not an array at all!
69 69
 		}
70 70
 	}
Please login to merge, or discard this patch.
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 if ( ! defined('EVENT_ESPRESSO_VERSION')) { exit('NO direct script access allowed'); }
3 3
 
4
-require_once( EE_HELPERS . 'EEH_Base.helper.php' );
4
+require_once(EE_HELPERS.'EEH_Base.helper.php');
5 5
 
6 6
 /**
7 7
  * EE_Array
@@ -26,8 +26,8 @@  discard block
 block discarded – undo
26 26
 	 * @param  array $array2 an array of objects
27 27
 	 * @return array         an array of objects found in array 1 that aren't found in array 2.
28 28
 	 */
29
-	public static function object_array_diff( $array1, $array2 ) {
30
-		return array_udiff( $array1, $array2, array('self', '_compare_objects' ));
29
+	public static function object_array_diff($array1, $array2) {
30
+		return array_udiff($array1, $array2, array('self', '_compare_objects'));
31 31
 	}
32 32
 
33 33
 	/**
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 	 * @param array $arr
36 36
 	 * @return boolean
37 37
 	 */
38
-	public static function is_associative_array($arr){
38
+	public static function is_associative_array($arr) {
39 39
 		return  array_keys($arr) !== range(0, count($arr) - 1);
40 40
 	}
41 41
 
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 	 * @param array $arr
46 46
 	 * @return mixed what ever is in the array
47 47
 	 */
48
-	public static function get_one_item_from_array($arr){
48
+	public static function get_one_item_from_array($arr) {
49 49
 		$item = end($arr);
50 50
 		reset($arr);
51 51
 		return $item;
@@ -56,16 +56,16 @@  discard block
 block discarded – undo
56 56
 	 * @param mixed $arr
57 57
 	 * @return boolean
58 58
 	 */
59
-	public static function is_multi_dimensional_array($arr){
60
-		if(is_array($arr)){
59
+	public static function is_multi_dimensional_array($arr) {
60
+		if (is_array($arr)) {
61 61
 			$first_item = reset($arr);
62
-			if(is_array($first_item)){
63
-				return true;//yep, there's at least 2 levels to this array
64
-			}else{
65
-				return false;//nope, only 1 level
62
+			if (is_array($first_item)) {
63
+				return true; //yep, there's at least 2 levels to this array
64
+			} else {
65
+				return false; //nope, only 1 level
66 66
 			}
67
-		}else{
68
-			return false;//its not an array at all!
67
+		} else {
68
+			return false; //its not an array at all!
69 69
 		}
70 70
 	}
71 71
 
@@ -76,8 +76,8 @@  discard block
 block discarded – undo
76 76
 	 * @param mixed $default
77 77
 	 * @return mixed
78 78
 	 */
79
-	public static function is_set( $arr, $index, $default ) {
80
-		return isset( $arr[ $index ] ) ? $arr[ $index ] : $default;
79
+	public static function is_set($arr, $index, $default) {
80
+		return isset($arr[$index]) ? $arr[$index] : $default;
81 81
 	}
82 82
 
83 83
 } //end EEH_Template class
84 84
\ No newline at end of file
Please login to merge, or discard this patch.
core/helpers/EEH_Autoloader.helper.php 3 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -23,10 +23,10 @@
 block discarded – undo
23 23
 	private static $_instance = NULL;
24 24
 
25 25
 	/**
26
-	* 	$_autoloaders
27
-	* 	@var array $_autoloaders
28
-	* 	@access 	private
29
-	*/
26
+	 * 	$_autoloaders
27
+	 * 	@var array $_autoloaders
28
+	 * 	@access 	private
29
+	 */
30 30
 	private static $_autoloaders;
31 31
 
32 32
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,8 +6,9 @@
 block discarded – undo
6 6
  * @package Event Espresso
7 7
  * @subpackage messages
8 8
  */
9
-if (!defined('EVENT_ESPRESSO_VERSION') )
9
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
10 10
 	exit('NO direct script access allowed');
11
+}
11 12
 
12 13
 /**
13 14
  *
Please login to merge, or discard this patch.
Spacing   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
3 3
 	exit('NO direct script access allowed');
4 4
 
5 5
 /**
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 	 */
39 39
 	public static function instance() {
40 40
 		// check if class object is instantiated, and instantiated properly
41
-		if ( ! self::$_instance instanceof  EEH_Autoloader ) {
41
+		if ( ! self::$_instance instanceof  EEH_Autoloader) {
42 42
 			self::$_instance = new self();
43 43
 		}
44 44
 		return self::$_instance;
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 	private function __construct() {
56 56
 		self::$_autoloaders = array();
57 57
 		$this->_register_custom_autoloaders();
58
-		spl_autoload_register( array( $this, 'espresso_autoloader' ));
58
+		spl_autoload_register(array($this, 'espresso_autoloader'));
59 59
 	}
60 60
 
61 61
 
@@ -69,9 +69,9 @@  discard block
 block discarded – undo
69 69
 	 * @internal  param string $class_name - simple class name ie: session
70 70
 	 * @return 	void
71 71
 	 */
72
-	public static function espresso_autoloader( $class_name ) {
73
-		if ( isset( self::$_autoloaders[ $class_name ] ) ) {
74
-			require_once( self::$_autoloaders[ $class_name ] );
72
+	public static function espresso_autoloader($class_name) {
73
+		if (isset(self::$_autoloaders[$class_name])) {
74
+			require_once(self::$_autoloaders[$class_name]);
75 75
 		}
76 76
 	}
77 77
 
@@ -86,23 +86,23 @@  discard block
 block discarded – undo
86 86
 	 * @throws \EE_Error
87 87
 	 * @return        void
88 88
 	 */
89
-	public static function register_autoloader( $class_paths, $read_check = true ) {
90
-		$class_paths = is_array( $class_paths ) ? $class_paths : array( $class_paths );
91
-		foreach ( $class_paths as $class => $path ) {
89
+	public static function register_autoloader($class_paths, $read_check = true) {
90
+		$class_paths = is_array($class_paths) ? $class_paths : array($class_paths);
91
+		foreach ($class_paths as $class => $path) {
92 92
 			// don't give up! you gotta...
93 93
 			// get some class
94
-			if ( empty( $class )) {
95
-				throw new EE_Error ( sprintf( __( 'No Class name was specified while registering an autoloader for the following path: %s.','event_espresso' ), $path ));
94
+			if (empty($class)) {
95
+				throw new EE_Error(sprintf(__('No Class name was specified while registering an autoloader for the following path: %s.', 'event_espresso'), $path));
96 96
 			}
97 97
 			// one day you will find the path young grasshopper
98
-			if ( empty( $path )) {
99
-				throw new EE_Error ( sprintf( __( 'No path was specified while registering an autoloader for the %s class.','event_espresso' ), $class ));
98
+			if (empty($path)) {
99
+				throw new EE_Error(sprintf(__('No path was specified while registering an autoloader for the %s class.', 'event_espresso'), $class));
100 100
 			}
101 101
 			// is file readable ?
102
-			if ( $read_check && ! is_readable( $path )) {
103
-				throw new EE_Error ( sprintf( __( 'The file for the %s class could not be found or is not readable due to file permissions. Please ensure the following path is correct: %s','event_espresso' ), $class, $path ));
102
+			if ($read_check && ! is_readable($path)) {
103
+				throw new EE_Error(sprintf(__('The file for the %s class could not be found or is not readable due to file permissions. Please ensure the following path is correct: %s', 'event_espresso'), $class, $path));
104 104
 			}
105
-			self::$_autoloaders[ $class ] = str_replace( array( '\/', '/' ), DS, $path );
105
+			self::$_autoloaders[$class] = str_replace(array('\/', '/'), DS, $path);
106 106
 		}
107 107
 	}
108 108
 
@@ -129,9 +129,9 @@  discard block
 block discarded – undo
129 129
 	 * 	@return void
130 130
 	 */
131 131
 	private function _register_custom_autoloaders() {
132
-		EEH_Autoloader::register_autoloaders_for_each_file_in_folder( EE_CORE );
133
-		EEH_Autoloader::register_autoloaders_for_each_file_in_folder( EE_MODELS, TRUE );
134
-		EEH_Autoloader::register_autoloaders_for_each_file_in_folder( EE_CLASSES );
132
+		EEH_Autoloader::register_autoloaders_for_each_file_in_folder(EE_CORE);
133
+		EEH_Autoloader::register_autoloaders_for_each_file_in_folder(EE_MODELS, TRUE);
134
+		EEH_Autoloader::register_autoloaders_for_each_file_in_folder(EE_CLASSES);
135 135
 		EEH_Autoloader::register_form_sections_autoloaders();
136 136
 	}
137 137
 
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
 	 * 	@return void
146 146
 	 */
147 147
 	public static function register_form_sections_autoloaders() {
148
-		EEH_Autoloader::register_autoloaders_for_each_file_in_folder( EE_FORM_SECTIONS, TRUE );
148
+		EEH_Autoloader::register_autoloaders_for_each_file_in_folder(EE_FORM_SECTIONS, TRUE);
149 149
 	}
150 150
 
151 151
 
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
 	 * 	@return void
159 159
 	 */
160 160
 	public static function register_line_item_display_autoloaders() {
161
-		EEH_Autoloader::register_autoloaders_for_each_file_in_folder(  EE_LIBRARIES . 'line_item_display' , TRUE );
161
+		EEH_Autoloader::register_autoloaders_for_each_file_in_folder(EE_LIBRARIES.'line_item_display', TRUE);
162 162
 	}
163 163
 
164 164
 
@@ -173,31 +173,31 @@  discard block
 block discarded – undo
173 173
 	 * @param bool   $recursive
174 174
 	 * @return array
175 175
 	 */
176
-	public static function register_autoloaders_for_each_file_in_folder( $folder, $recursive = FALSE ){
176
+	public static function register_autoloaders_for_each_file_in_folder($folder, $recursive = FALSE) {
177 177
 		// make sure last char is a /
178
-		$folder .= $folder[strlen($folder)-1] != DS ? DS : '';
178
+		$folder .= $folder[strlen($folder) - 1] != DS ? DS : '';
179 179
 		$class_to_filepath_map = array();
180
-		$exclude = array( 'index' );
180
+		$exclude = array('index');
181 181
 		//get all the files in that folder that end in php
182
-		$filepaths = glob( $folder.'*');
182
+		$filepaths = glob($folder.'*');
183 183
 
184
-		if ( empty( $filepaths ) ) {
184
+		if (empty($filepaths)) {
185 185
 			return;
186 186
 		}
187 187
 
188
-		foreach( $filepaths as $filepath ) {
189
-			if ( substr( $filepath, -4, 4 ) == '.php' ) {
190
-				$class_name = EEH_File::get_classname_from_filepath_with_standard_filename( $filepath );
191
-				if ( ! in_array( $class_name, $exclude )) {
192
-					$class_to_filepath_map [ $class_name ] = str_replace( array( '\/', '/' ), DS, $filepath );
188
+		foreach ($filepaths as $filepath) {
189
+			if (substr($filepath, -4, 4) == '.php') {
190
+				$class_name = EEH_File::get_classname_from_filepath_with_standard_filename($filepath);
191
+				if ( ! in_array($class_name, $exclude)) {
192
+					$class_to_filepath_map [$class_name] = str_replace(array('\/', '/'), DS, $filepath);
193 193
 				}
194
-			} else if ( $recursive ) {
195
-				EEH_Autoloader::register_autoloaders_for_each_file_in_folder( $filepath, $recursive );
194
+			} else if ($recursive) {
195
+				EEH_Autoloader::register_autoloaders_for_each_file_in_folder($filepath, $recursive);
196 196
 			}
197 197
 		}
198 198
 
199 199
 		//we remove the necessity to do a is_readable() check via the $read_check flag because glob by nature will not return non_readable files/directories.
200
-		self::register_autoloader($class_to_filepath_map, FALSE );
200
+		self::register_autoloader($class_to_filepath_map, FALSE);
201 201
 	}
202 202
 
203 203
 
Please login to merge, or discard this patch.
core/helpers/EEH_Base.helper.php 3 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@
 block discarded – undo
33 33
 	 *		@ override magic methods
34 34
 	 *		@ return void
35 35
 	 */	
36
-	public function __set($a,$b) { return FALSE; }
36
+	public function __set($a, $b) { return FALSE; }
37 37
 	public function __get($a) { return FALSE; }
38 38
 	public function __isset($a) { return FALSE; }
39 39
 	public function __unset($a) { return FALSE; }
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@
 block discarded – undo
1
-<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {
2
+	exit('No direct script access allowed');
3
+}
2 4
 /**
3 5
  * Event Espresso
4 6
  *
Please login to merge, or discard this patch.
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -1,26 +1,26 @@
 block discarded – undo
1 1
 <?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
2 2
 /**
3
- * Event Espresso
4
- *
5
- * Event Registration and Management Plugin for WordPress
6
- *
7
- * @ package			Event Espresso
8
- * @ author			Seth Shoultes
9
- * @ copyright		(c) 2008-2011 Event Espresso  All Rights Reserved.
10
- * @ license			http://eventespresso.com/support/terms-conditions/   * see Plugin Licensing *
11
- * @ link					http://www.eventespresso.com
12
- * @ version		 	4.0
13
- *
14
- * ------------------------------------------------------------------------
15
- *
16
- * EEH_Base Helper
17
- *
18
- * @package			Event Espresso
19
- * @subpackage	/helpers/
20
- * @author				Brent Christensen 
21
- *
22
- * ------------------------------------------------------------------------
23
- */
3
+	 * Event Espresso
4
+	 *
5
+	 * Event Registration and Management Plugin for WordPress
6
+	 *
7
+	 * @ package			Event Espresso
8
+	 * @ author			Seth Shoultes
9
+	 * @ copyright		(c) 2008-2011 Event Espresso  All Rights Reserved.
10
+	 * @ license			http://eventespresso.com/support/terms-conditions/   * see Plugin Licensing *
11
+	 * @ link					http://www.eventespresso.com
12
+	 * @ version		 	4.0
13
+	 *
14
+	 * ------------------------------------------------------------------------
15
+	 *
16
+	 * EEH_Base Helper
17
+	 *
18
+	 * @package			Event Espresso
19
+	 * @subpackage	/helpers/
20
+	 * @author				Brent Christensen 
21
+	 *
22
+	 * ------------------------------------------------------------------------
23
+	 */
24 24
 class EEH_Base {
25 25
 
26 26
 	/**
Please login to merge, or discard this patch.
core/helpers/EEH_Class_Tools.helper.php 3 patches
Spacing   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -35,35 +35,35 @@  discard block
 block discarded – undo
35 35
 	 */
36 36
 	public static function get_called_class() {
37 37
 		$backtrace = debug_backtrace();
38
-		if ( isset( $backtrace[2] ) && is_array( $backtrace[2] ) && isset( $backtrace[2]['class'] ) && ! isset( $backtrace[2]['file'] )) {
38
+		if (isset($backtrace[2]) && is_array($backtrace[2]) && isset($backtrace[2]['class']) && ! isset($backtrace[2]['file'])) {
39 39
 			return $backtrace[2]['class'];
40
-		} else if ( isset( $backtrace[3] ) && is_array( $backtrace[3] ) && isset( $backtrace[3]['class'] ) && ! isset( $backtrace[3]['file'] )) {
40
+		} else if (isset($backtrace[3]) && is_array($backtrace[3]) && isset($backtrace[3]['class']) && ! isset($backtrace[3]['file'])) {
41 41
 			return $backtrace[3]['class'];
42
-		} else if ( isset( $backtrace[2] ) && is_array( $backtrace[2] ) && isset( $backtrace[2]['file'] ) && isset( $backtrace[2]['line'] )) {
43
-			if ( self::$file_line == $backtrace[2]['file'] . $backtrace[2]['line'] ) {
42
+		} else if (isset($backtrace[2]) && is_array($backtrace[2]) && isset($backtrace[2]['file']) && isset($backtrace[2]['line'])) {
43
+			if (self::$file_line == $backtrace[2]['file'].$backtrace[2]['line']) {
44 44
 				self::$i++;
45 45
 			} else {
46 46
 				self::$i = 0;
47
-				self::$file_line = $backtrace[2]['file'] . $backtrace[2]['line'];
47
+				self::$file_line = $backtrace[2]['file'].$backtrace[2]['line'];
48 48
 			}
49 49
 			// was  class method called via call_user_func ?
50
-			if ( $backtrace[2]['function'] == 'call_user_func' && isset( $backtrace[2]['args'] ) && is_array( $backtrace[2]['args'] )){
51
-				if ( isset( $backtrace[2]['args'][0] ) && isset( $backtrace[2]['args'][0][0] )) {
50
+			if ($backtrace[2]['function'] == 'call_user_func' && isset($backtrace[2]['args']) && is_array($backtrace[2]['args'])) {
51
+				if (isset($backtrace[2]['args'][0]) && isset($backtrace[2]['args'][0][0])) {
52 52
 					$called_class = $backtrace[2]['args'][0][0];
53 53
 					// is it an EE function ?
54
-					if ( strpos( $called_class, 'EE' ) === 0 ) {
55
-						$prefix_chars = strpos( $called_class, '_' ) + 1;
56
-						$prefix = substr( $called_class, 0, $prefix_chars );
57
-						$classname = substr( $called_class, $prefix_chars, strlen( $called_class ));
58
-						$classname = $prefix . str_replace( ' ', '_', ucwords( strtolower( str_replace( '_', ' ', $classname  ))));
54
+					if (strpos($called_class, 'EE') === 0) {
55
+						$prefix_chars = strpos($called_class, '_') + 1;
56
+						$prefix = substr($called_class, 0, $prefix_chars);
57
+						$classname = substr($called_class, $prefix_chars, strlen($called_class));
58
+						$classname = $prefix.str_replace(' ', '_', ucwords(strtolower(str_replace('_', ' ', $classname))));
59 59
 						return $classname;
60 60
 					}
61 61
 				}
62 62
 			} else {
63
-				$lines = file( $backtrace[2]['file'] );
64
-				preg_match_all( '/([a-zA-Z0-9\_]+)::' . $backtrace[2]['function'] . '/', $lines[$backtrace[2]['line']-1], $matches );
65
-				if ( isset( $matches[1] ) && isset( $matches[1][ self::$i ] )) {
66
-					return $matches[1][ self::$i ];
63
+				$lines = file($backtrace[2]['file']);
64
+				preg_match_all('/([a-zA-Z0-9\_]+)::'.$backtrace[2]['function'].'/', $lines[$backtrace[2]['line'] - 1], $matches);
65
+				if (isset($matches[1]) && isset($matches[1][self::$i])) {
66
+					return $matches[1][self::$i];
67 67
 				}
68 68
 			}
69 69
 		}
@@ -80,22 +80,22 @@  discard block
 block discarded – undo
80 80
 	 * 	@param 	string 	$hook
81 81
 	 * 	@return 	array
82 82
 	 */
83
-	public static function get_class_names_for_all_callbacks_on_hook( $hook = NULL ) {
83
+	public static function get_class_names_for_all_callbacks_on_hook($hook = NULL) {
84 84
 		global $wp_filter;
85 85
 		$class_names = array();
86 86
 		// are any callbacks registered for this hook ?
87
-		if ( isset( $wp_filter[ $hook ] )) {
87
+		if (isset($wp_filter[$hook])) {
88 88
 			// loop thru all of the callbacks attached to the deprecated hookpoint
89
-			foreach( $wp_filter[ $hook ] as $priority ) {
90
-				foreach( $priority as $callback ) {
89
+			foreach ($wp_filter[$hook] as $priority) {
90
+				foreach ($priority as $callback) {
91 91
 					// is the callback a non-static class method ?
92
-					if ( isset( $callback['function'] ) && is_array( $callback['function'] )) {
93
-						if ( isset( $callback['function'][0] ) && is_object( $callback['function'][0] )) {
94
-							$class_names[] = get_class( $callback['function'][0] );
92
+					if (isset($callback['function']) && is_array($callback['function'])) {
93
+						if (isset($callback['function'][0]) && is_object($callback['function'][0])) {
94
+							$class_names[] = get_class($callback['function'][0]);
95 95
 						}
96 96
 					// test for static method
97
-					} else if ( strpos( $callback['function'], '::' ) !== FALSE ) {
98
-						$class = explode( '::', $callback['function'] );
97
+					} else if (strpos($callback['function'], '::') !== FALSE) {
98
+						$class = explode('::', $callback['function']);
99 99
 						$class_names[] = $class[0];
100 100
 					} else {
101 101
 						// just a function
@@ -116,24 +116,24 @@  discard block
 block discarded – undo
116 116
 	 * 	@param		string 	$property
117 117
 	 * 	@return 		boolean
118 118
 	 */
119
-	public static function has_property( $class = NULL, $property = NULL ) {
119
+	public static function has_property($class = NULL, $property = NULL) {
120 120
 		// if $class or $property don't exist, then get out, cuz that would be like... fatal dude
121
-		if ( empty( $class ) || empty( $property )) {
121
+		if (empty($class) || empty($property)) {
122 122
 			return FALSE;
123 123
 		}
124 124
 		// if your hosting company doesn't cut the mustard
125
-		if ( version_compare( PHP_VERSION, '5.3.0' ) < 0 ) {
125
+		if (version_compare(PHP_VERSION, '5.3.0') < 0) {
126 126
 			// just in case $class is an actual instantiated object
127
-			if ( is_object( $class )) {
128
-				return isset( $class->$property ) ? TRUE : FALSE;
127
+			if (is_object($class)) {
128
+				return isset($class->$property) ? TRUE : FALSE;
129 129
 			} else {
130 130
 				// use reflection for < PHP 5.3 to get details using just the class name
131
-				$reflector = new ReflectionClass( $class );
132
-				return $reflector->hasProperty( $property );
131
+				$reflector = new ReflectionClass($class);
132
+				return $reflector->hasProperty($property);
133 133
 			}
134 134
 		} else {
135 135
 			// or try regular property exists method which works as expected in PHP 5.3+
136
-			return property_exists( $class, $property );
136
+			return property_exists($class, $property);
137 137
 		}
138 138
 	}
139 139
 
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
 
144 144
 
145 145
 // if PHP version < 5.3
146
-if ( ! function_exists( 'get_called_class' )) {
146
+if ( ! function_exists('get_called_class')) {
147 147
 	/**
148 148
 	 * @return bool|string
149 149
 	 */
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@
 block discarded – undo
1
-<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {
2
+	exit('No direct script access allowed');
3
+}
2 4
 /**
3 5
  * Event Espresso
4 6
  *
Please login to merge, or discard this patch.
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -1,26 +1,26 @@
 block discarded – undo
1 1
 <?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
2 2
 /**
3
- * Event Espresso
4
- *
5
- * Event Registration and Management Plugin for WordPress
6
- *
7
- * @ package			Event Espresso
8
- * @ author				Event Espresso
9
- * @ copyright		(c) 2008-2011 Event Espresso  All Rights Reserved.
10
- * @ license			http://eventespresso.com/support/terms-conditions/   * see Plugin Licensing *
11
- * @ link					http://www.eventespresso.com
12
- * @ version		 	4.0
13
- *
14
- * ------------------------------------------------------------------------
15
- *
16
- * EEH_Class_Tools Helper
17
- *
18
- * @package			Event Espresso
19
- * @subpackage		/helpers/
20
- * @author				Brent Christensen
21
- *
22
- * ------------------------------------------------------------------------
23
- */
3
+	 * Event Espresso
4
+	 *
5
+	 * Event Registration and Management Plugin for WordPress
6
+	 *
7
+	 * @ package			Event Espresso
8
+	 * @ author				Event Espresso
9
+	 * @ copyright		(c) 2008-2011 Event Espresso  All Rights Reserved.
10
+	 * @ license			http://eventespresso.com/support/terms-conditions/   * see Plugin Licensing *
11
+	 * @ link					http://www.eventespresso.com
12
+	 * @ version		 	4.0
13
+	 *
14
+	 * ------------------------------------------------------------------------
15
+	 *
16
+	 * EEH_Class_Tools Helper
17
+	 *
18
+	 * @package			Event Espresso
19
+	 * @subpackage		/helpers/
20
+	 * @author				Brent Christensen
21
+	 *
22
+	 * ------------------------------------------------------------------------
23
+	 */
24 24
 class EEH_Class_Tools {
25 25
 
26 26
 	static $i = 0;
Please login to merge, or discard this patch.
core/helpers/EEH_Debug_Tools.helper.php 2 patches
Braces   +5 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@  discard block
 block discarded – undo
1
-<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {
2
+	exit('No direct script access allowed');
3
+}
2 4
 /**
3 5
  * Class EEH_Debug_Tools
4 6
  *
@@ -122,8 +124,7 @@  discard block
 block discarded – undo
122 124
 				return;
123 125
 			}
124 126
 			echo '<h5>For Tag: '. $tag .'</h5>';
125
-		}
126
-		else {
127
+		} else {
127 128
 			$hook=$wp_filter;
128 129
 			ksort( $hook );
129 130
 		}
@@ -183,7 +184,7 @@  discard block
 block discarded – undo
183 184
 		if( isset( $this->_start_times[ $timer_name ] ) ){
184 185
 			$start_time = $this->_start_times[ $timer_name ];
185 186
 			unset( $this->_start_times[ $timer_name ] );
186
-		}else{
187
+		} else{
187 188
 			$start_time = array_pop( $this->_start_times );
188 189
 		}
189 190
 		$total_time = microtime( TRUE ) - $start_time;
Please login to merge, or discard this patch.
Spacing   +114 added lines, -114 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
  * @since 				4.0
9 9
  *
10 10
  */
11
-class EEH_Debug_Tools{
11
+class EEH_Debug_Tools {
12 12
 
13 13
 	/**
14 14
 	 * 	instance of the EEH_Autoloader object
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 	 */
42 42
 	public static function instance() {
43 43
 		// check if class object is instantiated, and instantiated properly
44
-		if ( ! self::$_instance instanceof EEH_Debug_Tools ) {
44
+		if ( ! self::$_instance instanceof EEH_Debug_Tools) {
45 45
 			self::$_instance = new self();
46 46
 		}
47 47
 		return self::$_instance;
@@ -57,19 +57,19 @@  discard block
 block discarded – undo
57 57
 	 */
58 58
 	private function __construct() {
59 59
 		// load Kint PHP debugging library
60
-		if ( ! class_exists( 'Kint' ) &&  file_exists( EE_PLUGIN_DIR_PATH . 'tests' . DS . 'kint' . DS . 'Kint.class.php' )){
60
+		if ( ! class_exists('Kint') && file_exists(EE_PLUGIN_DIR_PATH.'tests'.DS.'kint'.DS.'Kint.class.php')) {
61 61
 			// despite EE4 having a check for an existing copy of the Kint debugging class,
62 62
 			// if another plugin was loaded AFTER EE4 and they did NOT perform a similar check,
63 63
 			// then hilarity would ensue as PHP throws a "Cannot redeclare class Kint" error
64 64
 			// so we've moved it to our test folder so that it is not included with production releases
65 65
 			// plz use https://wordpress.org/plugins/kint-debugger/  if testing production versions of EE
66
-			require_once( EE_PLUGIN_DIR_PATH . 'tests' . DS . 'kint' . DS . 'Kint.class.php' );
66
+			require_once(EE_PLUGIN_DIR_PATH.'tests'.DS.'kint'.DS.'Kint.class.php');
67 67
 		}
68
-		if ( ! defined('DOING_AJAX') || ! isset( $_REQUEST['noheader'] ) || $_REQUEST['noheader'] != 'true' || ! isset( $_REQUEST['TB_iframe'] )) {
68
+		if ( ! defined('DOING_AJAX') || ! isset($_REQUEST['noheader']) || $_REQUEST['noheader'] != 'true' || ! isset($_REQUEST['TB_iframe'])) {
69 69
 			//add_action( 'shutdown', array($this,'espresso_session_footer_dump') );
70 70
 		}
71
-		add_action( 'activated_plugin', array( 'EEH_Debug_Tools', 'ee_plugin_activation_errors' ));
72
-		add_action( 'shutdown', array( 'EEH_Debug_Tools', 'show_db_name' ));
71
+		add_action('activated_plugin', array('EEH_Debug_Tools', 'ee_plugin_activation_errors'));
72
+		add_action('shutdown', array('EEH_Debug_Tools', 'show_db_name'));
73 73
 	}
74 74
 
75 75
 
@@ -80,8 +80,8 @@  discard block
 block discarded – undo
80 80
 	 * 	@return void
81 81
 	 */
82 82
 	public static function show_db_name() {
83
-		if ( ! defined( 'DOING_AJAX' ) && ( defined( 'EE_ERROR_EMAILS' ) && EE_ERROR_EMAILS )) {
84
-			echo '<p style="font-size:10px;font-weight:normal;color:#E76700;margin: 1em 2em; text-align: right;">DB_NAME: '. DB_NAME .'</p>';
83
+		if ( ! defined('DOING_AJAX') && (defined('EE_ERROR_EMAILS') && EE_ERROR_EMAILS)) {
84
+			echo '<p style="font-size:10px;font-weight:normal;color:#E76700;margin: 1em 2em; text-align: right;">DB_NAME: '.DB_NAME.'</p>';
85 85
 		}
86 86
 	}
87 87
 
@@ -93,9 +93,9 @@  discard block
 block discarded – undo
93 93
 	 * 	@return void
94 94
 	 */
95 95
 	public function espresso_session_footer_dump() {
96
-		if ( class_exists('Kint') && function_exists( 'wp_get_current_user' ) && current_user_can('update_core') && ( defined('WP_DEBUG') && WP_DEBUG ) &&  ! defined('DOING_AJAX') && class_exists( 'EE_Registry' )) {
97
-			Kint::dump(  EE_Registry::instance()->SSN->id() );
98
-			Kint::dump( EE_Registry::instance()->SSN );
96
+		if (class_exists('Kint') && function_exists('wp_get_current_user') && current_user_can('update_core') && (defined('WP_DEBUG') && WP_DEBUG) && ! defined('DOING_AJAX') && class_exists('EE_Registry')) {
97
+			Kint::dump(EE_Registry::instance()->SSN->id());
98
+			Kint::dump(EE_Registry::instance()->SSN);
99 99
 //			Kint::dump( EE_Registry::instance()->SSN->get_session_data('cart')->get_tickets() );
100 100
 			$this->espresso_list_hooked_functions();
101 101
 			$this->show_times();
@@ -112,27 +112,27 @@  discard block
 block discarded – undo
112 112
 	 * @param bool $tag
113 113
 	 * @return void
114 114
 	 */
115
-	public function espresso_list_hooked_functions( $tag=FALSE ){
115
+	public function espresso_list_hooked_functions($tag = FALSE) {
116 116
 		global $wp_filter;
117 117
 		echo '<br/><br/><br/><h3>Hooked Functions</h3>';
118
-		if ( $tag ) {
119
-			$hook[$tag]=$wp_filter[$tag];
120
-			if ( ! is_array( $hook[$tag] )) {
121
-				trigger_error( "Nothing found for '$tag' hook", E_USER_WARNING );
118
+		if ($tag) {
119
+			$hook[$tag] = $wp_filter[$tag];
120
+			if ( ! is_array($hook[$tag])) {
121
+				trigger_error("Nothing found for '$tag' hook", E_USER_WARNING);
122 122
 				return;
123 123
 			}
124
-			echo '<h5>For Tag: '. $tag .'</h5>';
124
+			echo '<h5>For Tag: '.$tag.'</h5>';
125 125
 		}
126 126
 		else {
127
-			$hook=$wp_filter;
128
-			ksort( $hook );
127
+			$hook = $wp_filter;
128
+			ksort($hook);
129 129
 		}
130
-		foreach( $hook as $tag => $priorities ) {
130
+		foreach ($hook as $tag => $priorities) {
131 131
 			echo "<br />&gt;&gt;&gt;&gt;&gt;\t<strong>$tag</strong><br />";
132
-			ksort( $priorities );
133
-			foreach( $priorities as $priority => $function ){
132
+			ksort($priorities);
133
+			foreach ($priorities as $priority => $function) {
134 134
 				echo $priority;
135
-				foreach( $function as $name => $properties ) {
135
+				foreach ($function as $name => $properties) {
136 136
 					echo "\t$name<br />";
137 137
 				}
138 138
 			}
@@ -148,15 +148,15 @@  discard block
 block discarded – undo
148 148
 	 * @param string $hook_name
149 149
 	 * @return array
150 150
 	 */
151
-	public static function registered_filter_callbacks( $hook_name = '' ) {
151
+	public static function registered_filter_callbacks($hook_name = '') {
152 152
 		$filters = array();
153 153
 		global $wp_filter;
154
-		if ( isset( $wp_filter[ $hook_name ] ) ) {
155
-			$filters[ $hook_name ] = array();
156
-			foreach ( $wp_filter[ $hook_name ] as $priority => $callbacks ) {
157
-				$filters[ $hook_name ][ $priority ] = array();
158
-				foreach ( $callbacks as $callback ) {
159
-					$filters[ $hook_name ][ $priority ][] = $callback['function'];
154
+		if (isset($wp_filter[$hook_name])) {
155
+			$filters[$hook_name] = array();
156
+			foreach ($wp_filter[$hook_name] as $priority => $callbacks) {
157
+				$filters[$hook_name][$priority] = array();
158
+				foreach ($callbacks as $callback) {
159
+					$filters[$hook_name][$priority][] = $callback['function'];
160 160
 				}
161 161
 			}
162 162
 		}
@@ -169,8 +169,8 @@  discard block
 block discarded – undo
169 169
 	 * 	start_timer
170 170
 	 * @param null $timer_name
171 171
 	 */
172
-	public function start_timer( $timer_name = NULL ){
173
-		$this->_start_times[$timer_name] = microtime( TRUE );
172
+	public function start_timer($timer_name = NULL) {
173
+		$this->_start_times[$timer_name] = microtime(TRUE);
174 174
 	}
175 175
 
176 176
 
@@ -179,15 +179,15 @@  discard block
 block discarded – undo
179 179
 	 * stop_timer
180 180
 	 * @param string $timer_name
181 181
 	 */
182
-	public function stop_timer($timer_name = 'default'){
183
-		if( isset( $this->_start_times[ $timer_name ] ) ){
184
-			$start_time = $this->_start_times[ $timer_name ];
185
-			unset( $this->_start_times[ $timer_name ] );
186
-		}else{
187
-			$start_time = array_pop( $this->_start_times );
182
+	public function stop_timer($timer_name = 'default') {
183
+		if (isset($this->_start_times[$timer_name])) {
184
+			$start_time = $this->_start_times[$timer_name];
185
+			unset($this->_start_times[$timer_name]);
186
+		} else {
187
+			$start_time = array_pop($this->_start_times);
188 188
 		}
189
-		$total_time = microtime( TRUE ) - $start_time;
190
-		switch ( $total_time ) {
189
+		$total_time = microtime(TRUE) - $start_time;
190
+		switch ($total_time) {
191 191
 			case $total_time < 0.00001 :
192 192
 				$color = '#8A549A';
193 193
 				$bold = 'normal';
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
 				$bold = 'bold';
214 214
 				break;
215 215
 		}
216
-		$this->_times[] = '<hr /><div style="display: inline-block; min-width: 10px; margin:0em 1em; color:'.$color.'; font-weight:'.$bold.'; font-size:1.2em;">' . number_format( $total_time, 8 ) . '</div> ' . $timer_name;
216
+		$this->_times[] = '<hr /><div style="display: inline-block; min-width: 10px; margin:0em 1em; color:'.$color.'; font-weight:'.$bold.'; font-size:1.2em;">'.number_format($total_time, 8).'</div> '.$timer_name;
217 217
 	 }
218 218
 	 /**
219 219
 	  * Measure the memory usage by PHP so far.
@@ -221,10 +221,10 @@  discard block
 block discarded – undo
221 221
 	  * @param boolean $output_now whether to echo now, or wait until EEH_Debug_Tools::show_times() is called
222 222
 	  * @return void
223 223
 	  */
224
-	 public function measure_memory( $label, $output_now = false ) {
225
-		 $memory_used = $this->convert( memory_get_peak_usage( true ) );
226
-		 $this->_memory_usage_points[ $label ] = $memory_used;
227
-		 if( $output_now ) {
224
+	 public function measure_memory($label, $output_now = false) {
225
+		 $memory_used = $this->convert(memory_get_peak_usage(true));
226
+		 $this->_memory_usage_points[$label] = $memory_used;
227
+		 if ($output_now) {
228 228
 			 echo "\r\n<br>$label : $memory_used";
229 229
 		 }
230 230
 	 }
@@ -234,9 +234,9 @@  discard block
 block discarded – undo
234 234
 	  * @param int $size
235 235
 	  * @return string
236 236
 	  */
237
-	 public function convert( $size ) {
238
-		$unit=array('b','kb','mb','gb','tb','pb');
239
-		return @round($size/pow(1024,($i=floor(log($size,1024)))),2).' '.$unit[ absint( $i ) ];
237
+	 public function convert($size) {
238
+		$unit = array('b', 'kb', 'mb', 'gb', 'tb', 'pb');
239
+		return @round($size / pow(1024, ($i = floor(log($size, 1024)))), 2).' '.$unit[absint($i)];
240 240
 	 }
241 241
 
242 242
 
@@ -246,9 +246,9 @@  discard block
 block discarded – undo
246 246
 	 * @param bool $output_now
247 247
 	 * @return string
248 248
 	 */
249
-	public function show_times($output_now=true){
250
-		$output = '<h2>Times:</h2>' . implode("<br>",$this->_times) . '<h2>Memory</h2>' . implode('<br>', $this->_memory_usage_points );
251
-		 if($output_now){
249
+	public function show_times($output_now = true) {
250
+		$output = '<h2>Times:</h2>'.implode("<br>", $this->_times).'<h2>Memory</h2>'.implode('<br>', $this->_memory_usage_points);
251
+		 if ($output_now) {
252 252
 			 echo $output;
253 253
 			 return '';
254 254
 		 }
@@ -263,27 +263,27 @@  discard block
 block discarded – undo
263 263
 	 * 	@return void
264 264
 	 */
265 265
 	public static function ee_plugin_activation_errors() {
266
-		if ( defined('WP_DEBUG') && WP_DEBUG ) {
266
+		if (defined('WP_DEBUG') && WP_DEBUG) {
267 267
 			$activation_errors = ob_get_contents();
268
-			if ( class_exists( 'EE_Registry' )) {
269
-				EE_Registry::instance()->load_helper( 'File' );
268
+			if (class_exists('EE_Registry')) {
269
+				EE_Registry::instance()->load_helper('File');
270 270
 			} else {
271
-				include_once( EE_HELPERS . 'EEH_File.helper.php' );
271
+				include_once(EE_HELPERS.'EEH_File.helper.php');
272 272
 			}
273
-			if ( class_exists( 'EEH_File' )) {
273
+			if (class_exists('EEH_File')) {
274 274
 				try {
275
-					EEH_File::ensure_folder_exists_and_is_writable( EVENT_ESPRESSO_UPLOAD_DIR . 'logs' . DS );
276
-					EEH_File::ensure_file_exists_and_is_writable( EVENT_ESPRESSO_UPLOAD_DIR . 'logs' . DS . 'espresso_plugin_activation_errors.html' );
277
-					EEH_File::write_to_file( EVENT_ESPRESSO_UPLOAD_DIR . 'logs' . DS . 'espresso_plugin_activation_errors.html', $activation_errors );
278
-				} catch( EE_Error $e ){
279
-					EE_Error::add_error( sprintf( __(  'The Event Espresso activation errors file could not be setup because: %s', 'event_espresso' ), $e->getMessage() ));
275
+					EEH_File::ensure_folder_exists_and_is_writable(EVENT_ESPRESSO_UPLOAD_DIR.'logs'.DS);
276
+					EEH_File::ensure_file_exists_and_is_writable(EVENT_ESPRESSO_UPLOAD_DIR.'logs'.DS.'espresso_plugin_activation_errors.html');
277
+					EEH_File::write_to_file(EVENT_ESPRESSO_UPLOAD_DIR.'logs'.DS.'espresso_plugin_activation_errors.html', $activation_errors);
278
+				} catch (EE_Error $e) {
279
+					EE_Error::add_error(sprintf(__('The Event Espresso activation errors file could not be setup because: %s', 'event_espresso'), $e->getMessage()));
280 280
 				}
281 281
 			} else {
282 282
 				// old school attempt
283
-				file_put_contents( EVENT_ESPRESSO_UPLOAD_DIR . 'logs' . DS . 'espresso_plugin_activation_errors.html', $activation_errors );
283
+				file_put_contents(EVENT_ESPRESSO_UPLOAD_DIR.'logs'.DS.'espresso_plugin_activation_errors.html', $activation_errors);
284 284
 			}
285
-			$activation_errors = get_option( 'ee_plugin_activation_errors', '' ) . $activation_errors;
286
-			update_option( 'ee_plugin_activation_errors', $activation_errors );
285
+			$activation_errors = get_option('ee_plugin_activation_errors', '').$activation_errors;
286
+			update_option('ee_plugin_activation_errors', $activation_errors);
287 287
 		}
288 288
 	}
289 289
 
@@ -298,10 +298,10 @@  discard block
 block discarded – undo
298 298
 	 * @param  string $version  The version of Event Espresso where the error was added
299 299
 	 * @uses trigger_error()
300 300
 	 */
301
-	public function doing_it_wrong( $function, $message, $version ) {
302
-		do_action( 'AHEE__EEH_Debug_Tools__doing_it_wrong_run', $function, $message, $version);
303
-		$version = is_null( $version ) ? '' : sprintf( __('(This message was added in version %s of Event Espresso.', 'event_espresso' ), $version );
304
-		trigger_error( sprintf( __('%1$s was called <strong>incorrectly</strong>. %2$s %3$s','event_espresso' ), $function, $message, $version ), E_USER_DEPRECATED );
301
+	public function doing_it_wrong($function, $message, $version) {
302
+		do_action('AHEE__EEH_Debug_Tools__doing_it_wrong_run', $function, $message, $version);
303
+		$version = is_null($version) ? '' : sprintf(__('(This message was added in version %s of Event Espresso.', 'event_espresso'), $version);
304
+		trigger_error(sprintf(__('%1$s was called <strong>incorrectly</strong>. %2$s %3$s', 'event_espresso'), $function, $message, $version), E_USER_DEPRECATED);
305 305
 	}
306 306
 
307 307
 
@@ -322,22 +322,22 @@  discard block
 block discarded – undo
322 322
 	 * @param string $debug_index
323 323
 	 * @param string $debug_key
324 324
 	 */
325
-	public static function log( $class='', $func = '', $line = '', $info = array(), $display_request = false,  $debug_index = '', $debug_key = 'EE_DEBUG_SPCO' ) {
326
-		if ( WP_DEBUG && false ) {
327
-			$debug_key = $debug_key . '_' . EE_Session::instance()->id();
328
-			$debug_data = get_option( $debug_key, array() );
325
+	public static function log($class = '', $func = '', $line = '', $info = array(), $display_request = false, $debug_index = '', $debug_key = 'EE_DEBUG_SPCO') {
326
+		if (WP_DEBUG && false) {
327
+			$debug_key = $debug_key.'_'.EE_Session::instance()->id();
328
+			$debug_data = get_option($debug_key, array());
329 329
 			$default_data = array(
330
-				$class => $func . '() : ' . $line,
330
+				$class => $func.'() : '.$line,
331 331
 				'REQ'  => $display_request ? $_REQUEST : '',
332 332
 			);
333 333
 			// don't serialize objects
334
-			$info = self::strip_objects( $info );
335
-			$index = ! empty( $debug_index ) ? $debug_index : 0;
336
-			if ( ! isset( $debug_data[$index] ) ) {
334
+			$info = self::strip_objects($info);
335
+			$index = ! empty($debug_index) ? $debug_index : 0;
336
+			if ( ! isset($debug_data[$index])) {
337 337
 				$debug_data[$index] = array();
338 338
 			}
339
-			$debug_data[$index][microtime()] = array_merge( $default_data, $info );
340
-			update_option( $debug_key, $debug_data );
339
+			$debug_data[$index][microtime()] = array_merge($default_data, $info);
340
+			update_option($debug_key, $debug_data);
341 341
 		}
342 342
 	}
343 343
 
@@ -349,26 +349,26 @@  discard block
 block discarded – undo
349 349
 	 * @param array $info
350 350
 	 * @return array
351 351
 	 */
352
-	public static function strip_objects( $info = array() ) {
353
-		foreach ( $info as $key => $value ) {
354
-			if ( is_array( $value ) ) {
355
-				$info[ $key ] = self::strip_objects( $value );
356
-			} else if ( is_object( $value ) ) {
357
-				$object_class = get_class( $value );
358
-				$info[ $object_class ] = array();
359
-				$info[ $object_class ][ 'ID' ] = method_exists( $value, 'ID' ) ? $value->ID() : spl_object_hash( $value );
360
-				if ( method_exists( $value, 'ID' ) ) {
361
-					$info[ $object_class ][ 'ID' ] = $value->ID();
352
+	public static function strip_objects($info = array()) {
353
+		foreach ($info as $key => $value) {
354
+			if (is_array($value)) {
355
+				$info[$key] = self::strip_objects($value);
356
+			} else if (is_object($value)) {
357
+				$object_class = get_class($value);
358
+				$info[$object_class] = array();
359
+				$info[$object_class]['ID'] = method_exists($value, 'ID') ? $value->ID() : spl_object_hash($value);
360
+				if (method_exists($value, 'ID')) {
361
+					$info[$object_class]['ID'] = $value->ID();
362 362
 				}
363
-				if ( method_exists( $value, 'status' ) ) {
364
-					$info[ $object_class ][ 'status' ] = $value->status();
365
-				} else if ( method_exists( $value, 'status_ID' ) ) {
366
-					$info[ $object_class ][ 'status' ] = $value->status_ID();
363
+				if (method_exists($value, 'status')) {
364
+					$info[$object_class]['status'] = $value->status();
365
+				} else if (method_exists($value, 'status_ID')) {
366
+					$info[$object_class]['status'] = $value->status_ID();
367 367
 				}
368
-				unset( $info[ $key ] );
368
+				unset($info[$key]);
369 369
 			}
370 370
 		}
371
-		return (array)$info;
371
+		return (array) $info;
372 372
 	}
373 373
 
374 374
 
@@ -385,31 +385,31 @@  discard block
 block discarded – undo
385 385
 	 * @param string $height
386 386
 	 * @param bool $die
387 387
 	 */
388
-	public static function printr( $var, $var_name = false, $file = __FILE__, $line = __LINE__, $height = 'auto', $die = false ) {
388
+	public static function printr($var, $var_name = false, $file = __FILE__, $line = __LINE__, $height = 'auto', $die = false) {
389 389
 		//$print_r = false;
390
-		if ( is_object( $var ) ) {
390
+		if (is_object($var)) {
391 391
 			$var_name = ! $var_name ? 'object' : $var_name;
392 392
 			//$print_r = true;
393
-		} else if ( is_array( $var ) ) {
393
+		} else if (is_array($var)) {
394 394
 			$var_name = ! $var_name ? 'array' : $var_name;
395 395
 			//$print_r = true;
396
-		} else if ( is_numeric( $var ) ) {
396
+		} else if (is_numeric($var)) {
397 397
 			$var_name = ! $var_name ? 'numeric' : $var_name;
398
-		} else if ( is_string( $var ) ) {
398
+		} else if (is_string($var)) {
399 399
 			$var_name = ! $var_name ? 'string' : $var_name;
400
-		} else if ( is_null( $var ) ) {
400
+		} else if (is_null($var)) {
401 401
 			$var_name = ! $var_name ? 'null' : $var_name;
402 402
 		}
403
-		$var_name = ucwords( str_replace( array( '$', '_' ), array( '', ' ' ), $var_name ) );
403
+		$var_name = ucwords(str_replace(array('$', '_'), array('', ' '), $var_name));
404 404
 		ob_start();
405
-		echo '<pre style="display:block; width:100%; height:' . $height . '; border:2px solid light-blue;">';
406
-		echo '<h5 style="color:#2EA2CC;"><b>' . $var_name . '</b></h5><span style="color:#E76700">';
405
+		echo '<pre style="display:block; width:100%; height:'.$height.'; border:2px solid light-blue;">';
406
+		echo '<h5 style="color:#2EA2CC;"><b>'.$var_name.'</b></h5><span style="color:#E76700">';
407 407
 		//$print_r ? print_r( $var ) : var_dump( $var );
408
-		var_dump( $var );
409
-		echo '</span><br /><span style="font-size:10px;font-weight:normal;">' . $file . '<br />line no: ' . $line . '</span></pre>';
408
+		var_dump($var);
409
+		echo '</span><br /><span style="font-size:10px;font-weight:normal;">'.$file.'<br />line no: '.$line.'</span></pre>';
410 410
 		$result = ob_get_clean();
411
-		if ( $die ) {
412
-			die( $result );
411
+		if ($die) {
412
+			die($result);
413 413
 		} else {
414 414
 			echo $result;
415 415
 		}
@@ -426,8 +426,8 @@  discard block
 block discarded – undo
426 426
  * borrowed from Kint Debugger
427 427
  * Plugin URI: http://upthemes.com/plugins/kint-debugger/
428 428
  */
429
-if ( class_exists('Kint') && ! function_exists( 'dump_wp_query' ) ) {
430
-	function dump_wp_query(){
429
+if (class_exists('Kint') && ! function_exists('dump_wp_query')) {
430
+	function dump_wp_query() {
431 431
 		global $wp_query;
432 432
 		d($wp_query);
433 433
 	}
@@ -437,8 +437,8 @@  discard block
 block discarded – undo
437 437
  * borrowed from Kint Debugger
438 438
  * Plugin URI: http://upthemes.com/plugins/kint-debugger/
439 439
  */
440
-if ( class_exists('Kint') && ! function_exists( 'dump_wp' ) ) {
441
-	function dump_wp(){
440
+if (class_exists('Kint') && ! function_exists('dump_wp')) {
441
+	function dump_wp() {
442 442
 		global $wp;
443 443
 		d($wp);
444 444
 	}
@@ -448,8 +448,8 @@  discard block
 block discarded – undo
448 448
  * borrowed from Kint Debugger
449 449
  * Plugin URI: http://upthemes.com/plugins/kint-debugger/
450 450
  */
451
-if ( class_exists('Kint') && ! function_exists( 'dump_post' ) ) {
452
-	function dump_post(){
451
+if (class_exists('Kint') && ! function_exists('dump_post')) {
452
+	function dump_post() {
453 453
 		global $post;
454 454
 		d($post);
455 455
 	}
Please login to merge, or discard this patch.