Completed
Branch dev (08e10f)
by
unknown
12:20 queued 10:12
created
core/data_migration_scripts/EE_DMS_Core_4_7_0.dms.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -15,12 +15,12 @@  discard block
 block discarded – undo
15 15
 // unfortunately, this needs to be done upon INCLUSION of this file,
16 16
 // instead of construction, because it only gets constructed on first page load
17 17
 // (all other times it gets resurrected from a wordpress option)
18
-$stages = glob(EE_CORE . 'data_migration_scripts/4_7_0_stages/*');
18
+$stages = glob(EE_CORE.'data_migration_scripts/4_7_0_stages/*');
19 19
 $class_to_filepath = array();
20 20
 foreach ($stages as $filepath) {
21 21
     $matches = array();
22 22
     preg_match('~4_7_0_stages/(.*).dmsstage.php~', $filepath, $matches);
23
-    $class_to_filepath[ $matches[1] ] = $filepath;
23
+    $class_to_filepath[$matches[1]] = $filepath;
24 24
 }
25 25
 // give addons a chance to autoload their stages too
26 26
 $class_to_filepath = apply_filters('FHEE__EE_DMS_4_7_0__autoloaded_stages', $class_to_filepath);
@@ -76,9 +76,9 @@  discard block
 block discarded – undo
76 76
             )
77 77
         ) {
78 78
             return true;
79
-        } elseif (! $version_string) {
79
+        } elseif ( ! $version_string) {
80 80
             // no version string provided... this must be pre 4.3
81
-            return false;// changed mind. dont want people thinking they should migrate yet because they cant
81
+            return false; // changed mind. dont want people thinking they should migrate yet because they cant
82 82
         } else {
83 83
             return false;
84 84
         }
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
     public function schema_changes_before_migration()
93 93
     {
94 94
         // relies on 4.1's EEH_Activation::create_table
95
-        require_once(EE_HELPERS . 'EEH_Activation.helper.php');
95
+        require_once(EE_HELPERS.'EEH_Activation.helper.php');
96 96
         $table_name = 'esp_answer';
97 97
         $sql = " ANS_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
98 98
 					REG_ID int(10) unsigned NOT NULL,
Please login to merge, or discard this patch.
Indentation   +181 added lines, -181 removed lines patch added patch discarded remove patch
@@ -19,9 +19,9 @@  discard block
 block discarded – undo
19 19
 $stages = glob(EE_CORE . 'data_migration_scripts/4_7_0_stages/*');
20 20
 $class_to_filepath = array();
21 21
 foreach ($stages as $filepath) {
22
-    $matches = array();
23
-    preg_match('~4_7_0_stages/(.*).dmsstage.php~', $filepath, $matches);
24
-    $class_to_filepath[ $matches[1] ] = $filepath;
22
+	$matches = array();
23
+	preg_match('~4_7_0_stages/(.*).dmsstage.php~', $filepath, $matches);
24
+	$class_to_filepath[ $matches[1] ] = $filepath;
25 25
 }
26 26
 // give addons a chance to autoload their stages too
27 27
 $class_to_filepath = apply_filters('FHEE__EE_DMS_4_7_0__autoloaded_stages', $class_to_filepath);
@@ -40,72 +40,72 @@  discard block
 block discarded – undo
40 40
 class EE_DMS_Core_4_7_0 extends EE_Data_Migration_Script_Base
41 41
 {
42 42
 
43
-    /**
44
-     * return EE_DMS_Core_4_7_0
45
-     *
46
-     * @param TableManager  $table_manager
47
-     * @param TableAnalysis $table_analysis
48
-     */
49
-    public function __construct(TableManager $table_manager = null, TableAnalysis $table_analysis = null)
50
-    {
51
-        $this->_pretty_name = esc_html__("Data Update to Event Espresso 4.7.0", "event_espresso");
52
-        $this->_priority = 10;
53
-        $this->_migration_stages = array(
54
-            new EE_DMS_4_7_0_Add_Taxes_To_REG_Final_Price(),
55
-            new EE_DMS_4_7_0_Registration_Payments(),
56
-        );
57
-        parent::__construct($table_manager, $table_analysis);
58
-    }
43
+	/**
44
+	 * return EE_DMS_Core_4_7_0
45
+	 *
46
+	 * @param TableManager  $table_manager
47
+	 * @param TableAnalysis $table_analysis
48
+	 */
49
+	public function __construct(TableManager $table_manager = null, TableAnalysis $table_analysis = null)
50
+	{
51
+		$this->_pretty_name = esc_html__("Data Update to Event Espresso 4.7.0", "event_espresso");
52
+		$this->_priority = 10;
53
+		$this->_migration_stages = array(
54
+			new EE_DMS_4_7_0_Add_Taxes_To_REG_Final_Price(),
55
+			new EE_DMS_4_7_0_Registration_Payments(),
56
+		);
57
+		parent::__construct($table_manager, $table_analysis);
58
+	}
59 59
 
60 60
 
61 61
 
62
-    /**
63
-     * @param array $version_array
64
-     * @return bool
65
-     */
66
-    public function can_migrate_from_version($version_array)
67
-    {
68
-        $version_string = $version_array['Core'];
69
-        if (
70
-            (
71
-                version_compare($version_string, '4.7.0.decaf', '<')
72
-                && version_compare($version_string, '4.6.0.decaf', '>=')
73
-            )
74
-            || (
75
-                version_compare($version_string, '4.7.0.decaf', '>=')
76
-                && ! $this->_get_table_analysis()->tableExists('esp_registration_payment')
77
-                && $this->_get_table_analysis()->tableExists('esp_registration')
78
-            )
79
-        ) {
80
-            return true;
81
-        } elseif (! $version_string) {
82
-            // no version string provided... this must be pre 4.3
83
-            return false;// changed mind. dont want people thinking they should migrate yet because they cant
84
-        } else {
85
-            return false;
86
-        }
87
-    }
62
+	/**
63
+	 * @param array $version_array
64
+	 * @return bool
65
+	 */
66
+	public function can_migrate_from_version($version_array)
67
+	{
68
+		$version_string = $version_array['Core'];
69
+		if (
70
+			(
71
+				version_compare($version_string, '4.7.0.decaf', '<')
72
+				&& version_compare($version_string, '4.6.0.decaf', '>=')
73
+			)
74
+			|| (
75
+				version_compare($version_string, '4.7.0.decaf', '>=')
76
+				&& ! $this->_get_table_analysis()->tableExists('esp_registration_payment')
77
+				&& $this->_get_table_analysis()->tableExists('esp_registration')
78
+			)
79
+		) {
80
+			return true;
81
+		} elseif (! $version_string) {
82
+			// no version string provided... this must be pre 4.3
83
+			return false;// changed mind. dont want people thinking they should migrate yet because they cant
84
+		} else {
85
+			return false;
86
+		}
87
+	}
88 88
 
89 89
 
90 90
 
91
-    /**
92
-     * @return bool
93
-     */
94
-    public function schema_changes_before_migration()
95
-    {
96
-        // relies on 4.1's EEH_Activation::create_table
97
-        require_once(EE_HELPERS . 'EEH_Activation.helper.php');
98
-        $table_name = 'esp_answer';
99
-        $sql = " ANS_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
91
+	/**
92
+	 * @return bool
93
+	 */
94
+	public function schema_changes_before_migration()
95
+	{
96
+		// relies on 4.1's EEH_Activation::create_table
97
+		require_once(EE_HELPERS . 'EEH_Activation.helper.php');
98
+		$table_name = 'esp_answer';
99
+		$sql = " ANS_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
100 100
 					REG_ID int(10) unsigned NOT NULL,
101 101
 					QST_ID int(10) unsigned NOT NULL,
102 102
 					ANS_value text NOT NULL,
103 103
 					PRIMARY KEY  (ANS_ID),
104 104
 					KEY REG_ID (REG_ID),
105 105
 					KEY QST_ID (QST_ID)";
106
-        $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
107
-        $table_name = 'esp_attendee_meta';
108
-        $sql = "ATTM_ID int(10) unsigned NOT	NULL AUTO_INCREMENT,
106
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
107
+		$table_name = 'esp_attendee_meta';
108
+		$sql = "ATTM_ID int(10) unsigned NOT	NULL AUTO_INCREMENT,
109 109
 						ATT_ID bigint(20) unsigned NOT NULL,
110 110
 						ATT_fname varchar(45) NOT NULL,
111 111
 						ATT_lname varchar(45) NOT	NULL,
@@ -122,9 +122,9 @@  discard block
 block discarded – undo
122 122
 								KEY ATT_email (ATT_email(191)),
123 123
 								KEY ATT_lname (ATT_lname),
124 124
 								KEY ATT_fname (ATT_fname)";
125
-        $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB ');
126
-        $table_name = 'esp_country';
127
-        $sql = "CNT_ISO varchar(2) COLLATE utf8_bin NOT NULL,
125
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB ');
126
+		$table_name = 'esp_country';
127
+		$sql = "CNT_ISO varchar(2) COLLATE utf8_bin NOT NULL,
128 128
 					  CNT_ISO3 varchar(3) COLLATE utf8_bin NOT NULL,
129 129
 					  RGN_ID tinyint(3) unsigned DEFAULT NULL,
130 130
 					  CNT_name varchar(45) COLLATE utf8_bin NOT NULL,
@@ -140,25 +140,25 @@  discard block
 block discarded – undo
140 140
 					  CNT_is_EU tinyint(1) DEFAULT '0',
141 141
 					  CNT_active tinyint(1) DEFAULT '0',
142 142
 					  PRIMARY KEY  (CNT_ISO)";
143
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
144
-        $table_name = 'esp_currency';
145
-        $sql = "CUR_code varchar(6) COLLATE utf8_bin NOT NULL,
143
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
144
+		$table_name = 'esp_currency';
145
+		$sql = "CUR_code varchar(6) COLLATE utf8_bin NOT NULL,
146 146
 				CUR_single varchar(45) COLLATE utf8_bin DEFAULT 'dollar',
147 147
 				CUR_plural varchar(45) COLLATE utf8_bin DEFAULT 'dollars',
148 148
 				CUR_sign varchar(45) COLLATE utf8_bin DEFAULT '$',
149 149
 				CUR_dec_plc varchar(1) COLLATE utf8_bin NOT NULL DEFAULT '2',
150 150
 				CUR_active tinyint(1) DEFAULT '0',
151 151
 				PRIMARY KEY  (CUR_code)";
152
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
153
-        $table_name = 'esp_currency_payment_method';
154
-        $sql = "CPM_ID int(11) NOT NULL AUTO_INCREMENT,
152
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
153
+		$table_name = 'esp_currency_payment_method';
154
+		$sql = "CPM_ID int(11) NOT NULL AUTO_INCREMENT,
155 155
 				CUR_code varchar(6) COLLATE utf8_bin NOT NULL,
156 156
 				PMD_ID int(11) NOT NULL,
157 157
 				PRIMARY KEY  (CPM_ID),
158 158
 				KEY PMD_ID (PMD_ID)";
159
-        $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB ');
160
-        $table_name = 'esp_datetime';
161
-        $sql = "DTT_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
159
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB ');
160
+		$table_name = 'esp_datetime';
161
+		$sql = "DTT_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
162 162
 				  EVT_ID bigint(20) unsigned NOT NULL,
163 163
 				  DTT_name varchar(255) NOT NULL DEFAULT '',
164 164
 				  DTT_description text NOT NULL,
@@ -174,9 +174,9 @@  discard block
 block discarded – undo
174 174
 						KEY DTT_EVT_start (DTT_EVT_start),
175 175
 						KEY EVT_ID (EVT_ID),
176 176
 						KEY DTT_is_primary (DTT_is_primary)";
177
-        $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
178
-        $table_name = 'esp_event_meta';
179
-        $sql = "
177
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
178
+		$table_name = 'esp_event_meta';
179
+		$sql = "
180 180
 			EVTM_ID int(10) NOT NULL AUTO_INCREMENT,
181 181
 			EVT_ID bigint(20) unsigned NOT NULL,
182 182
 			EVT_display_desc tinyint(1) unsigned NOT NULL DEFAULT 1,
@@ -192,34 +192,34 @@  discard block
 block discarded – undo
192 192
 			EVT_donations tinyint(1) NULL,
193 193
 			PRIMARY KEY  (EVTM_ID),
194 194
 			KEY EVT_ID (EVT_ID)";
195
-        $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
196
-        $table_name = 'esp_event_question_group';
197
-        $sql = "EQG_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
195
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
196
+		$table_name = 'esp_event_question_group';
197
+		$sql = "EQG_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
198 198
 					EVT_ID bigint(20) unsigned NOT NULL,
199 199
 					QSG_ID int(10) unsigned NOT NULL,
200 200
 					EQG_primary tinyint(1) unsigned NOT NULL DEFAULT 0,
201 201
 					PRIMARY KEY  (EQG_ID),
202 202
 					KEY EVT_ID (EVT_ID),
203 203
 					KEY QSG_ID (QSG_ID)";
204
-        $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
205
-        $table_name = 'esp_event_venue';
206
-        $sql = "EVV_ID int(11) NOT NULL AUTO_INCREMENT,
204
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
205
+		$table_name = 'esp_event_venue';
206
+		$sql = "EVV_ID int(11) NOT NULL AUTO_INCREMENT,
207 207
 				EVT_ID bigint(20) unsigned NOT NULL,
208 208
 				VNU_ID bigint(20) unsigned NOT NULL,
209 209
 				EVV_primary tinyint(1) unsigned NOT NULL DEFAULT 0,
210 210
 				PRIMARY KEY  (EVV_ID)";
211
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
212
-        $table_name = 'esp_extra_meta';
213
-        $sql = "EXM_ID int(11) NOT NULL AUTO_INCREMENT,
211
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
212
+		$table_name = 'esp_extra_meta';
213
+		$sql = "EXM_ID int(11) NOT NULL AUTO_INCREMENT,
214 214
 				OBJ_ID int(11) DEFAULT NULL,
215 215
 				EXM_type varchar(45) DEFAULT NULL,
216 216
 				EXM_key varchar(45) DEFAULT NULL,
217 217
 				EXM_value text,
218 218
 				PRIMARY KEY  (EXM_ID),
219 219
 				KEY EXM_type (EXM_type, OBJ_ID, EXM_key(45))";
220
-        $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
221
-        $table_name = 'esp_line_item';
222
-        $sql = "LIN_ID int(11) NOT NULL AUTO_INCREMENT,
220
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
221
+		$table_name = 'esp_line_item';
222
+		$sql = "LIN_ID int(11) NOT NULL AUTO_INCREMENT,
223 223
 				LIN_code varchar(245) NOT NULL DEFAULT '',
224 224
 				TXN_ID int(11) DEFAULT NULL,
225 225
 				LIN_name varchar(245) NOT NULL DEFAULT '',
@@ -237,9 +237,9 @@  discard block
 block discarded – undo
237 237
 				PRIMARY KEY  (LIN_ID),
238 238
 				KEY LIN_code (LIN_code(191)),
239 239
 				KEY TXN_ID (TXN_ID)";
240
-        $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
241
-        $table_name = 'esp_log';
242
-        $sql = "LOG_ID int(11) NOT NULL AUTO_INCREMENT,
240
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
241
+		$table_name = 'esp_log';
242
+		$sql = "LOG_ID int(11) NOT NULL AUTO_INCREMENT,
243 243
 				LOG_time datetime DEFAULT NULL,
244 244
 				OBJ_ID varchar(45) DEFAULT NULL,
245 245
 				OBJ_type varchar(45) DEFAULT NULL,
@@ -250,18 +250,18 @@  discard block
 block discarded – undo
250 250
 				KEY LOG_time (LOG_time),
251 251
 				KEY OBJ (OBJ_type,OBJ_ID),
252 252
 				KEY LOG_type (LOG_type)";
253
-        $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
254
-        $table_name = 'esp_message_template';
255
-        $sql = "MTP_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
253
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
254
+		$table_name = 'esp_message_template';
255
+		$sql = "MTP_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
256 256
 					GRP_ID int(10) unsigned NOT NULL,
257 257
 					MTP_context varchar(50) NOT NULL,
258 258
 					MTP_template_field varchar(30) NOT NULL,
259 259
 					MTP_content text NOT NULL,
260 260
 					PRIMARY KEY  (MTP_ID),
261 261
 					KEY GRP_ID (GRP_ID)";
262
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
263
-        $table_name = 'esp_message_template_group';
264
-        $sql = "GRP_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
262
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
263
+		$table_name = 'esp_message_template_group';
264
+		$sql = "GRP_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
265 265
 					MTP_user_id int(10) NOT NULL DEFAULT '1',
266 266
 					MTP_name varchar(245) NOT NULL DEFAULT '',
267 267
 					MTP_description varchar(245) NOT NULL DEFAULT '',
@@ -273,17 +273,17 @@  discard block
 block discarded – undo
273 273
 					MTP_is_active tinyint(1) NOT NULL DEFAULT '1',
274 274
 					PRIMARY KEY  (GRP_ID),
275 275
 					KEY MTP_user_id (MTP_user_id)";
276
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
277
-        $table_name = 'esp_event_message_template';
278
-        $sql = "EMT_ID bigint(20) unsigned NOT NULL AUTO_INCREMENT,
276
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
277
+		$table_name = 'esp_event_message_template';
278
+		$sql = "EMT_ID bigint(20) unsigned NOT NULL AUTO_INCREMENT,
279 279
 					EVT_ID bigint(20) unsigned NOT NULL DEFAULT 0,
280 280
 					GRP_ID int(10) unsigned NOT NULL DEFAULT 0,
281 281
 					PRIMARY KEY  (EMT_ID),
282 282
 					KEY EVT_ID (EVT_ID),
283 283
 					KEY GRP_ID (GRP_ID)";
284
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
285
-        $table_name = 'esp_payment';
286
-        $sql = "PAY_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
284
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
285
+		$table_name = 'esp_payment';
286
+		$sql = "PAY_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
287 287
 					TXN_ID int(10) unsigned DEFAULT NULL,
288 288
 					STS_ID varchar(3) COLLATE utf8_bin DEFAULT NULL,
289 289
 					PAY_timestamp datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
@@ -300,9 +300,9 @@  discard block
 block discarded – undo
300 300
 					PRIMARY KEY  (PAY_ID),
301 301
 					KEY PAY_timestamp (PAY_timestamp),
302 302
 					KEY TXN_ID (TXN_ID)";
303
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB ');
304
-        $table_name = 'esp_payment_method';
305
-        $sql = "PMD_ID int(11) NOT NULL AUTO_INCREMENT,
303
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB ');
304
+		$table_name = 'esp_payment_method';
305
+		$sql = "PMD_ID int(11) NOT NULL AUTO_INCREMENT,
306 306
 				PMD_type varchar(124) DEFAULT NULL,
307 307
 				PMD_name varchar(255) DEFAULT NULL,
308 308
 				PMD_desc text,
@@ -318,32 +318,32 @@  discard block
 block discarded – undo
318 318
 				PRIMARY KEY  (PMD_ID),
319 319
 				UNIQUE KEY PMD_slug_UNIQUE (PMD_slug),
320 320
 				KEY PMD_type (PMD_type)";
321
-        $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB ');
322
-        $table_name = "esp_ticket_price";
323
-        $sql = "TKP_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
321
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB ');
322
+		$table_name = "esp_ticket_price";
323
+		$sql = "TKP_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
324 324
 					  TKT_ID int(10) unsigned NOT NULL,
325 325
 					  PRC_ID int(10) unsigned NOT NULL,
326 326
 					  PRIMARY KEY  (TKP_ID),
327 327
 					  KEY TKT_ID (TKT_ID),
328 328
 					  KEY PRC_ID (PRC_ID)";
329
-        $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
330
-        $table_name = "esp_datetime_ticket";
331
-        $sql = "DTK_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
329
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
330
+		$table_name = "esp_datetime_ticket";
331
+		$sql = "DTK_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
332 332
 					  DTT_ID int(10) unsigned NOT NULL,
333 333
 					  TKT_ID int(10) unsigned NOT NULL,
334 334
 					  PRIMARY KEY  (DTK_ID),
335 335
 					  KEY DTT_ID (DTT_ID),
336 336
 					  KEY TKT_ID (TKT_ID)";
337
-        $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
338
-        $table_name = "esp_ticket_template";
339
-        $sql = "TTM_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
337
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
338
+		$table_name = "esp_ticket_template";
339
+		$sql = "TTM_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
340 340
 					  TTM_name varchar(45) NOT NULL,
341 341
 					  TTM_description text,
342 342
 					  TTM_file varchar(45),
343 343
 					  PRIMARY KEY  (TTM_ID)";
344
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
345
-        $table_name = 'esp_question';
346
-        $sql = 'QST_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
344
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
345
+		$table_name = 'esp_question';
346
+		$sql = 'QST_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
347 347
 					QST_display_text text NOT NULL,
348 348
 					QST_admin_label varchar(255) NOT NULL,
349 349
 					QST_system varchar(25) DEFAULT NULL,
@@ -356,18 +356,18 @@  discard block
 block discarded – undo
356 356
 					QST_deleted tinyint(2) unsigned NOT NULL DEFAULT 0,
357 357
 					PRIMARY KEY  (QST_ID),
358 358
 					KEY QST_order (QST_order)';
359
-        $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
360
-        $table_name = 'esp_question_group_question';
361
-        $sql = "QGQ_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
359
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
360
+		$table_name = 'esp_question_group_question';
361
+		$sql = "QGQ_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
362 362
 					QSG_ID int(10) unsigned NOT NULL,
363 363
 					QST_ID int(10) unsigned NOT NULL,
364 364
 					QGQ_order int(10) unsigned NOT NULL DEFAULT 0,
365 365
 					PRIMARY KEY  (QGQ_ID),
366 366
 					KEY QST_ID (QST_ID),
367 367
 					KEY QSG_ID_order (QSG_ID, QGQ_order)";
368
-        $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
369
-        $table_name = 'esp_question_option';
370
-        $sql = "QSO_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
368
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
369
+		$table_name = 'esp_question_option';
370
+		$sql = "QSO_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
371 371
 					QSO_value varchar(255) NOT NULL,
372 372
 					QSO_desc text NOT NULL,
373 373
 					QST_ID int(10) unsigned NOT NULL,
@@ -376,9 +376,9 @@  discard block
 block discarded – undo
376 376
 					PRIMARY KEY  (QSO_ID),
377 377
 					KEY QST_ID (QST_ID),
378 378
 					KEY QSO_order (QSO_order)";
379
-        $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
380
-        $table_name = 'esp_registration';
381
-        $sql = "REG_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
379
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
380
+		$table_name = 'esp_registration';
381
+		$sql = "REG_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
382 382
 					  EVT_ID bigint(20) unsigned NOT NULL,
383 383
 					  ATT_ID bigint(20) unsigned NOT NULL,
384 384
 					  TXN_ID int(10) unsigned NOT NULL,
@@ -402,18 +402,18 @@  discard block
 block discarded – undo
402 402
 					  KEY TKT_ID (TKT_ID),
403 403
 					  KEY EVT_ID (EVT_ID),
404 404
 					  KEY STS_ID (STS_ID)";
405
-        $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB ');
406
-        $table_name = 'esp_registration_payment';
407
-        $sql = "RPY_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
405
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB ');
406
+		$table_name = 'esp_registration_payment';
407
+		$sql = "RPY_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
408 408
 					  REG_ID int(10) unsigned NOT NULL,
409 409
 					  PAY_ID int(10) unsigned NULL,
410 410
 					  RPY_amount decimal(10,3) NOT NULL DEFAULT '0.00',
411 411
 					  PRIMARY KEY  (RPY_ID),
412 412
 					  KEY REG_ID (REG_ID),
413 413
 					  KEY PAY_ID (PAY_ID)";
414
-        $this->_table_is_new_in_this_version($table_name, $sql, 'ENGINE=InnoDB ');
415
-        $table_name = 'esp_checkin';
416
-        $sql = "CHK_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
414
+		$this->_table_is_new_in_this_version($table_name, $sql, 'ENGINE=InnoDB ');
415
+		$table_name = 'esp_checkin';
416
+		$sql = "CHK_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
417 417
 					REG_ID int(10) unsigned NOT NULL,
418 418
 					DTT_ID int(10) unsigned NOT NULL,
419 419
 					CHK_in tinyint(1) unsigned NOT NULL DEFAULT 1,
@@ -421,9 +421,9 @@  discard block
 block discarded – undo
421 421
 					PRIMARY KEY  (CHK_ID),
422 422
 					KEY REG_ID (REG_ID),
423 423
 					KEY DTT_ID (DTT_ID)";
424
-        $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
425
-        $table_name = 'esp_state';
426
-        $sql = "STA_ID smallint(5) unsigned NOT NULL AUTO_INCREMENT,
424
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
425
+		$table_name = 'esp_state';
426
+		$sql = "STA_ID smallint(5) unsigned NOT NULL AUTO_INCREMENT,
427 427
 					  CNT_ISO varchar(2) COLLATE utf8_bin NOT NULL,
428 428
 					  STA_abbrev varchar(24) COLLATE utf8_bin NOT NULL,
429 429
 					  STA_name varchar(100) COLLATE utf8_bin NOT NULL,
@@ -431,9 +431,9 @@  discard block
 block discarded – undo
431 431
 					  PRIMARY KEY  (STA_ID),
432 432
 					  KEY STA_abbrev (STA_abbrev),
433 433
 					  KEY CNT_ISO (CNT_ISO)";
434
-        $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
435
-        $table_name = 'esp_status';
436
-        $sql = "STS_ID varchar(3) COLLATE utf8_bin NOT NULL,
434
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
435
+		$table_name = 'esp_status';
436
+		$sql = "STS_ID varchar(3) COLLATE utf8_bin NOT NULL,
437 437
 					  STS_code varchar(45) COLLATE utf8_bin NOT NULL,
438 438
 					  STS_type set('event','registration','transaction','payment','email') COLLATE utf8_bin NOT NULL,
439 439
 					  STS_can_edit tinyint(1) NOT NULL DEFAULT 0,
@@ -441,9 +441,9 @@  discard block
 block discarded – undo
441 441
 					  STS_open tinyint(1) NOT NULL DEFAULT 1,
442 442
 					  UNIQUE KEY STS_ID_UNIQUE (STS_ID),
443 443
 					  KEY STS_type (STS_type)";
444
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
445
-        $table_name = 'esp_transaction';
446
-        $sql = "TXN_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
444
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
445
+		$table_name = 'esp_transaction';
446
+		$sql = "TXN_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
447 447
 					  TXN_timestamp datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
448 448
 					  TXN_total decimal(10,3) DEFAULT '0.00',
449 449
 					  TXN_paid decimal(10,3) NOT NULL DEFAULT '0.00',
@@ -455,9 +455,9 @@  discard block
 block discarded – undo
455 455
 					  PRIMARY KEY  (TXN_ID),
456 456
 					  KEY TXN_timestamp (TXN_timestamp),
457 457
 					  KEY STS_ID (STS_ID)";
458
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
459
-        $table_name = 'esp_venue_meta';
460
-        $sql = "VNUM_ID int(11) NOT NULL AUTO_INCREMENT,
458
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
459
+		$table_name = 'esp_venue_meta';
460
+		$sql = "VNUM_ID int(11) NOT NULL AUTO_INCREMENT,
461 461
 			VNU_ID bigint(20) unsigned NOT NULL DEFAULT 0,
462 462
 			VNU_address varchar(255) DEFAULT NULL,
463 463
 			VNU_address2 varchar(255) DEFAULT NULL,
@@ -476,10 +476,10 @@  discard block
 block discarded – undo
476 476
 			KEY VNU_ID (VNU_ID),
477 477
 			KEY STA_ID (STA_ID),
478 478
 			KEY CNT_ISO (CNT_ISO)";
479
-        $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
480
-        // modified tables
481
-        $table_name = "esp_price";
482
-        $sql = "PRC_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
479
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
480
+		// modified tables
481
+		$table_name = "esp_price";
482
+		$sql = "PRC_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
483 483
 					  PRT_ID tinyint(3) unsigned NOT NULL,
484 484
 					  PRC_amount decimal(10,3) NOT NULL DEFAULT '0.00',
485 485
 					  PRC_name varchar(245) NOT NULL,
@@ -492,9 +492,9 @@  discard block
 block discarded – undo
492 492
 					  PRC_parent int(10) unsigned DEFAULT 0,
493 493
 					  PRIMARY KEY  (PRC_ID),
494 494
 					  KEY PRT_ID (PRT_ID)";
495
-        $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
496
-        $table_name = "esp_price_type";
497
-        $sql = "PRT_ID tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
495
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
496
+		$table_name = "esp_price_type";
497
+		$sql = "PRT_ID tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
498 498
 				  PRT_name varchar(45) NOT NULL,
499 499
 				  PBT_ID tinyint(3) unsigned NOT NULL DEFAULT '1',
500 500
 				  PRT_is_percent tinyint(1) NOT NULL DEFAULT '0',
@@ -503,9 +503,9 @@  discard block
 block discarded – undo
503 503
 				  PRT_deleted tinyint(1) NOT NULL DEFAULT '0',
504 504
 				  UNIQUE KEY PRT_name_UNIQUE (PRT_name),
505 505
 				  PRIMARY KEY  (PRT_ID)";
506
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB ');
507
-        $table_name = "esp_ticket";
508
-        $sql = "TKT_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
506
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB ');
507
+		$table_name = "esp_ticket";
508
+		$sql = "TKT_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
509 509
 					  TTM_ID int(10) unsigned NOT NULL,
510 510
 					  TKT_name varchar(245) NOT NULL DEFAULT '',
511 511
 					  TKT_description text NOT NULL,
@@ -527,9 +527,9 @@  discard block
 block discarded – undo
527 527
 					  TKT_deleted tinyint(1) NOT NULL DEFAULT '0',
528 528
 					  PRIMARY KEY  (TKT_ID),
529 529
 					  KEY TKT_start_date (TKT_start_date)";
530
-        $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
531
-        $table_name = 'esp_question_group';
532
-        $sql = 'QSG_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
530
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
531
+		$table_name = 'esp_question_group';
532
+		$sql = 'QSG_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
533 533
 					QSG_name varchar(255) NOT NULL,
534 534
 					QSG_identifier varchar(100) NOT NULL,
535 535
 					QSG_desc text NULL,
@@ -542,38 +542,38 @@  discard block
 block discarded – undo
542 542
 					PRIMARY KEY  (QSG_ID),
543 543
 					UNIQUE KEY QSG_identifier_UNIQUE (QSG_identifier),
544 544
 					KEY QSG_order (QSG_order)';
545
-        $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
546
-        /** @var EE_DMS_Core_4_1_0 $script_4_1_defaults */
547
-        $script_4_1_defaults = EE_Registry::instance()->load_dms('Core_4_1_0');
548
-        // (because many need to convert old string states to foreign keys into the states table)
549
-        $script_4_1_defaults->insert_default_states();
550
-        $script_4_1_defaults->insert_default_countries();
551
-        /** @var EE_DMS_Core_4_5_0 $script_4_5_defaults */
552
-        $script_4_5_defaults = EE_Registry::instance()->load_dms('Core_4_5_0');
553
-        $script_4_5_defaults->insert_default_price_types();
554
-        $script_4_5_defaults->insert_default_prices();
555
-        $script_4_5_defaults->insert_default_tickets();
556
-        /** @var EE_DMS_Core_4_6_0 $script_4_6_defaults */
557
-        $script_4_6_defaults = EE_Registry::instance()->load_dms('Core_4_6_0');
558
-        $script_4_6_defaults->add_default_admin_only_payments();
559
-        $script_4_6_defaults->insert_default_currencies();
560
-        return true;
561
-    }
545
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
546
+		/** @var EE_DMS_Core_4_1_0 $script_4_1_defaults */
547
+		$script_4_1_defaults = EE_Registry::instance()->load_dms('Core_4_1_0');
548
+		// (because many need to convert old string states to foreign keys into the states table)
549
+		$script_4_1_defaults->insert_default_states();
550
+		$script_4_1_defaults->insert_default_countries();
551
+		/** @var EE_DMS_Core_4_5_0 $script_4_5_defaults */
552
+		$script_4_5_defaults = EE_Registry::instance()->load_dms('Core_4_5_0');
553
+		$script_4_5_defaults->insert_default_price_types();
554
+		$script_4_5_defaults->insert_default_prices();
555
+		$script_4_5_defaults->insert_default_tickets();
556
+		/** @var EE_DMS_Core_4_6_0 $script_4_6_defaults */
557
+		$script_4_6_defaults = EE_Registry::instance()->load_dms('Core_4_6_0');
558
+		$script_4_6_defaults->add_default_admin_only_payments();
559
+		$script_4_6_defaults->insert_default_currencies();
560
+		return true;
561
+	}
562 562
 
563 563
 
564 564
 
565
-    /**
566
-     * @return boolean
567
-     */
568
-    public function schema_changes_after_migration()
569
-    {
570
-        return true;
571
-    }
565
+	/**
566
+	 * @return boolean
567
+	 */
568
+	public function schema_changes_after_migration()
569
+	{
570
+		return true;
571
+	}
572 572
 
573 573
 
574 574
 
575
-    public function migration_page_hooks()
576
-    {
577
-    }
575
+	public function migration_page_hooks()
576
+	{
577
+	}
578 578
 }
579 579
 // end of file: /core/data_migration_scripts/EE_DMS_Core_4_7_0.dms.php
Please login to merge, or discard this patch.
caffeinated/modules/recaptcha_invisible/InvisibleRecaptcha.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -135,11 +135,11 @@  discard block
 block discarded – undo
135 135
         static $previous_recaptcha_response = array();
136 136
         $grecaptcha_response = $request->getRequestParam('g-recaptcha-response');
137 137
         // if this token has already been verified, then return previous response
138
-        if (isset($previous_recaptcha_response[ $grecaptcha_response ])) {
139
-            return $previous_recaptcha_response[ $grecaptcha_response ];
138
+        if (isset($previous_recaptcha_response[$grecaptcha_response])) {
139
+            return $previous_recaptcha_response[$grecaptcha_response];
140 140
         }
141 141
         // still here but no g-recaptcha-response ? - verification failed
142
-        if (! $grecaptcha_response) {
142
+        if ( ! $grecaptcha_response) {
143 143
             EE_Error::add_error(
144 144
                 sprintf(
145 145
                     /* translators: 1: missing parameter */
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
             return false;
159 159
         }
160 160
         // will update to true if everything passes
161
-        $previous_recaptcha_response[ $grecaptcha_response ] = false;
161
+        $previous_recaptcha_response[$grecaptcha_response] = false;
162 162
         $response                                            = wp_safe_remote_post(
163 163
             InvisibleRecaptcha::URL_GOOGLE_RECAPTCHA_API,
164 164
             array(
@@ -175,16 +175,16 @@  discard block
 block discarded – undo
175 175
         }
176 176
         $results = json_decode(wp_remote_retrieve_body($response), true);
177 177
         if (filter_var($results['success'], FILTER_VALIDATE_BOOLEAN) !== true) {
178
-            $errors   = array_map(
178
+            $errors = array_map(
179 179
                 array($this, 'getErrorCode'),
180 180
                 $results['error-codes']
181 181
             );
182 182
             if (isset($results['challenge_ts'])) {
183
-                $errors[] = 'challenge timestamp: ' . $results['challenge_ts'] . '.';
183
+                $errors[] = 'challenge timestamp: '.$results['challenge_ts'].'.';
184 184
             }
185 185
             $this->generateError(implode(' ', $errors), true);
186 186
         }
187
-        $previous_recaptcha_response[ $grecaptcha_response ] = true;
187
+        $previous_recaptcha_response[$grecaptcha_response] = true;
188 188
         add_action('shutdown', array($this, 'setSessionData'));
189 189
         return true;
190 190
     }
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
             'bad-request'            => 'The request is invalid or malformed.',
226 226
             'timeout-or-duplicate'   => 'The request took too long to be sent or was a duplicate of a previous request.',
227 227
         );
228
-        return isset($error_codes[ $error_code ]) ? $error_codes[ $error_code ] : '';
228
+        return isset($error_codes[$error_code]) ? $error_codes[$error_code] : '';
229 229
     }
230 230
 
231 231
 
Please login to merge, or discard this patch.
Indentation   +242 added lines, -242 removed lines patch added patch discarded remove patch
@@ -27,272 +27,272 @@
 block discarded – undo
27 27
 class InvisibleRecaptcha
28 28
 {
29 29
 
30
-    const URL_GOOGLE_RECAPTCHA_API          = 'https://www.google.com/recaptcha/api/siteverify';
30
+	const URL_GOOGLE_RECAPTCHA_API          = 'https://www.google.com/recaptcha/api/siteverify';
31 31
 
32
-    const SESSION_DATA_KEY_RECAPTCHA_PASSED = 'recaptcha_passed';
32
+	const SESSION_DATA_KEY_RECAPTCHA_PASSED = 'recaptcha_passed';
33 33
 
34
-    /**
35
-     * @var EE_Registration_Config $config
36
-     */
37
-    private $config;
34
+	/**
35
+	 * @var EE_Registration_Config $config
36
+	 */
37
+	private $config;
38 38
 
39
-    /**
40
-     * @var EE_Session $session
41
-     */
42
-    private $session;
39
+	/**
40
+	 * @var EE_Session $session
41
+	 */
42
+	private $session;
43 43
 
44
-    /**
45
-     * @var boolean $recaptcha_passed
46
-     */
47
-    private $recaptcha_passed;
44
+	/**
45
+	 * @var boolean $recaptcha_passed
46
+	 */
47
+	private $recaptcha_passed;
48 48
 
49 49
 
50
-    /**
51
-     * InvisibleRecaptcha constructor.
52
-     *
53
-     * @param EE_Registration_Config $registration_config
54
-     * @param EE_Session             $session
55
-     */
56
-    public function __construct(EE_Registration_Config $registration_config, EE_Session $session = null)
57
-    {
58
-        $this->config = $registration_config;
59
-        $this->session = $session;
60
-    }
50
+	/**
51
+	 * InvisibleRecaptcha constructor.
52
+	 *
53
+	 * @param EE_Registration_Config $registration_config
54
+	 * @param EE_Session             $session
55
+	 */
56
+	public function __construct(EE_Registration_Config $registration_config, EE_Session $session = null)
57
+	{
58
+		$this->config = $registration_config;
59
+		$this->session = $session;
60
+	}
61 61
 
62 62
 
63
-    /**
64
-     * @return boolean
65
-     */
66
-    public function useInvisibleRecaptcha()
67
-    {
68
-        return $this->session instanceof EE_Session
69
-               && $this->config->use_captcha
70
-               && $this->config->recaptcha_theme === 'invisible';
71
-    }
63
+	/**
64
+	 * @return boolean
65
+	 */
66
+	public function useInvisibleRecaptcha()
67
+	{
68
+		return $this->session instanceof EE_Session
69
+			   && $this->config->use_captcha
70
+			   && $this->config->recaptcha_theme === 'invisible';
71
+	}
72 72
 
73 73
 
74
-    /**
75
-     * @param array $input_settings
76
-     * @return EE_Invisible_Recaptcha_Input
77
-     * @throws InvalidDataTypeException
78
-     * @throws InvalidInterfaceException
79
-     * @throws InvalidArgumentException
80
-     * @throws DomainException
81
-     */
82
-    public function getInput(array $input_settings = array())
83
-    {
84
-        return new EE_Invisible_Recaptcha_Input(
85
-            $input_settings,
86
-            $this->config
87
-        );
88
-    }
74
+	/**
75
+	 * @param array $input_settings
76
+	 * @return EE_Invisible_Recaptcha_Input
77
+	 * @throws InvalidDataTypeException
78
+	 * @throws InvalidInterfaceException
79
+	 * @throws InvalidArgumentException
80
+	 * @throws DomainException
81
+	 */
82
+	public function getInput(array $input_settings = array())
83
+	{
84
+		return new EE_Invisible_Recaptcha_Input(
85
+			$input_settings,
86
+			$this->config
87
+		);
88
+	}
89 89
 
90 90
 
91
-    /**
92
-     * @param array $input_settings
93
-     * @return string
94
-     * @throws EE_Error
95
-     * @throws InvalidDataTypeException
96
-     * @throws InvalidInterfaceException
97
-     * @throws InvalidArgumentException
98
-     * @throws DomainException
99
-     */
100
-    public function getInputHtml(array $input_settings = array())
101
-    {
102
-        return $this->getInput($input_settings)->get_html_for_input();
103
-    }
91
+	/**
92
+	 * @param array $input_settings
93
+	 * @return string
94
+	 * @throws EE_Error
95
+	 * @throws InvalidDataTypeException
96
+	 * @throws InvalidInterfaceException
97
+	 * @throws InvalidArgumentException
98
+	 * @throws DomainException
99
+	 */
100
+	public function getInputHtml(array $input_settings = array())
101
+	{
102
+		return $this->getInput($input_settings)->get_html_for_input();
103
+	}
104 104
 
105 105
 
106
-    /**
107
-     * @param EE_Form_Section_Proper $form
108
-     * @param array                  $input_settings
109
-     * @throws EE_Error
110
-     * @throws InvalidArgumentException
111
-     * @throws InvalidDataTypeException
112
-     * @throws InvalidInterfaceException
113
-     * @throws DomainException
114
-     */
115
-    public function addToFormSection(EE_Form_Section_Proper $form, array $input_settings = array())
116
-    {
117
-        $form->add_subsections(
118
-            array(
119
-                'espresso_recaptcha' => $this->getInput($input_settings),
120
-            ),
121
-            null,
122
-            false
123
-        );
124
-    }
106
+	/**
107
+	 * @param EE_Form_Section_Proper $form
108
+	 * @param array                  $input_settings
109
+	 * @throws EE_Error
110
+	 * @throws InvalidArgumentException
111
+	 * @throws InvalidDataTypeException
112
+	 * @throws InvalidInterfaceException
113
+	 * @throws DomainException
114
+	 */
115
+	public function addToFormSection(EE_Form_Section_Proper $form, array $input_settings = array())
116
+	{
117
+		$form->add_subsections(
118
+			array(
119
+				'espresso_recaptcha' => $this->getInput($input_settings),
120
+			),
121
+			null,
122
+			false
123
+		);
124
+	}
125 125
 
126 126
 
127
-    /**
128
-     * @param RequestInterface $request
129
-     * @return boolean
130
-     * @throws InvalidArgumentException
131
-     * @throws InvalidDataTypeException
132
-     * @throws InvalidInterfaceException
133
-     * @throws RuntimeException
134
-     */
135
-    public function verifyToken(RequestInterface $request)
136
-    {
137
-        static $previous_recaptcha_response = array();
138
-        $grecaptcha_response = $request->getRequestParam('g-recaptcha-response');
139
-        // if this token has already been verified, then return previous response
140
-        if (isset($previous_recaptcha_response[ $grecaptcha_response ])) {
141
-            return $previous_recaptcha_response[ $grecaptcha_response ];
142
-        }
143
-        // still here but no g-recaptcha-response ? - verification failed
144
-        if (! $grecaptcha_response) {
145
-            EE_Error::add_error(
146
-                sprintf(
147
-                    /* translators: 1: missing parameter */
148
-                    esc_html__(
149
-                        // @codingStandardsIgnoreStart
150
-                        'We\'re sorry but an attempt to verify the form\'s reCAPTCHA has failed. Missing "%1$s". Please try again.',
151
-                        // @codingStandardsIgnoreEnd
152
-                        'event_espresso'
153
-                    ),
154
-                    'g-recaptcha-response'
155
-                ),
156
-                __FILE__,
157
-                __FUNCTION__,
158
-                __LINE__
159
-            );
160
-            return false;
161
-        }
162
-        // will update to true if everything passes
163
-        $previous_recaptcha_response[ $grecaptcha_response ] = false;
164
-        $response                                            = wp_safe_remote_post(
165
-            InvisibleRecaptcha::URL_GOOGLE_RECAPTCHA_API,
166
-            array(
167
-                'body' => array(
168
-                    'secret'   => $this->config->recaptcha_privatekey,
169
-                    'response' => $grecaptcha_response,
170
-                    'remoteip' => $request->ipAddress(),
171
-                ),
172
-            )
173
-        );
174
-        if ($response instanceof WP_Error) {
175
-            $this->generateError($response->get_error_messages());
176
-            return false;
177
-        }
178
-        $results = json_decode(wp_remote_retrieve_body($response), true);
179
-        if (filter_var($results['success'], FILTER_VALIDATE_BOOLEAN) !== true) {
180
-            $errors   = array_map(
181
-                array($this, 'getErrorCode'),
182
-                $results['error-codes']
183
-            );
184
-            if (isset($results['challenge_ts'])) {
185
-                $errors[] = 'challenge timestamp: ' . $results['challenge_ts'] . '.';
186
-            }
187
-            $this->generateError(implode(' ', $errors), true);
188
-        }
189
-        $previous_recaptcha_response[ $grecaptcha_response ] = true;
190
-        add_action('shutdown', array($this, 'setSessionData'));
191
-        return true;
192
-    }
127
+	/**
128
+	 * @param RequestInterface $request
129
+	 * @return boolean
130
+	 * @throws InvalidArgumentException
131
+	 * @throws InvalidDataTypeException
132
+	 * @throws InvalidInterfaceException
133
+	 * @throws RuntimeException
134
+	 */
135
+	public function verifyToken(RequestInterface $request)
136
+	{
137
+		static $previous_recaptcha_response = array();
138
+		$grecaptcha_response = $request->getRequestParam('g-recaptcha-response');
139
+		// if this token has already been verified, then return previous response
140
+		if (isset($previous_recaptcha_response[ $grecaptcha_response ])) {
141
+			return $previous_recaptcha_response[ $grecaptcha_response ];
142
+		}
143
+		// still here but no g-recaptcha-response ? - verification failed
144
+		if (! $grecaptcha_response) {
145
+			EE_Error::add_error(
146
+				sprintf(
147
+					/* translators: 1: missing parameter */
148
+					esc_html__(
149
+						// @codingStandardsIgnoreStart
150
+						'We\'re sorry but an attempt to verify the form\'s reCAPTCHA has failed. Missing "%1$s". Please try again.',
151
+						// @codingStandardsIgnoreEnd
152
+						'event_espresso'
153
+					),
154
+					'g-recaptcha-response'
155
+				),
156
+				__FILE__,
157
+				__FUNCTION__,
158
+				__LINE__
159
+			);
160
+			return false;
161
+		}
162
+		// will update to true if everything passes
163
+		$previous_recaptcha_response[ $grecaptcha_response ] = false;
164
+		$response                                            = wp_safe_remote_post(
165
+			InvisibleRecaptcha::URL_GOOGLE_RECAPTCHA_API,
166
+			array(
167
+				'body' => array(
168
+					'secret'   => $this->config->recaptcha_privatekey,
169
+					'response' => $grecaptcha_response,
170
+					'remoteip' => $request->ipAddress(),
171
+				),
172
+			)
173
+		);
174
+		if ($response instanceof WP_Error) {
175
+			$this->generateError($response->get_error_messages());
176
+			return false;
177
+		}
178
+		$results = json_decode(wp_remote_retrieve_body($response), true);
179
+		if (filter_var($results['success'], FILTER_VALIDATE_BOOLEAN) !== true) {
180
+			$errors   = array_map(
181
+				array($this, 'getErrorCode'),
182
+				$results['error-codes']
183
+			);
184
+			if (isset($results['challenge_ts'])) {
185
+				$errors[] = 'challenge timestamp: ' . $results['challenge_ts'] . '.';
186
+			}
187
+			$this->generateError(implode(' ', $errors), true);
188
+		}
189
+		$previous_recaptcha_response[ $grecaptcha_response ] = true;
190
+		add_action('shutdown', array($this, 'setSessionData'));
191
+		return true;
192
+	}
193 193
 
194 194
 
195
-    /**
196
-     * @param string $error_response
197
-     * @param bool   $show_errors
198
-     * @return void
199
-     * @throws RuntimeException
200
-     */
201
-    public function generateError($error_response = '', $show_errors = false)
202
-    {
203
-        throw new RuntimeException(
204
-            sprintf(
205
-                esc_html__(
206
-                    'We\'re sorry but an attempt to verify the form\'s reCAPTCHA has failed. %1$s %2$s Please try again.',
207
-                    'event_espresso'
208
-                ),
209
-                '<br />',
210
-                $show_errors || current_user_can('manage_options') ? $error_response : ''
211
-            )
212
-        );
213
-    }
195
+	/**
196
+	 * @param string $error_response
197
+	 * @param bool   $show_errors
198
+	 * @return void
199
+	 * @throws RuntimeException
200
+	 */
201
+	public function generateError($error_response = '', $show_errors = false)
202
+	{
203
+		throw new RuntimeException(
204
+			sprintf(
205
+				esc_html__(
206
+					'We\'re sorry but an attempt to verify the form\'s reCAPTCHA has failed. %1$s %2$s Please try again.',
207
+					'event_espresso'
208
+				),
209
+				'<br />',
210
+				$show_errors || current_user_can('manage_options') ? $error_response : ''
211
+			)
212
+		);
213
+	}
214 214
 
215 215
 
216
-    /**
217
-     * @param string $error_code
218
-     * @return string
219
-     */
220
-    public function getErrorCode(&$error_code)
221
-    {
222
-        $error_codes = array(
223
-            'missing-input-secret'   => 'The secret parameter is missing.',
224
-            'invalid-input-secret'   => 'The secret parameter is invalid or malformed.',
225
-            'missing-input-response' => 'The response parameter is missing.',
226
-            'invalid-input-response' => 'The response parameter is invalid or malformed.',
227
-            'bad-request'            => 'The request is invalid or malformed.',
228
-            'timeout-or-duplicate'   => 'The request took too long to be sent or was a duplicate of a previous request.',
229
-        );
230
-        return isset($error_codes[ $error_code ]) ? $error_codes[ $error_code ] : '';
231
-    }
216
+	/**
217
+	 * @param string $error_code
218
+	 * @return string
219
+	 */
220
+	public function getErrorCode(&$error_code)
221
+	{
222
+		$error_codes = array(
223
+			'missing-input-secret'   => 'The secret parameter is missing.',
224
+			'invalid-input-secret'   => 'The secret parameter is invalid or malformed.',
225
+			'missing-input-response' => 'The response parameter is missing.',
226
+			'invalid-input-response' => 'The response parameter is invalid or malformed.',
227
+			'bad-request'            => 'The request is invalid or malformed.',
228
+			'timeout-or-duplicate'   => 'The request took too long to be sent or was a duplicate of a previous request.',
229
+		);
230
+		return isset($error_codes[ $error_code ]) ? $error_codes[ $error_code ] : '';
231
+	}
232 232
 
233 233
 
234
-    /**
235
-     * @return array
236
-     * @throws InvalidInterfaceException
237
-     * @throws InvalidDataTypeException
238
-     * @throws InvalidArgumentException
239
-     */
240
-    public function getLocalizedVars()
241
-    {
242
-        return (array) apply_filters(
243
-            'FHEE__EventEspresso_caffeinated_modules_recaptcha_invisible_InvisibleRecaptcha__getLocalizedVars__localized_vars',
244
-            array(
245
-                'siteKey'          => $this->config->recaptcha_publickey,
246
-                'recaptcha_passed' => $this->recaptchaPassed(),
247
-                'wp_debug'         => WP_DEBUG,
248
-                'disable_submit'   => defined('EE_EVENT_QUEUE_BASE_URL'),
249
-                'failed_message'   => wp_strip_all_tags(
250
-                    __(
251
-                        'We\'re sorry but an attempt to verify the form\'s reCAPTCHA has failed. Please try again.',
252
-                        'event_espresso'
253
-                    )
254
-                )
255
-            )
256
-        );
257
-    }
234
+	/**
235
+	 * @return array
236
+	 * @throws InvalidInterfaceException
237
+	 * @throws InvalidDataTypeException
238
+	 * @throws InvalidArgumentException
239
+	 */
240
+	public function getLocalizedVars()
241
+	{
242
+		return (array) apply_filters(
243
+			'FHEE__EventEspresso_caffeinated_modules_recaptcha_invisible_InvisibleRecaptcha__getLocalizedVars__localized_vars',
244
+			array(
245
+				'siteKey'          => $this->config->recaptcha_publickey,
246
+				'recaptcha_passed' => $this->recaptchaPassed(),
247
+				'wp_debug'         => WP_DEBUG,
248
+				'disable_submit'   => defined('EE_EVENT_QUEUE_BASE_URL'),
249
+				'failed_message'   => wp_strip_all_tags(
250
+					__(
251
+						'We\'re sorry but an attempt to verify the form\'s reCAPTCHA has failed. Please try again.',
252
+						'event_espresso'
253
+					)
254
+				)
255
+			)
256
+		);
257
+	}
258 258
 
259 259
 
260
-    /**
261
-     * @return boolean
262
-     * @throws InvalidInterfaceException
263
-     * @throws InvalidDataTypeException
264
-     * @throws InvalidArgumentException
265
-     */
266
-    public function recaptchaPassed()
267
-    {
268
-        if ($this->recaptcha_passed !== null) {
269
-            return $this->recaptcha_passed;
270
-        }
271
-        // logged in means you have already passed a turing test of sorts
272
-        if ($this->useInvisibleRecaptcha() === false || is_user_logged_in()) {
273
-            $this->recaptcha_passed = true;
274
-            return $this->recaptcha_passed;
275
-        }
276
-        // was test already passed?
277
-        $this->recaptcha_passed = filter_var(
278
-            $this->session->get_session_data(
279
-                InvisibleRecaptcha::SESSION_DATA_KEY_RECAPTCHA_PASSED
280
-            ),
281
-            FILTER_VALIDATE_BOOLEAN
282
-        );
283
-        return $this->recaptcha_passed;
284
-    }
260
+	/**
261
+	 * @return boolean
262
+	 * @throws InvalidInterfaceException
263
+	 * @throws InvalidDataTypeException
264
+	 * @throws InvalidArgumentException
265
+	 */
266
+	public function recaptchaPassed()
267
+	{
268
+		if ($this->recaptcha_passed !== null) {
269
+			return $this->recaptcha_passed;
270
+		}
271
+		// logged in means you have already passed a turing test of sorts
272
+		if ($this->useInvisibleRecaptcha() === false || is_user_logged_in()) {
273
+			$this->recaptcha_passed = true;
274
+			return $this->recaptcha_passed;
275
+		}
276
+		// was test already passed?
277
+		$this->recaptcha_passed = filter_var(
278
+			$this->session->get_session_data(
279
+				InvisibleRecaptcha::SESSION_DATA_KEY_RECAPTCHA_PASSED
280
+			),
281
+			FILTER_VALIDATE_BOOLEAN
282
+		);
283
+		return $this->recaptcha_passed;
284
+	}
285 285
 
286 286
 
287
-    /**
288
-     * @throws InvalidArgumentException
289
-     * @throws InvalidDataTypeException
290
-     * @throws InvalidInterfaceException
291
-     */
292
-    public function setSessionData()
293
-    {
294
-        if ($this->session instanceof EE_Session) {
295
-            $this->session->set_session_data([InvisibleRecaptcha::SESSION_DATA_KEY_RECAPTCHA_PASSED => true]);
296
-        }
297
-    }
287
+	/**
288
+	 * @throws InvalidArgumentException
289
+	 * @throws InvalidDataTypeException
290
+	 * @throws InvalidInterfaceException
291
+	 */
292
+	public function setSessionData()
293
+	{
294
+		if ($this->session instanceof EE_Session) {
295
+			$this->session->set_session_data([InvisibleRecaptcha::SESSION_DATA_KEY_RECAPTCHA_PASSED => true]);
296
+		}
297
+	}
298 298
 }
Please login to merge, or discard this patch.
core/services/commands/CommandHandlerInterface.php 1 patch
Indentation   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -8,24 +8,24 @@
 block discarded – undo
8 8
  */
9 9
 interface CommandHandlerInterface
10 10
 {
11
-    /**
12
-     * verifies that the supplied command is the correct class for the handler.
13
-     *
14
-     * !!! IMPORTANT !!!
15
-     * Must return $this (ie: the handler itself)
16
-     * as the CommandBus utilizes method chaining
17
-     *
18
-     * @param CommandInterface $command
19
-     * @return CommandHandlerInterface
20
-     * @since 4.9.80.p
21
-     */
22
-    public function verify(CommandInterface $command);
11
+	/**
12
+	 * verifies that the supplied command is the correct class for the handler.
13
+	 *
14
+	 * !!! IMPORTANT !!!
15
+	 * Must return $this (ie: the handler itself)
16
+	 * as the CommandBus utilizes method chaining
17
+	 *
18
+	 * @param CommandInterface $command
19
+	 * @return CommandHandlerInterface
20
+	 * @since 4.9.80.p
21
+	 */
22
+	public function verify(CommandInterface $command);
23 23
 
24
-    /**
25
-     * Performs the command handler's logic.
26
-     *
27
-     * @param CommandInterface $command
28
-     * @return mixed
29
-     */
30
-    public function handle(CommandInterface $command);
24
+	/**
25
+	 * Performs the command handler's logic.
26
+	 *
27
+	 * @param CommandInterface $command
28
+	 * @return mixed
29
+	 */
30
+	public function handle(CommandInterface $command);
31 31
 }
Please login to merge, or discard this patch.
core/services/json/JsonSerializableAndUnserializable.php 1 patch
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -15,21 +15,21 @@
 block discarded – undo
15 15
  */
16 16
 interface JsonSerializableAndUnserializable
17 17
 {
18
-    /**
19
-     * Creates a simple PHP array or stdClass from this object's properties, which can be easily serialized using
20
-     * wp_json_serialize().
21
-     * @since 4.9.80.p
22
-     * @return mixed
23
-     */
24
-    public function toJsonSerializableData();
18
+	/**
19
+	 * Creates a simple PHP array or stdClass from this object's properties, which can be easily serialized using
20
+	 * wp_json_serialize().
21
+	 * @since 4.9.80.p
22
+	 * @return mixed
23
+	 */
24
+	public function toJsonSerializableData();
25 25
 
26
-    /**
27
-     * Initializes this object from data
28
-     * @since 4.9.80.p
29
-     * @param mixed $data
30
-     * @return boolean success
31
-     */
32
-    public function fromJsonSerializedData($data);
26
+	/**
27
+	 * Initializes this object from data
28
+	 * @since 4.9.80.p
29
+	 * @param mixed $data
30
+	 * @return boolean success
31
+	 */
32
+	public function fromJsonSerializedData($data);
33 33
 }
34 34
 // End of file JsonSerializableAndUnserializable.php
35 35
 // Location: EventEspresso\core\services\json/JsonSerializableAndUnserializable.php
Please login to merge, or discard this patch.
core/services/request/files/FileSubmissionInterface.php 1 patch
Indentation   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -15,37 +15,37 @@
 block discarded – undo
15 15
 interface FileSubmissionInterface
16 16
 {
17 17
 
18
-    /**
19
-     * @return string
20
-     */
21
-    public function getName();
22
-
23
-    /**
24
-     * @return string
25
-     */
26
-    public function getType();
27
-
28
-    /**
29
-     * @return int
30
-     */
31
-    public function getSize();
32
-
33
-    /**
34
-     * @return string
35
-     */
36
-    public function getTmpFile();
37
-
38
-    /**
39
-     * Should just return the filename.
40
-     * @since 4.9.80.p
41
-     * @return string
42
-     */
43
-    public function __toString();
44
-
45
-    /**
46
-     * @return string
47
-     */
48
-    public function getErrorCode();
18
+	/**
19
+	 * @return string
20
+	 */
21
+	public function getName();
22
+
23
+	/**
24
+	 * @return string
25
+	 */
26
+	public function getType();
27
+
28
+	/**
29
+	 * @return int
30
+	 */
31
+	public function getSize();
32
+
33
+	/**
34
+	 * @return string
35
+	 */
36
+	public function getTmpFile();
37
+
38
+	/**
39
+	 * Should just return the filename.
40
+	 * @since 4.9.80.p
41
+	 * @return string
42
+	 */
43
+	public function __toString();
44
+
45
+	/**
46
+	 * @return string
47
+	 */
48
+	public function getErrorCode();
49 49
 }
50 50
 // End of file FileSubmissionInterface.php
51 51
 // Location: EventEspresso\core\services\request\files/FileSubmissionInterface.php
Please login to merge, or discard this patch.
core/services/options/JsonWpOptionSerializableInterface.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -17,13 +17,13 @@
 block discarded – undo
17 17
  */
18 18
 interface JsonWpOptionSerializableInterface extends JsonSerializableAndUnserializable
19 19
 {
20
-    /**
21
-     * Gets the value to use for wp_options.option_name. Note this is not static, so it can use object properties to
22
-     * determine what option name to use.
23
-     * @since 4.9.80.p
24
-     * @return string
25
-     */
26
-    public function getWpOptionName();
20
+	/**
21
+	 * Gets the value to use for wp_options.option_name. Note this is not static, so it can use object properties to
22
+	 * determine what option name to use.
23
+	 * @since 4.9.80.p
24
+	 * @return string
25
+	 */
26
+	public function getWpOptionName();
27 27
 }
28 28
 // End of file JsonWpOptionSerializableInterface.php
29 29
 // Location: EventEspresso\core\services\options/JsonWpOptionSerializableInterface.php
Please login to merge, or discard this patch.
core/domain/Domain.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -63,8 +63,8 @@
 block discarded – undo
63 63
      */
64 64
     private function setCaffeinated()
65 65
     {
66
-        $this->caffeinated = (! defined('EE_DECAF') || EE_DECAF !== true)
67
-            && is_readable($this->pluginPath() . 'caffeinated/brewing_regular.php');
66
+        $this->caffeinated = ( ! defined('EE_DECAF') || EE_DECAF !== true)
67
+            && is_readable($this->pluginPath().'caffeinated/brewing_regular.php');
68 68
     }
69 69
 
70 70
 
Please login to merge, or discard this patch.
Indentation   +83 added lines, -83 removed lines patch added patch discarded remove patch
@@ -15,87 +15,87 @@
 block discarded – undo
15 15
  */
16 16
 class Domain extends DomainBase implements CaffeinatedInterface
17 17
 {
18
-    /**
19
-     * URL path component used to denote an API request
20
-     */
21
-    const API_NAMESPACE = 'ee/v';
22
-
23
-    const ASSET_NAMESPACE = 'eventespresso';
24
-
25
-    const TEXT_DOMAIN = 'event_espresso';
26
-
27
-    /**
28
-     * Slug used for the context where a registration status is changed from a manual trigger in the Registration Admin
29
-     * Page ui.
30
-     */
31
-    const CONTEXT_REGISTRATION_STATUS_CHANGE_REGISTRATION_ADMIN
32
-        = 'manual_registration_status_change_from_registration_admin';
33
-
34
-    const CONTEXT_REGISTRATION_STATUS_CHANGE_REGISTRATION_ADMIN_NOTIFY
35
-        = 'manual_registration_status_change_from_registration_admin_and_notify';
36
-
37
-
38
-    /**
39
-     * Whether or not EE core is the full premium version.
40
-     * @since 4.9.59.p
41
-     * @var bool
42
-     */
43
-    private $caffeinated;
44
-
45
-    /**
46
-     * @since $VID:$
47
-     * @var bool
48
-     */
49
-    private $multisite;
50
-
51
-
52
-    public function __construct(FilePath $plugin_file, Version $version)
53
-    {
54
-        parent::__construct($plugin_file, $version);
55
-        $this->setCaffeinated();
56
-        $this->multisite = is_multisite();
57
-    }
58
-
59
-    /**
60
-     * Whether or not EE core is the full premium version.
61
-     * @since 4.9.59.p
62
-     * @return bool
63
-     */
64
-    public function isCaffeinated()
65
-    {
66
-        return $this->caffeinated;
67
-    }
68
-
69
-
70
-    /**
71
-     * Setter for $is_caffeinated property.
72
-     * @since 4.9.59.p
73
-     */
74
-    private function setCaffeinated()
75
-    {
76
-        $this->caffeinated = (! defined('EE_DECAF') || EE_DECAF !== true)
77
-            && is_readable($this->pluginPath() . 'caffeinated/brewing_regular.php');
78
-    }
79
-
80
-
81
-    /**
82
-     * This should be used everywhere the Event Espresso brand name is referenced in public facing interfaces
83
-     * to allow for filtering the brand.
84
-     *
85
-     * @return string
86
-     */
87
-    public static function brandName()
88
-    {
89
-        return (string) apply_filters('FHEE__EventEspresso_core_domain_Domain__brandName', 'Event Espresso');
90
-    }
91
-
92
-
93
-    /**
94
-     * @return bool
95
-     * @since $VID:$
96
-     */
97
-    public function isMultiSite(): bool
98
-    {
99
-        return $this->multisite;
100
-    }
18
+	/**
19
+	 * URL path component used to denote an API request
20
+	 */
21
+	const API_NAMESPACE = 'ee/v';
22
+
23
+	const ASSET_NAMESPACE = 'eventespresso';
24
+
25
+	const TEXT_DOMAIN = 'event_espresso';
26
+
27
+	/**
28
+	 * Slug used for the context where a registration status is changed from a manual trigger in the Registration Admin
29
+	 * Page ui.
30
+	 */
31
+	const CONTEXT_REGISTRATION_STATUS_CHANGE_REGISTRATION_ADMIN
32
+		= 'manual_registration_status_change_from_registration_admin';
33
+
34
+	const CONTEXT_REGISTRATION_STATUS_CHANGE_REGISTRATION_ADMIN_NOTIFY
35
+		= 'manual_registration_status_change_from_registration_admin_and_notify';
36
+
37
+
38
+	/**
39
+	 * Whether or not EE core is the full premium version.
40
+	 * @since 4.9.59.p
41
+	 * @var bool
42
+	 */
43
+	private $caffeinated;
44
+
45
+	/**
46
+	 * @since $VID:$
47
+	 * @var bool
48
+	 */
49
+	private $multisite;
50
+
51
+
52
+	public function __construct(FilePath $plugin_file, Version $version)
53
+	{
54
+		parent::__construct($plugin_file, $version);
55
+		$this->setCaffeinated();
56
+		$this->multisite = is_multisite();
57
+	}
58
+
59
+	/**
60
+	 * Whether or not EE core is the full premium version.
61
+	 * @since 4.9.59.p
62
+	 * @return bool
63
+	 */
64
+	public function isCaffeinated()
65
+	{
66
+		return $this->caffeinated;
67
+	}
68
+
69
+
70
+	/**
71
+	 * Setter for $is_caffeinated property.
72
+	 * @since 4.9.59.p
73
+	 */
74
+	private function setCaffeinated()
75
+	{
76
+		$this->caffeinated = (! defined('EE_DECAF') || EE_DECAF !== true)
77
+			&& is_readable($this->pluginPath() . 'caffeinated/brewing_regular.php');
78
+	}
79
+
80
+
81
+	/**
82
+	 * This should be used everywhere the Event Espresso brand name is referenced in public facing interfaces
83
+	 * to allow for filtering the brand.
84
+	 *
85
+	 * @return string
86
+	 */
87
+	public static function brandName()
88
+	{
89
+		return (string) apply_filters('FHEE__EventEspresso_core_domain_Domain__brandName', 'Event Espresso');
90
+	}
91
+
92
+
93
+	/**
94
+	 * @return bool
95
+	 * @since $VID:$
96
+	 */
97
+	public function isMultiSite(): bool
98
+	{
99
+		return $this->multisite;
100
+	}
101 101
 }
Please login to merge, or discard this patch.
admin/new/pricing/help_tabs/pricing_add_new_price_type.help_tab.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -4,8 +4,8 @@
 block discarded – undo
4 4
 <p><strong><?php esc_html_e('Add New Price Type', 'event_espresso'); ?></strong></p>
5 5
 <p>
6 6
 <?php printf(
7
-    esc_html__('This page allows you to create a new price type for %s.', 'event_espresso'),
8
-    Domain::brandName()
7
+	esc_html__('This page allows you to create a new price type for %s.', 'event_espresso'),
8
+	Domain::brandName()
9 9
 ); ?>
10 10
 </p>
11 11
 <ul>
Please login to merge, or discard this patch.
admin/new/pricing/help_tabs/pricing_edit_default_price.help_tab.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -4,8 +4,8 @@
 block discarded – undo
4 4
 <p><strong><?php esc_html_e('Edit Default Price', 'event_espresso'); ?></strong></p>
5 5
 <p>
6 6
 <?php printf(
7
-    esc_html__('This page allows you to edit a default price for %s.', 'event_espresso'),
8
-    Domain::brandName()
7
+	esc_html__('This page allows you to edit a default price for %s.', 'event_espresso'),
8
+	Domain::brandName()
9 9
 ); ?>
10 10
 </p>
11 11
 <ul>
Please login to merge, or discard this patch.