Completed
Branch dev (9eae52)
by
unknown
17:17 queued 17:17
created
admin/new/pricing/templates/event_tickets_datetime_ticket_row.template.php 3 patches
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
                maxlength='245'
79 79
                name="<?php echo esc_attr($edit_tickets_name); ?>[<?php echo esc_attr($tkt_row); ?>][TKT_name]"
80 80
                placeholder="<?php
81
-               esc_html_e('Ticket Title', 'event_espresso') ?>"
81
+			   esc_html_e('Ticket Title', 'event_espresso') ?>"
82 82
                value="<?php echo esc_attr($TKT_name); ?>"
83 83
         />
84 84
     </td>
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
                                        for='edit-ticket-TKT_uses-<?php echo esc_attr($tkt_row); ?>'
325 325
                                 >
326 326
                                     <?php
327
-                                    esc_html_e('Ticket Uses', 'event_espresso') ?>
327
+									esc_html_e('Ticket Uses', 'event_espresso') ?>
328 328
                                 </label>
329 329
                                 <input type="text"
330 330
                                        class="edit-ticket-TKT_uses ee-small-text-inp ee-numeric"
@@ -343,7 +343,7 @@  discard block
 block discarded – undo
343 343
                                 />
344 344
                                 <label class='screen-reader-text' for='disabled-ticket-TKT_min-<?php echo esc_attr($tkt_row);?>'>
345 345
                                     <?php
346
-                                    esc_html_e('Minimum Quantity', 'event_espresso') ?>
346
+									esc_html_e('Minimum Quantity', 'event_espresso') ?>
347 347
                                 </label>
348 348
                                 <input type="text" disabled
349 349
                                        class="edit-ticket-TKT_min ee-small-text-inp ee-numeric"
@@ -408,14 +408,14 @@  discard block
 block discarded – undo
408 408
                                id="edit-ticket-TKT_required-<?php echo esc_attr($tkt_row); ?>"
409 409
                                value="1"
410 410
                             <?php
411
-                                echo $TKT_required ? ' checked="checked"' : '';
412
-                                echo $disabled ? ' disabled' : '';
413
-                            ?>
411
+								echo $TKT_required ? ' checked="checked"' : '';
412
+								echo $disabled ? ' disabled' : '';
413
+							?>
414 414
                         />
415 415
                         <?php esc_html_e(
416
-                            'This ticket is required (will appear first in frontend ticket lists).',
417
-                            'event_espresso'
418
-                        ); ?>
416
+							'This ticket is required (will appear first in frontend ticket lists).',
417
+							'event_espresso'
418
+						); ?>
419 419
                     </label>
420 420
                 </div>
421 421
                 <div class="ticket-is-taxable-container">
@@ -517,32 +517,32 @@  discard block
 block discarded – undo
517 517
             <h4 class="tickets-heading"><?php esc_html_e('Event Datetimes', 'event_espresso'); ?></h4>
518 518
             <p>
519 519
             <?php  esc_html_e(
520
-                'This ticket will be usable (allow entrance) for the following selected event datetimes (click to select).  The "# Datetimes" amount (above) indicates how many of the assigned datetimes the ticket holder can gain access to:',
521
-                'event_espresso'
522
-            ); ?>
520
+				'This ticket will be usable (allow entrance) for the following selected event datetimes (click to select).  The "# Datetimes" amount (above) indicates how many of the assigned datetimes the ticket holder can gain access to:',
521
+				'event_espresso'
522
+			); ?>
523 523
             </p>
524 524
             <ul class="datetime-tickets-list">
525 525
                 <?php echo $ticket_datetimes_list; ?>
526 526
             </ul>
527 527
 
528 528
             <?php do_action(
529
-                'AHEE__event_tickets_datetime_ticket_row_template__advanced_details_end',
530
-                $tkt_row,
531
-                $TKT_ID
532
-            ); ?>
529
+				'AHEE__event_tickets_datetime_ticket_row_template__advanced_details_end',
530
+				$tkt_row,
531
+				$TKT_ID
532
+			); ?>
533 533
             <div class="ee-editor-footer-container">
534 534
                 <div class="ee-editor-id-container">
535 535
                     <span class="ee-item-id"><?php
536
-                        echo $TKT_ID
537
-                            ? sprintf(esc_html__('Ticket ID: %d', 'event_espresso'), $TKT_ID)
538
-                            : ''; ?></span>
536
+						echo $TKT_ID
537
+							? sprintf(esc_html__('Ticket ID: %d', 'event_espresso'), $TKT_ID)
538
+							: ''; ?></span>
539 539
                 </div>
540 540
                 <div class="save-cancel-button-container">
541 541
                     <label for="edit-ticket-TKT_is_default_selector-<?php echo esc_attr($tkt_row); ?>">
542 542
                         <?php esc_html_e(
543
-                            'use this new ticket as a default ticket for any new events',
544
-                            'event_espresso'
545
-                        ); ?>
543
+							'use this new ticket as a default ticket for any new events',
544
+							'event_espresso'
545
+						); ?>
546 546
                         <input type="checkbox"
547 547
                                name="<?php echo esc_attr($edit_tickets_name); ?>[<?php echo esc_attr($tkt_row); ?>][TKT_is_default_selector]"
548 548
                                class="edit-ticket-TKT_is_default_selector"
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
  */
57 57
 $ticket_archive_class .= WP_DEBUG ? ' ee-wp-debug' : '';
58 58
 ?>
59
-<tr class="ee-ticket-sortable ticket-row <?php echo sanitize_html_class($ticket_archive_class);?>"
59
+<tr class="ee-ticket-sortable ticket-row <?php echo sanitize_html_class($ticket_archive_class); ?>"
60 60
     id="display-ticketrow-<?php echo esc_attr($tkt_row); ?>">
61 61
     <!-- TKT_order -->
62 62
     <td class="ee-tkt-order-field">
@@ -341,23 +341,23 @@  discard block
 block discarded – undo
341 341
                                        name="<?php echo esc_attr($edit_tickets_name); ?>[<?php echo esc_attr($tkt_row); ?>][TKT_min]"
342 342
                                        value="<?php echo esc_attr($TKT_min); ?>"
343 343
                                 />
344
-                                <label class='screen-reader-text' for='disabled-ticket-TKT_min-<?php echo esc_attr($tkt_row);?>'>
344
+                                <label class='screen-reader-text' for='disabled-ticket-TKT_min-<?php echo esc_attr($tkt_row); ?>'>
345 345
                                     <?php
346 346
                                     esc_html_e('Minimum Quantity', 'event_espresso') ?>
347 347
                                 </label>
348 348
                                 <input type="text" disabled
349 349
                                        class="edit-ticket-TKT_min ee-small-text-inp ee-numeric"
350
-                                       id='disabled-ticket-TKT_min-<?php echo esc_attr($tkt_row);?>'
350
+                                       id='disabled-ticket-TKT_min-<?php echo esc_attr($tkt_row); ?>'
351 351
                                        name="archived_ticket[<?php echo esc_attr($tkt_row); ?>][TKT_min]"
352 352
                                        value="<?php echo esc_attr($TKT_min); ?>"
353 353
                                 />
354 354
                             <?php else : ?>
355
-                                <label class='screen-reader-text' for='edit-ticket-TKT_min-<?php echo esc_attr($tkt_row);?>'>
355
+                                <label class='screen-reader-text' for='edit-ticket-TKT_min-<?php echo esc_attr($tkt_row); ?>'>
356 356
                                     <?php esc_html_e('Minimum Quantity', 'event_espresso') ?>
357 357
                                 </label>
358 358
                                 <input type="text"
359 359
                                        class="edit-ticket-TKT_min ee-small-text-inp ee-numeric"
360
-                                       id='edit-ticket-TKT_min-<?php echo esc_attr($tkt_row);?>'
360
+                                       id='edit-ticket-TKT_min-<?php echo esc_attr($tkt_row); ?>'
361 361
                                        name="<?php echo esc_attr($edit_tickets_name); ?>[<?php echo esc_attr($tkt_row); ?>][TKT_min]"
362 362
                                        value="<?php echo esc_attr($TKT_min); ?>"
363 363
                                 />
@@ -369,22 +369,22 @@  discard block
 block discarded – undo
369 369
                                        name="<?php echo esc_attr($edit_tickets_name); ?>[<?php echo esc_attr($tkt_row); ?>][TKT_max]"
370 370
                                        value="<?php echo esc_attr($TKT_max); ?>"
371 371
                                 />
372
-                                <label class='screen-reader-text' for='disabled-ticket-TKT_max-<?php echo esc_attr($tkt_row);?>'>
372
+                                <label class='screen-reader-text' for='disabled-ticket-TKT_max-<?php echo esc_attr($tkt_row); ?>'>
373 373
                                     <?php esc_html_e('Maximum Quantity', 'event_espresso') ?>
374 374
                                 </label>
375 375
                                 <input type="text" disabled
376 376
                                        class="edit-ticket-TKT_max ee-small-text-inp ee-numeric"
377
-                                       id='disabled-ticket-TKT_max-<?php echo esc_attr($tkt_row);?>'
377
+                                       id='disabled-ticket-TKT_max-<?php echo esc_attr($tkt_row); ?>'
378 378
                                        name="<?php echo esc_attr($edit_tickets_name); ?>[<?php echo esc_attr($tkt_row); ?>][TKT_max]"
379 379
                                        value="<?php echo esc_attr($TKT_max); ?>"
380 380
                                 />
381 381
                             <?php else : ?>
382
-                                <label class='screen-reader-text' for='edit-ticket-TKT_max-<?php echo esc_attr($tkt_row);?>'>
382
+                                <label class='screen-reader-text' for='edit-ticket-TKT_max-<?php echo esc_attr($tkt_row); ?>'>
383 383
                                     <?php esc_html_e('Maximum Quantity', 'event_espresso') ?>
384 384
                                 </label>
385 385
                                 <input type="text"
386 386
                                        class="edit-ticket-TKT_max ee-small-text-inp ee-numeric"
387
-                                       id='edit-ticket-TKT_max-<?php echo esc_attr($tkt_row);?>'
387
+                                       id='edit-ticket-TKT_max-<?php echo esc_attr($tkt_row); ?>'
388 388
                                        name="<?php echo esc_attr($edit_tickets_name); ?>[<?php echo esc_attr($tkt_row); ?>][TKT_max]"
389 389
                                        value="<?php echo esc_attr($TKT_max); ?>"
390 390
                                 />
@@ -419,7 +419,7 @@  discard block
 block discarded – undo
419 419
                     </label>
420 420
                 </div>
421 421
                 <div class="ticket-is-taxable-container">
422
-                    <?php if (! empty($tax_rows)) { ?>
422
+                    <?php if ( ! empty($tax_rows)) { ?>
423 423
                         <label for="edit-ticket-TKT_taxable-<?php echo esc_attr($tkt_row); ?>">
424 424
                         <?php if ($disabled) : ?>
425 425
                             <?php $tax_value = ! empty($TKT_taxable) ? 1 : 0; ?>
Please login to merge, or discard this patch.
Braces   +40 added lines, -16 removed lines patch added patch discarded remove patch
@@ -100,8 +100,11 @@  discard block
 block discarded – undo
100 100
                    name="archived_ticket[TKT_start_date]"
101 101
                    value="<?php echo esc_attr($TKT_start_date); ?>"
102 102
             />
103
-        <?php else : ?>
104
-            <label class='screen-reader-text' for="edit-ticket-TKT_start_date-<?php echo esc_attr($tkt_row); ?>">
103
+        <?php else {
104
+	: ?>
105
+            <label class='screen-reader-text' for="edit-ticket-TKT_start_date-<?php echo esc_attr($tkt_row);
106
+}
107
+?>">
105 108
                 <?php esc_html_e('Sale Starts', 'event_espresso') ?>
106 109
             </label>
107 110
             <input type='text'
@@ -134,8 +137,11 @@  discard block
 block discarded – undo
134 137
                    name="archived_ticket[<?php echo esc_attr($tkt_row); ?>][TKT_end_date]"
135 138
                    value="<?php echo esc_attr($TKT_end_date); ?>"
136 139
             />
137
-        <?php else : ?>
138
-            <label class='screen-reader-text' for='edit-ticket-TKT_end_date-<?php echo esc_attr($tkt_row); ?>'>
140
+        <?php else {
141
+	: ?>
142
+            <label class='screen-reader-text' for='edit-ticket-TKT_end_date-<?php echo esc_attr($tkt_row);
143
+}
144
+?>'>
139 145
                 <?php esc_html_e('Sell Until', 'event_espresso') ?>
140 146
             </label>
141 147
             <input type='text'
@@ -167,8 +173,11 @@  discard block
 block discarded – undo
167 173
                    name="archived_ticket[<?php echo esc_attr($tkt_row); ?>][TKT_base_price]"
168 174
                    value="<?php echo esc_attr($TKT_base_price); ?>"
169 175
             />
170
-        <?php else : ?>
171
-            <label class='screen-reader-text' for='edit-ticket-TKT_base_price-<?php echo esc_attr($tkt_row); ?>'>
176
+        <?php else {
177
+	: ?>
178
+            <label class='screen-reader-text' for='edit-ticket-TKT_base_price-<?php echo esc_attr($tkt_row);
179
+}
180
+?>'>
172 181
                 <?php esc_html_e('Price', 'event_espresso') ?>
173 182
             </label>
174 183
             <input id="edit-ticket-TKT_base_price-<?php echo esc_attr($tkt_row); ?>" type="text"
@@ -198,8 +207,11 @@  discard block
 block discarded – undo
198 207
                    name="archived_ticket[<?php echo esc_attr($tkt_row); ?>][TKT_qty]"
199 208
                    value="<?php echo esc_attr($TKT_qty_for_input); ?>"
200 209
             />
201
-        <?php else : ?>
202
-            <label class='screen-reader-text' for='edit-ticket-TKT_qty-<?php echo esc_attr($tkt_row); ?>'>
210
+        <?php else {
211
+	: ?>
212
+            <label class='screen-reader-text' for='edit-ticket-TKT_qty-<?php echo esc_attr($tkt_row);
213
+}
214
+?>'>
203 215
                 <?php esc_html_e('Qty', 'event_espresso') ?>
204 216
             </label>
205 217
             <input type="text"
@@ -319,9 +331,12 @@  discard block
 block discarded – undo
319 331
                                        name="archived_ticket[<?php echo esc_attr($tkt_row); ?>][TKT_uses]"
320 332
                                        value="<?php echo esc_attr($TKT_uses); ?>"
321 333
                                 />
322
-                            <?php else : ?>
334
+                            <?php else {
335
+	: ?>
323 336
                                 <label class='screen-reader-text'
324
-                                       for='edit-ticket-TKT_uses-<?php echo esc_attr($tkt_row); ?>'
337
+                                       for='edit-ticket-TKT_uses-<?php echo esc_attr($tkt_row);
338
+}
339
+?>'
325 340
                                 >
326 341
                                     <?php
327 342
                                     esc_html_e('Ticket Uses', 'event_espresso') ?>
@@ -351,8 +366,11 @@  discard block
 block discarded – undo
351 366
                                        name="archived_ticket[<?php echo esc_attr($tkt_row); ?>][TKT_min]"
352 367
                                        value="<?php echo esc_attr($TKT_min); ?>"
353 368
                                 />
354
-                            <?php else : ?>
355
-                                <label class='screen-reader-text' for='edit-ticket-TKT_min-<?php echo esc_attr($tkt_row);?>'>
369
+                            <?php else {
370
+	: ?>
371
+                                <label class='screen-reader-text' for='edit-ticket-TKT_min-<?php echo esc_attr($tkt_row);
372
+}
373
+?>'>
356 374
                                     <?php esc_html_e('Minimum Quantity', 'event_espresso') ?>
357 375
                                 </label>
358 376
                                 <input type="text"
@@ -378,8 +396,11 @@  discard block
 block discarded – undo
378 396
                                        name="<?php echo esc_attr($edit_tickets_name); ?>[<?php echo esc_attr($tkt_row); ?>][TKT_max]"
379 397
                                        value="<?php echo esc_attr($TKT_max); ?>"
380 398
                                 />
381
-                            <?php else : ?>
382
-                                <label class='screen-reader-text' for='edit-ticket-TKT_max-<?php echo esc_attr($tkt_row);?>'>
399
+                            <?php else {
400
+	: ?>
401
+                                <label class='screen-reader-text' for='edit-ticket-TKT_max-<?php echo esc_attr($tkt_row);
402
+}
403
+?>'>
383 404
                                     <?php esc_html_e('Maximum Quantity', 'event_espresso') ?>
384 405
                                 </label>
385 406
                                 <input type="text"
@@ -434,10 +455,13 @@  discard block
 block discarded – undo
434 455
                                name="archived_ticket[<?php echo esc_attr($tkt_row); ?>][TKT_taxable]"
435 456
                                value="1"<?php echo $TKT_taxable; ?>
436 457
                         />
437
-                        <?php else : ?>
458
+                        <?php else {
459
+	: ?>
438 460
                         <input type='checkbox'
439 461
                                class="TKT-taxable-checkbox"
440
-                               id="edit-ticket-TKT_taxable-<?php echo esc_attr($tkt_row); ?>"
462
+                               id="edit-ticket-TKT_taxable-<?php echo esc_attr($tkt_row);
463
+}
464
+?>"
441 465
                                name="<?php echo esc_attr($edit_tickets_name); ?>[<?php echo esc_attr($tkt_row); ?>][TKT_taxable]"
442 466
                                value="1"
443 467
                                <?php echo $TKT_taxable; ?>
Please login to merge, or discard this patch.
caffeinated/admin/new/pricing/espresso_events_Pricing_Hooks.class.php 2 patches
Indentation   +2140 added lines, -2140 removed lines patch added patch discarded remove patch
@@ -14,2202 +14,2202 @@
 block discarded – undo
14 14
  */
15 15
 class espresso_events_Pricing_Hooks extends EE_Admin_Hooks
16 16
 {
17
-    /**
18
-     * This property is just used to hold the status of whether an event is currently being
19
-     * created (true) or edited (false)
20
-     *
21
-     * @access protected
22
-     * @var bool
23
-     */
24
-    protected $_is_creating_event;
17
+	/**
18
+	 * This property is just used to hold the status of whether an event is currently being
19
+	 * created (true) or edited (false)
20
+	 *
21
+	 * @access protected
22
+	 * @var bool
23
+	 */
24
+	protected $_is_creating_event;
25 25
 
26
-    /**
27
-     * Used to contain the format strings for date and time that will be used for php date and
28
-     * time.
29
-     * Is set in the _set_hooks_properties() method.
30
-     *
31
-     * @var array
32
-     */
33
-    protected $_date_format_strings;
26
+	/**
27
+	 * Used to contain the format strings for date and time that will be used for php date and
28
+	 * time.
29
+	 * Is set in the _set_hooks_properties() method.
30
+	 *
31
+	 * @var array
32
+	 */
33
+	protected $_date_format_strings;
34 34
 
35
-    /**
36
-     * @var string $_date_time_format
37
-     */
38
-    protected $_date_time_format;
35
+	/**
36
+	 * @var string $_date_time_format
37
+	 */
38
+	protected $_date_time_format;
39 39
 
40 40
 
41
-    /**
42
-     * @throws InvalidArgumentException
43
-     * @throws InvalidInterfaceException
44
-     * @throws InvalidDataTypeException
45
-     */
46
-    protected function _set_hooks_properties()
47
-    {
48
-        $this->_name = 'pricing';
49
-        // capability check
50
-        if (
51
-            $this->_adminpage_obj->adminConfig()->useAdvancedEditor()
52
-            || ! EE_Registry::instance()->CAP->current_user_can(
53
-                'ee_read_default_prices',
54
-                'advanced_ticket_datetime_metabox'
55
-            )
56
-        ) {
57
-            $this->_metaboxes      = [];
58
-            $this->_scripts_styles = [];
59
-            return;
60
-        }
61
-        $this->_setup_metaboxes();
62
-        $this->_set_date_time_formats();
63
-        $this->_validate_format_strings();
64
-        $this->_set_scripts_styles();
65
-        // commented out temporarily until logic is implemented in callback
66
-        // add_action(
67
-        //     'AHEE__EE_Admin_Page_CPT__do_extra_autosave_stuff__after_Extend_Events_Admin_Page',
68
-        //     array($this, 'autosave_handling')
69
-        // );
70
-        add_filter(
71
-            'FHEE__Events_Admin_Page___insert_update_cpt_item__event_update_callbacks',
72
-            array($this, 'caf_updates')
73
-        );
74
-    }
41
+	/**
42
+	 * @throws InvalidArgumentException
43
+	 * @throws InvalidInterfaceException
44
+	 * @throws InvalidDataTypeException
45
+	 */
46
+	protected function _set_hooks_properties()
47
+	{
48
+		$this->_name = 'pricing';
49
+		// capability check
50
+		if (
51
+			$this->_adminpage_obj->adminConfig()->useAdvancedEditor()
52
+			|| ! EE_Registry::instance()->CAP->current_user_can(
53
+				'ee_read_default_prices',
54
+				'advanced_ticket_datetime_metabox'
55
+			)
56
+		) {
57
+			$this->_metaboxes      = [];
58
+			$this->_scripts_styles = [];
59
+			return;
60
+		}
61
+		$this->_setup_metaboxes();
62
+		$this->_set_date_time_formats();
63
+		$this->_validate_format_strings();
64
+		$this->_set_scripts_styles();
65
+		// commented out temporarily until logic is implemented in callback
66
+		// add_action(
67
+		//     'AHEE__EE_Admin_Page_CPT__do_extra_autosave_stuff__after_Extend_Events_Admin_Page',
68
+		//     array($this, 'autosave_handling')
69
+		// );
70
+		add_filter(
71
+			'FHEE__Events_Admin_Page___insert_update_cpt_item__event_update_callbacks',
72
+			array($this, 'caf_updates')
73
+		);
74
+	}
75 75
 
76 76
 
77
-    /**
78
-     * @return void
79
-     */
80
-    protected function _setup_metaboxes()
81
-    {
82
-        // if we were going to add our own metaboxes we'd use the below.
83
-        $this->_metaboxes = array(
84
-            0 => array(
85
-                'page_route' => array('edit', 'create_new'),
86
-                'func'       => 'pricing_metabox',
87
-                'label'      => esc_html__('Event Tickets & Datetimes', 'event_espresso'),
88
-                'priority'   => 'high',
89
-                'context'    => 'normal',
90
-            ),
91
-        );
92
-        $this->_remove_metaboxes = array(
93
-            0 => array(
94
-                'page_route' => array('edit', 'create_new'),
95
-                'id'         => 'espresso_event_editor_tickets',
96
-                'context'    => 'normal',
97
-            ),
98
-        );
99
-    }
77
+	/**
78
+	 * @return void
79
+	 */
80
+	protected function _setup_metaboxes()
81
+	{
82
+		// if we were going to add our own metaboxes we'd use the below.
83
+		$this->_metaboxes = array(
84
+			0 => array(
85
+				'page_route' => array('edit', 'create_new'),
86
+				'func'       => 'pricing_metabox',
87
+				'label'      => esc_html__('Event Tickets & Datetimes', 'event_espresso'),
88
+				'priority'   => 'high',
89
+				'context'    => 'normal',
90
+			),
91
+		);
92
+		$this->_remove_metaboxes = array(
93
+			0 => array(
94
+				'page_route' => array('edit', 'create_new'),
95
+				'id'         => 'espresso_event_editor_tickets',
96
+				'context'    => 'normal',
97
+			),
98
+		);
99
+	}
100 100
 
101 101
 
102
-    /**
103
-     * @return void
104
-     */
105
-    protected function _set_date_time_formats()
106
-    {
107
-        /**
108
-         * Format strings for date and time.  Defaults are existing behaviour from 4.1.
109
-         * Note, that if you return null as the value for 'date', and 'time' in the array, then
110
-         * EE will automatically use the set wp_options, 'date_format', and 'time_format'.
111
-         *
112
-         * @since 4.6.7
113
-         * @var array  Expected an array returned with 'date' and 'time' keys.
114
-         */
115
-        $this->_date_format_strings = apply_filters(
116
-            'FHEE__espresso_events_Pricing_Hooks___set_hooks_properties__date_format_strings',
117
-            array(
118
-                'date' => 'Y-m-d',
119
-                'time' => 'h:i a',
120
-            )
121
-        );
122
-        // validate
123
-        $this->_date_format_strings['date'] = isset($this->_date_format_strings['date'])
124
-            ? $this->_date_format_strings['date']
125
-            : null;
126
-        $this->_date_format_strings['time'] = isset($this->_date_format_strings['time'])
127
-            ? $this->_date_format_strings['time']
128
-            : null;
129
-        $this->_date_time_format = $this->_date_format_strings['date']
130
-                                   . ' '
131
-                                   . $this->_date_format_strings['time'];
132
-    }
102
+	/**
103
+	 * @return void
104
+	 */
105
+	protected function _set_date_time_formats()
106
+	{
107
+		/**
108
+		 * Format strings for date and time.  Defaults are existing behaviour from 4.1.
109
+		 * Note, that if you return null as the value for 'date', and 'time' in the array, then
110
+		 * EE will automatically use the set wp_options, 'date_format', and 'time_format'.
111
+		 *
112
+		 * @since 4.6.7
113
+		 * @var array  Expected an array returned with 'date' and 'time' keys.
114
+		 */
115
+		$this->_date_format_strings = apply_filters(
116
+			'FHEE__espresso_events_Pricing_Hooks___set_hooks_properties__date_format_strings',
117
+			array(
118
+				'date' => 'Y-m-d',
119
+				'time' => 'h:i a',
120
+			)
121
+		);
122
+		// validate
123
+		$this->_date_format_strings['date'] = isset($this->_date_format_strings['date'])
124
+			? $this->_date_format_strings['date']
125
+			: null;
126
+		$this->_date_format_strings['time'] = isset($this->_date_format_strings['time'])
127
+			? $this->_date_format_strings['time']
128
+			: null;
129
+		$this->_date_time_format = $this->_date_format_strings['date']
130
+								   . ' '
131
+								   . $this->_date_format_strings['time'];
132
+	}
133 133
 
134 134
 
135
-    /**
136
-     * @return void
137
-     */
138
-    protected function _validate_format_strings()
139
-    {
140
-        // validate format strings
141
-        $format_validation = EEH_DTT_Helper::validate_format_string(
142
-            $this->_date_time_format
143
-        );
144
-        if (is_array($format_validation)) {
145
-            $msg = '<p>';
146
-            $msg .= sprintf(
147
-                esc_html__(
148
-                    'The format "%s" was likely added via a filter and is invalid for the following reasons:',
149
-                    'event_espresso'
150
-                ),
151
-                $this->_date_time_format
152
-            );
153
-            $msg .= '</p><ul>';
154
-            foreach ($format_validation as $error) {
155
-                $msg .= '<li>' . $error . '</li>';
156
-            }
157
-            $msg .= '</ul><p>';
158
-            $msg .= sprintf(
159
-                esc_html__(
160
-                    '%sPlease note that your date and time formats have been reset to "Y-m-d" and "h:i a" respectively.%s',
161
-                    'event_espresso'
162
-                ),
163
-                '<span style="color:#D54E21;">',
164
-                '</span>'
165
-            );
166
-            $msg .= '</p>';
167
-            EE_Error::add_attention($msg, __FILE__, __FUNCTION__, __LINE__);
168
-            $this->_date_format_strings = array(
169
-                'date' => 'Y-m-d',
170
-                'time' => 'h:i a',
171
-            );
172
-        }
173
-    }
135
+	/**
136
+	 * @return void
137
+	 */
138
+	protected function _validate_format_strings()
139
+	{
140
+		// validate format strings
141
+		$format_validation = EEH_DTT_Helper::validate_format_string(
142
+			$this->_date_time_format
143
+		);
144
+		if (is_array($format_validation)) {
145
+			$msg = '<p>';
146
+			$msg .= sprintf(
147
+				esc_html__(
148
+					'The format "%s" was likely added via a filter and is invalid for the following reasons:',
149
+					'event_espresso'
150
+				),
151
+				$this->_date_time_format
152
+			);
153
+			$msg .= '</p><ul>';
154
+			foreach ($format_validation as $error) {
155
+				$msg .= '<li>' . $error . '</li>';
156
+			}
157
+			$msg .= '</ul><p>';
158
+			$msg .= sprintf(
159
+				esc_html__(
160
+					'%sPlease note that your date and time formats have been reset to "Y-m-d" and "h:i a" respectively.%s',
161
+					'event_espresso'
162
+				),
163
+				'<span style="color:#D54E21;">',
164
+				'</span>'
165
+			);
166
+			$msg .= '</p>';
167
+			EE_Error::add_attention($msg, __FILE__, __FUNCTION__, __LINE__);
168
+			$this->_date_format_strings = array(
169
+				'date' => 'Y-m-d',
170
+				'time' => 'h:i a',
171
+			);
172
+		}
173
+	}
174 174
 
175 175
 
176
-    /**
177
-     * @return void
178
-     */
179
-    protected function _set_scripts_styles()
180
-    {
181
-        $this->_scripts_styles = array(
182
-            'registers'   => array(
183
-                'ee-tickets-datetimes-css' => array(
184
-                    'url'  => PRICING_ASSETS_URL . 'event-tickets-datetimes.css',
185
-                    'type' => 'css',
186
-                ),
187
-                'ee-dtt-ticket-metabox'    => array(
188
-                    'url'     => PRICING_ASSETS_URL . 'ee-datetime-ticket-metabox.js',
189
-                    'depends' => array('ee-datepicker', 'ee-dialog', 'underscore'),
190
-                ),
191
-            ),
192
-            'deregisters' => array(
193
-                'event-editor-css'       => array('type' => 'css'),
194
-                'event-datetime-metabox' => array('type' => 'js'),
195
-            ),
196
-            'enqueues'    => array(
197
-                'ee-tickets-datetimes-css' => array('edit', 'create_new'),
198
-                'ee-dtt-ticket-metabox'    => array('edit', 'create_new'),
199
-            ),
200
-            'localize'    => array(
201
-                'ee-dtt-ticket-metabox' => array(
202
-                    'DTT_TRASH_BLOCK'       => array(
203
-                        'main_warning'            => esc_html__(
204
-                            'The Datetime you are attempting to trash is the only datetime selected for the following ticket(s):',
205
-                            'event_espresso'
206
-                        ),
207
-                        'after_warning'           => esc_html__(
208
-                            'In order to trash this datetime you must first make sure the above ticket(s) are assigned to other datetimes.',
209
-                            'event_espresso'
210
-                        ),
211
-                        'cancel_button'           => '<button class="button--secondary ee-modal-cancel">'
212
-                                                     . esc_html__('Cancel', 'event_espresso') . '</button>',
213
-                        'close_button'            => '<button class="button--secondary ee-modal-cancel">'
214
-                                                     . esc_html__('Close', 'event_espresso') . '</button>',
215
-                        'single_warning_from_tkt' => esc_html__(
216
-                            'The Datetime you are attempting to unassign from this ticket is the only remaining datetime for this ticket. Tickets must always have at least one datetime assigned to them.',
217
-                            'event_espresso'
218
-                        ),
219
-                        'single_warning_from_dtt' => esc_html__(
220
-                            'The ticket you are attempting to unassign from this datetime cannot be unassigned because the datetime is the only remaining datetime for the ticket.  Tickets must always have at least one datetime assigned to them.',
221
-                            'event_espresso'
222
-                        ),
223
-                        'dismiss_button'          => '<button class="button--secondary ee-modal-cancel">'
224
-                                                     . esc_html__('Dismiss', 'event_espresso') . '</button>',
225
-                    ),
226
-                    'DTT_ERROR_MSG'         => array(
227
-                        'no_ticket_name' => esc_html__('General Admission', 'event_espresso'),
228
-                        'dismiss_button' => '<div class="save-cancel-button-container">'
229
-                                            . '<button class="button--secondary ee-modal-cancel">'
230
-                                            . esc_html__('Dismiss', 'event_espresso')
231
-                                            . '</button></div>',
232
-                    ),
233
-                    'DTT_OVERSELL_WARNING'  => array(
234
-                        'datetime_ticket' => esc_html__(
235
-                            'You cannot add this ticket to this datetime because it has a sold amount that is greater than the amount of spots remaining for this datetime.',
236
-                            'event_espresso'
237
-                        ),
238
-                        'ticket_datetime' => esc_html__(
239
-                            'You cannot add this datetime to this ticket because the ticket has a sold amount that is greater than the amount of spots remaining on the datetime.',
240
-                            'event_espresso'
241
-                        ),
242
-                    ),
243
-                    'DTT_CONVERTED_FORMATS' => EEH_DTT_Helper::convert_php_to_js_and_moment_date_formats(
244
-                        $this->_date_format_strings['date'],
245
-                        $this->_date_format_strings['time']
246
-                    ),
247
-                    'DTT_START_OF_WEEK'     => array('dayValue' => (int) get_option('start_of_week')),
248
-                ),
249
-            ),
250
-        );
251
-    }
176
+	/**
177
+	 * @return void
178
+	 */
179
+	protected function _set_scripts_styles()
180
+	{
181
+		$this->_scripts_styles = array(
182
+			'registers'   => array(
183
+				'ee-tickets-datetimes-css' => array(
184
+					'url'  => PRICING_ASSETS_URL . 'event-tickets-datetimes.css',
185
+					'type' => 'css',
186
+				),
187
+				'ee-dtt-ticket-metabox'    => array(
188
+					'url'     => PRICING_ASSETS_URL . 'ee-datetime-ticket-metabox.js',
189
+					'depends' => array('ee-datepicker', 'ee-dialog', 'underscore'),
190
+				),
191
+			),
192
+			'deregisters' => array(
193
+				'event-editor-css'       => array('type' => 'css'),
194
+				'event-datetime-metabox' => array('type' => 'js'),
195
+			),
196
+			'enqueues'    => array(
197
+				'ee-tickets-datetimes-css' => array('edit', 'create_new'),
198
+				'ee-dtt-ticket-metabox'    => array('edit', 'create_new'),
199
+			),
200
+			'localize'    => array(
201
+				'ee-dtt-ticket-metabox' => array(
202
+					'DTT_TRASH_BLOCK'       => array(
203
+						'main_warning'            => esc_html__(
204
+							'The Datetime you are attempting to trash is the only datetime selected for the following ticket(s):',
205
+							'event_espresso'
206
+						),
207
+						'after_warning'           => esc_html__(
208
+							'In order to trash this datetime you must first make sure the above ticket(s) are assigned to other datetimes.',
209
+							'event_espresso'
210
+						),
211
+						'cancel_button'           => '<button class="button--secondary ee-modal-cancel">'
212
+													 . esc_html__('Cancel', 'event_espresso') . '</button>',
213
+						'close_button'            => '<button class="button--secondary ee-modal-cancel">'
214
+													 . esc_html__('Close', 'event_espresso') . '</button>',
215
+						'single_warning_from_tkt' => esc_html__(
216
+							'The Datetime you are attempting to unassign from this ticket is the only remaining datetime for this ticket. Tickets must always have at least one datetime assigned to them.',
217
+							'event_espresso'
218
+						),
219
+						'single_warning_from_dtt' => esc_html__(
220
+							'The ticket you are attempting to unassign from this datetime cannot be unassigned because the datetime is the only remaining datetime for the ticket.  Tickets must always have at least one datetime assigned to them.',
221
+							'event_espresso'
222
+						),
223
+						'dismiss_button'          => '<button class="button--secondary ee-modal-cancel">'
224
+													 . esc_html__('Dismiss', 'event_espresso') . '</button>',
225
+					),
226
+					'DTT_ERROR_MSG'         => array(
227
+						'no_ticket_name' => esc_html__('General Admission', 'event_espresso'),
228
+						'dismiss_button' => '<div class="save-cancel-button-container">'
229
+											. '<button class="button--secondary ee-modal-cancel">'
230
+											. esc_html__('Dismiss', 'event_espresso')
231
+											. '</button></div>',
232
+					),
233
+					'DTT_OVERSELL_WARNING'  => array(
234
+						'datetime_ticket' => esc_html__(
235
+							'You cannot add this ticket to this datetime because it has a sold amount that is greater than the amount of spots remaining for this datetime.',
236
+							'event_espresso'
237
+						),
238
+						'ticket_datetime' => esc_html__(
239
+							'You cannot add this datetime to this ticket because the ticket has a sold amount that is greater than the amount of spots remaining on the datetime.',
240
+							'event_espresso'
241
+						),
242
+					),
243
+					'DTT_CONVERTED_FORMATS' => EEH_DTT_Helper::convert_php_to_js_and_moment_date_formats(
244
+						$this->_date_format_strings['date'],
245
+						$this->_date_format_strings['time']
246
+					),
247
+					'DTT_START_OF_WEEK'     => array('dayValue' => (int) get_option('start_of_week')),
248
+				),
249
+			),
250
+		);
251
+	}
252 252
 
253 253
 
254
-    /**
255
-     * @param array $update_callbacks
256
-     * @return array
257
-     */
258
-    public function caf_updates(array $update_callbacks)
259
-    {
260
-        unset($update_callbacks['_default_tickets_update']);
261
-        $update_callbacks['datetime_and_tickets_caf_update'] = array($this, 'datetime_and_tickets_caf_update');
262
-        return $update_callbacks;
263
-    }
254
+	/**
255
+	 * @param array $update_callbacks
256
+	 * @return array
257
+	 */
258
+	public function caf_updates(array $update_callbacks)
259
+	{
260
+		unset($update_callbacks['_default_tickets_update']);
261
+		$update_callbacks['datetime_and_tickets_caf_update'] = array($this, 'datetime_and_tickets_caf_update');
262
+		return $update_callbacks;
263
+	}
264 264
 
265 265
 
266
-    /**
267
-     * Handles saving everything related to Tickets (datetimes, tickets, prices)
268
-     *
269
-     * @param  EE_Event $event The Event object we're attaching data to
270
-     * @param  array    $data  The request data from the form
271
-     * @throws ReflectionException
272
-     * @throws Exception
273
-     * @throws InvalidInterfaceException
274
-     * @throws InvalidDataTypeException
275
-     * @throws EE_Error
276
-     * @throws InvalidArgumentException
277
-     */
278
-    public function datetime_and_tickets_caf_update($event, $data)
279
-    {
280
-        // first we need to start with datetimes cause they are the "root" items attached to events.
281
-        $saved_datetimes = $this->_update_datetimes($event, $data);
282
-        // next tackle the tickets (and prices?)
283
-        $this->_update_tickets($event, $saved_datetimes, $data);
284
-    }
266
+	/**
267
+	 * Handles saving everything related to Tickets (datetimes, tickets, prices)
268
+	 *
269
+	 * @param  EE_Event $event The Event object we're attaching data to
270
+	 * @param  array    $data  The request data from the form
271
+	 * @throws ReflectionException
272
+	 * @throws Exception
273
+	 * @throws InvalidInterfaceException
274
+	 * @throws InvalidDataTypeException
275
+	 * @throws EE_Error
276
+	 * @throws InvalidArgumentException
277
+	 */
278
+	public function datetime_and_tickets_caf_update($event, $data)
279
+	{
280
+		// first we need to start with datetimes cause they are the "root" items attached to events.
281
+		$saved_datetimes = $this->_update_datetimes($event, $data);
282
+		// next tackle the tickets (and prices?)
283
+		$this->_update_tickets($event, $saved_datetimes, $data);
284
+	}
285 285
 
286 286
 
287
-    /**
288
-     * update event_datetimes
289
-     *
290
-     * @param  EE_Event $event Event being updated
291
-     * @param  array    $data  the request data from the form
292
-     * @return EE_Datetime[]
293
-     * @throws Exception
294
-     * @throws ReflectionException
295
-     * @throws InvalidInterfaceException
296
-     * @throws InvalidDataTypeException
297
-     * @throws InvalidArgumentException
298
-     * @throws EE_Error
299
-     */
300
-    protected function _update_datetimes($event, $data)
301
-    {
302
-        $timezone = isset($data['timezone_string']) ? $data['timezone_string'] : null;
303
-        $saved_dtt_ids = array();
304
-        $saved_dtt_objs = array();
305
-        if (empty($data['edit_event_datetimes']) || ! is_array($data['edit_event_datetimes'])) {
306
-            throw new InvalidArgumentException(
307
-                esc_html__(
308
-                    'The "edit_event_datetimes" array is invalid therefore the event can not be updated.',
309
-                    'event_espresso'
310
-                )
311
-            );
312
-        }
313
-        foreach ($data['edit_event_datetimes'] as $row => $datetime_data) {
314
-            // trim all values to ensure any excess whitespace is removed.
315
-            $datetime_data = array_map(
316
-                function ($datetime_data) {
317
-                    return is_array($datetime_data) ? $datetime_data : trim($datetime_data);
318
-                },
319
-                $datetime_data
320
-            );
321
-            $datetime_data['DTT_EVT_end'] = isset($datetime_data['DTT_EVT_end'])
322
-                                            && ! empty($datetime_data['DTT_EVT_end'])
323
-                ? $datetime_data['DTT_EVT_end']
324
-                : $datetime_data['DTT_EVT_start'];
325
-            $datetime_values = array(
326
-                'DTT_ID'          => ! empty($datetime_data['DTT_ID'])
327
-                    ? $datetime_data['DTT_ID']
328
-                    : null,
329
-                'DTT_name'        => ! empty($datetime_data['DTT_name'])
330
-                    ? $datetime_data['DTT_name']
331
-                    : '',
332
-                'DTT_description' => ! empty($datetime_data['DTT_description'])
333
-                    ? $datetime_data['DTT_description']
334
-                    : '',
335
-                'DTT_EVT_start'   => $datetime_data['DTT_EVT_start'],
336
-                'DTT_EVT_end'     => $datetime_data['DTT_EVT_end'],
337
-                'DTT_reg_limit'   => empty($datetime_data['DTT_reg_limit'])
338
-                    ? EE_INF
339
-                    : $datetime_data['DTT_reg_limit'],
340
-                'DTT_order'       => ! isset($datetime_data['DTT_order'])
341
-                    ? $row
342
-                    : $datetime_data['DTT_order'],
343
-            );
344
-            // if we have an id then let's get existing object first and then set the new values.
345
-            // Otherwise we instantiate a new object for save.
346
-            if (! empty($datetime_data['DTT_ID'])) {
347
-                $datetime = EE_Registry::instance()
348
-                                       ->load_model('Datetime', array($timezone))
349
-                                       ->get_one_by_ID($datetime_data['DTT_ID']);
350
-                // set date and time format according to what is set in this class.
351
-                $datetime->set_date_format($this->_date_format_strings['date']);
352
-                $datetime->set_time_format($this->_date_format_strings['time']);
353
-                foreach ($datetime_values as $field => $value) {
354
-                    $datetime->set($field, $value);
355
-                }
356
-                // make sure the $dtt_id here is saved just in case
357
-                // after the add_relation_to() the autosave replaces it.
358
-                // We need to do this so we dont' TRASH the parent DTT.
359
-                // (save the ID for both key and value to avoid duplications)
360
-                $saved_dtt_ids[ $datetime->ID() ] = $datetime->ID();
361
-            } else {
362
-                $datetime = EE_Registry::instance()->load_class(
363
-                    'Datetime',
364
-                    array(
365
-                        $datetime_values,
366
-                        $timezone,
367
-                        array($this->_date_format_strings['date'], $this->_date_format_strings['time']),
368
-                    ),
369
-                    false,
370
-                    false
371
-                );
372
-                foreach ($datetime_values as $field => $value) {
373
-                    $datetime->set($field, $value);
374
-                }
375
-            }
376
-            $datetime->save();
377
-            do_action(
378
-                'AHEE__espresso_events_Pricing_Hooks___update_datetimes_after_save',
379
-                $datetime,
380
-                $row,
381
-                $datetime_data,
382
-                $data
383
-            );
384
-            $datetime = $event->_add_relation_to($datetime, 'Datetime');
385
-            // before going any further make sure our dates are setup correctly
386
-            // so that the end date is always equal or greater than the start date.
387
-            if ($datetime->get_raw('DTT_EVT_start') > $datetime->get_raw('DTT_EVT_end')) {
388
-                $datetime->set('DTT_EVT_end', $datetime->get('DTT_EVT_start'));
389
-                $datetime = EEH_DTT_Helper::date_time_add($datetime, 'DTT_EVT_end', 'days');
390
-                $datetime->save();
391
-            }
392
-            // now we have to make sure we add the new DTT_ID to the $saved_dtt_ids array
393
-            // because it is possible there was a new one created for the autosave.
394
-            // (save the ID for both key and value to avoid duplications)
395
-            $DTT_ID = $datetime->ID();
396
-            $saved_dtt_ids[ $DTT_ID ] = $DTT_ID;
397
-            $saved_dtt_objs[ $row ] = $datetime;
398
-            // @todo if ANY of these updates fail then we want the appropriate global error message.
399
-        }
400
-        $event->save();
401
-        // now we need to REMOVE any datetimes that got deleted.
402
-        // Keep in mind that this process will only kick in for datetimes that don't have any DTT_sold on them.
403
-        // So its safe to permanently delete at this point.
404
-        $old_datetimes = explode(',', $data['datetime_IDs']);
405
-        $old_datetimes = $old_datetimes[0] === '' ? array() : $old_datetimes;
406
-        if (is_array($old_datetimes)) {
407
-            $datetimes_to_delete = array_diff($old_datetimes, $saved_dtt_ids);
408
-            foreach ($datetimes_to_delete as $id) {
409
-                $id = absint($id);
410
-                if (empty($id)) {
411
-                    continue;
412
-                }
413
-                $dtt_to_remove = EE_Registry::instance()->load_model('Datetime')->get_one_by_ID($id);
414
-                // remove tkt relationships.
415
-                $related_tickets = $dtt_to_remove->get_many_related('Ticket');
416
-                foreach ($related_tickets as $tkt) {
417
-                    $dtt_to_remove->_remove_relation_to($tkt, 'Ticket');
418
-                }
419
-                $event->_remove_relation_to($id, 'Datetime');
420
-                $dtt_to_remove->refresh_cache_of_related_objects();
421
-            }
422
-        }
423
-        return $saved_dtt_objs;
424
-    }
287
+	/**
288
+	 * update event_datetimes
289
+	 *
290
+	 * @param  EE_Event $event Event being updated
291
+	 * @param  array    $data  the request data from the form
292
+	 * @return EE_Datetime[]
293
+	 * @throws Exception
294
+	 * @throws ReflectionException
295
+	 * @throws InvalidInterfaceException
296
+	 * @throws InvalidDataTypeException
297
+	 * @throws InvalidArgumentException
298
+	 * @throws EE_Error
299
+	 */
300
+	protected function _update_datetimes($event, $data)
301
+	{
302
+		$timezone = isset($data['timezone_string']) ? $data['timezone_string'] : null;
303
+		$saved_dtt_ids = array();
304
+		$saved_dtt_objs = array();
305
+		if (empty($data['edit_event_datetimes']) || ! is_array($data['edit_event_datetimes'])) {
306
+			throw new InvalidArgumentException(
307
+				esc_html__(
308
+					'The "edit_event_datetimes" array is invalid therefore the event can not be updated.',
309
+					'event_espresso'
310
+				)
311
+			);
312
+		}
313
+		foreach ($data['edit_event_datetimes'] as $row => $datetime_data) {
314
+			// trim all values to ensure any excess whitespace is removed.
315
+			$datetime_data = array_map(
316
+				function ($datetime_data) {
317
+					return is_array($datetime_data) ? $datetime_data : trim($datetime_data);
318
+				},
319
+				$datetime_data
320
+			);
321
+			$datetime_data['DTT_EVT_end'] = isset($datetime_data['DTT_EVT_end'])
322
+											&& ! empty($datetime_data['DTT_EVT_end'])
323
+				? $datetime_data['DTT_EVT_end']
324
+				: $datetime_data['DTT_EVT_start'];
325
+			$datetime_values = array(
326
+				'DTT_ID'          => ! empty($datetime_data['DTT_ID'])
327
+					? $datetime_data['DTT_ID']
328
+					: null,
329
+				'DTT_name'        => ! empty($datetime_data['DTT_name'])
330
+					? $datetime_data['DTT_name']
331
+					: '',
332
+				'DTT_description' => ! empty($datetime_data['DTT_description'])
333
+					? $datetime_data['DTT_description']
334
+					: '',
335
+				'DTT_EVT_start'   => $datetime_data['DTT_EVT_start'],
336
+				'DTT_EVT_end'     => $datetime_data['DTT_EVT_end'],
337
+				'DTT_reg_limit'   => empty($datetime_data['DTT_reg_limit'])
338
+					? EE_INF
339
+					: $datetime_data['DTT_reg_limit'],
340
+				'DTT_order'       => ! isset($datetime_data['DTT_order'])
341
+					? $row
342
+					: $datetime_data['DTT_order'],
343
+			);
344
+			// if we have an id then let's get existing object first and then set the new values.
345
+			// Otherwise we instantiate a new object for save.
346
+			if (! empty($datetime_data['DTT_ID'])) {
347
+				$datetime = EE_Registry::instance()
348
+									   ->load_model('Datetime', array($timezone))
349
+									   ->get_one_by_ID($datetime_data['DTT_ID']);
350
+				// set date and time format according to what is set in this class.
351
+				$datetime->set_date_format($this->_date_format_strings['date']);
352
+				$datetime->set_time_format($this->_date_format_strings['time']);
353
+				foreach ($datetime_values as $field => $value) {
354
+					$datetime->set($field, $value);
355
+				}
356
+				// make sure the $dtt_id here is saved just in case
357
+				// after the add_relation_to() the autosave replaces it.
358
+				// We need to do this so we dont' TRASH the parent DTT.
359
+				// (save the ID for both key and value to avoid duplications)
360
+				$saved_dtt_ids[ $datetime->ID() ] = $datetime->ID();
361
+			} else {
362
+				$datetime = EE_Registry::instance()->load_class(
363
+					'Datetime',
364
+					array(
365
+						$datetime_values,
366
+						$timezone,
367
+						array($this->_date_format_strings['date'], $this->_date_format_strings['time']),
368
+					),
369
+					false,
370
+					false
371
+				);
372
+				foreach ($datetime_values as $field => $value) {
373
+					$datetime->set($field, $value);
374
+				}
375
+			}
376
+			$datetime->save();
377
+			do_action(
378
+				'AHEE__espresso_events_Pricing_Hooks___update_datetimes_after_save',
379
+				$datetime,
380
+				$row,
381
+				$datetime_data,
382
+				$data
383
+			);
384
+			$datetime = $event->_add_relation_to($datetime, 'Datetime');
385
+			// before going any further make sure our dates are setup correctly
386
+			// so that the end date is always equal or greater than the start date.
387
+			if ($datetime->get_raw('DTT_EVT_start') > $datetime->get_raw('DTT_EVT_end')) {
388
+				$datetime->set('DTT_EVT_end', $datetime->get('DTT_EVT_start'));
389
+				$datetime = EEH_DTT_Helper::date_time_add($datetime, 'DTT_EVT_end', 'days');
390
+				$datetime->save();
391
+			}
392
+			// now we have to make sure we add the new DTT_ID to the $saved_dtt_ids array
393
+			// because it is possible there was a new one created for the autosave.
394
+			// (save the ID for both key and value to avoid duplications)
395
+			$DTT_ID = $datetime->ID();
396
+			$saved_dtt_ids[ $DTT_ID ] = $DTT_ID;
397
+			$saved_dtt_objs[ $row ] = $datetime;
398
+			// @todo if ANY of these updates fail then we want the appropriate global error message.
399
+		}
400
+		$event->save();
401
+		// now we need to REMOVE any datetimes that got deleted.
402
+		// Keep in mind that this process will only kick in for datetimes that don't have any DTT_sold on them.
403
+		// So its safe to permanently delete at this point.
404
+		$old_datetimes = explode(',', $data['datetime_IDs']);
405
+		$old_datetimes = $old_datetimes[0] === '' ? array() : $old_datetimes;
406
+		if (is_array($old_datetimes)) {
407
+			$datetimes_to_delete = array_diff($old_datetimes, $saved_dtt_ids);
408
+			foreach ($datetimes_to_delete as $id) {
409
+				$id = absint($id);
410
+				if (empty($id)) {
411
+					continue;
412
+				}
413
+				$dtt_to_remove = EE_Registry::instance()->load_model('Datetime')->get_one_by_ID($id);
414
+				// remove tkt relationships.
415
+				$related_tickets = $dtt_to_remove->get_many_related('Ticket');
416
+				foreach ($related_tickets as $tkt) {
417
+					$dtt_to_remove->_remove_relation_to($tkt, 'Ticket');
418
+				}
419
+				$event->_remove_relation_to($id, 'Datetime');
420
+				$dtt_to_remove->refresh_cache_of_related_objects();
421
+			}
422
+		}
423
+		return $saved_dtt_objs;
424
+	}
425 425
 
426 426
 
427
-    /**
428
-     * update tickets
429
-     *
430
-     * @param  EE_Event      $event           Event object being updated
431
-     * @param  EE_Datetime[] $saved_datetimes an array of datetime ids being updated
432
-     * @param  array         $data            incoming request data
433
-     * @return EE_Ticket[]
434
-     * @throws Exception
435
-     * @throws ReflectionException
436
-     * @throws InvalidInterfaceException
437
-     * @throws InvalidDataTypeException
438
-     * @throws InvalidArgumentException
439
-     * @throws EE_Error
440
-     */
441
-    protected function _update_tickets($event, $saved_datetimes, $data)
442
-    {
443
-        $new_tkt = null;
444
-        // stripslashes because WP filtered the $_POST ($data) array to add slashes
445
-        $data = stripslashes_deep($data);
446
-        $timezone = $data['timezone_string'] ?? null;
447
-        $saved_tickets = array();
448
-        $old_tickets = isset($data['ticket_IDs']) ? explode(',', $data['ticket_IDs']) : array();
449
-        if (empty($data['edit_tickets']) || ! is_array($data['edit_tickets'])) {
450
-            throw new InvalidArgumentException(
451
-                esc_html__(
452
-                    'The "edit_tickets" array is invalid therefore the event can not be updated.',
453
-                    'event_espresso'
454
-                )
455
-            );
456
-        }
457
-        foreach ($data['edit_tickets'] as $row => $tkt) {
458
-            $update_prices = $create_new_TKT = false;
459
-            // figure out what datetimes were added to the ticket
460
-            // and what datetimes were removed from the ticket in the session.
461
-            $starting_tkt_dtt_rows = explode(',', $data['starting_ticket_datetime_rows'][ $row ]);
462
-            $tkt_dtt_rows = explode(',', $data['ticket_datetime_rows'][ $row ]);
463
-            $datetimes_added = array_diff($tkt_dtt_rows, $starting_tkt_dtt_rows);
464
-            $datetimes_removed = array_diff($starting_tkt_dtt_rows, $tkt_dtt_rows);
465
-            // trim inputs to ensure any excess whitespace is removed.
466
-            $tkt = array_map(
467
-                function ($ticket_data) {
468
-                    return is_array($ticket_data) ? $ticket_data : trim($ticket_data);
469
-                },
470
-                $tkt
471
-            );
472
-            // note we are doing conversions to floats here instead of allowing EE_Money_Field to handle
473
-            // because we're doing calculations prior to using the models.
474
-            // note incoming ['TKT_price'] value is already in standard notation (via js).
475
-            $ticket_price = isset($tkt['TKT_price'])
476
-                ? round((float) $tkt['TKT_price'], 3)
477
-                : 0;
478
-            // note incoming base price needs converted from localized value.
479
-            $base_price = isset($tkt['TKT_base_price'])
480
-                ? EEH_Money::convert_to_float_from_localized_money($tkt['TKT_base_price'])
481
-                : 0;
482
-            // if ticket price == 0 and $base_price != 0 then ticket price == base_price
483
-            $ticket_price = $ticket_price === 0 && $base_price !== 0
484
-                ? $base_price
485
-                : $ticket_price;
486
-            $base_price_id = $tkt['TKT_base_price_ID'] ?? 0;
487
-            $price_rows = is_array($data['edit_prices']) && isset($data['edit_prices'][ $row ])
488
-                ? $data['edit_prices'][ $row ]
489
-                : array();
490
-            $now = null;
491
-            if (empty($tkt['TKT_start_date'])) {
492
-                // lets' use now in the set timezone.
493
-                $now = new DateTime('now', new DateTimeZone($event->get_timezone()));
494
-                $tkt['TKT_start_date'] = $now->format($this->_date_time_format);
495
-            }
496
-            if (empty($tkt['TKT_end_date'])) {
497
-                /**
498
-                 * set the TKT_end_date to the first datetime attached to the ticket.
499
-                 */
500
-                $first_dtt = $saved_datetimes[ reset($tkt_dtt_rows) ];
501
-                $tkt['TKT_end_date'] = $first_dtt->start_date_and_time($this->_date_time_format);
502
-            }
503
-            $TKT_values = array(
504
-                'TKT_ID'          => ! empty($tkt['TKT_ID']) ? $tkt['TKT_ID'] : null,
505
-                'TTM_ID'          => ! empty($tkt['TTM_ID']) ? $tkt['TTM_ID'] : 0,
506
-                'TKT_name'        => ! empty($tkt['TKT_name']) ? $tkt['TKT_name'] : '',
507
-                'TKT_description' => ! empty($tkt['TKT_description'])
508
-                                     && $tkt['TKT_description'] !== esc_html__(
509
-                                         'You can modify this description',
510
-                                         'event_espresso'
511
-                                     )
512
-                    ? $tkt['TKT_description']
513
-                    : '',
514
-                'TKT_start_date'  => $tkt['TKT_start_date'],
515
-                'TKT_end_date'    => $tkt['TKT_end_date'],
516
-                'TKT_qty'         => ! isset($tkt['TKT_qty']) || $tkt['TKT_qty'] === ''
517
-                    ? EE_INF
518
-                    : $tkt['TKT_qty'],
519
-                'TKT_uses'        => ! isset($tkt['TKT_uses']) || $tkt['TKT_uses'] === ''
520
-                    ? EE_INF
521
-                    : $tkt['TKT_uses'],
522
-                'TKT_min'         => empty($tkt['TKT_min']) ? 0 : $tkt['TKT_min'],
523
-                'TKT_max'         => empty($tkt['TKT_max']) ? EE_INF : $tkt['TKT_max'],
524
-                'TKT_row'         => $row,
525
-                'TKT_order'       => $tkt['TKT_order'] ?? 0,
526
-                'TKT_taxable'     => ! empty($tkt['TKT_taxable']) ? 1 : 0,
527
-                'TKT_required'    => ! empty($tkt['TKT_required']) ? 1 : 0,
528
-                'TKT_price'       => $ticket_price,
529
-            );
530
-            // if this is a default TKT, then we need to set the TKT_ID to 0 and update accordingly,
531
-            // which means in turn that the prices will become new prices as well.
532
-            if (isset($tkt['TKT_is_default']) && $tkt['TKT_is_default']) {
533
-                $TKT_values['TKT_ID'] = 0;
534
-                $TKT_values['TKT_is_default'] = 0;
535
-                $update_prices = true;
536
-            }
537
-            // if we have a TKT_ID then we need to get that existing TKT_obj and update it
538
-            // we actually do our saves ahead of doing any add_relations to
539
-            // because its entirely possible that this ticket wasn't removed or added to any datetime in the session
540
-            // but DID have it's items modified.
541
-            // keep in mind that if the TKT has been sold (and we have changed pricing information),
542
-            // then we won't be updating the tkt but instead a new tkt will be created and the old one archived.
543
-            if (absint($TKT_values['TKT_ID'])) {
544
-                $ticket = EE_Registry::instance()
545
-                                     ->load_model('Ticket', array($timezone))
546
-                                     ->get_one_by_ID($tkt['TKT_ID']);
547
-                if ($ticket instanceof EE_Ticket) {
548
-                    $ticket = $this->_update_ticket_datetimes(
549
-                        $ticket,
550
-                        $saved_datetimes,
551
-                        $datetimes_added,
552
-                        $datetimes_removed
553
-                    );
554
-                    // are there any registrations using this ticket ?
555
-                    $tickets_sold = $ticket->count_related(
556
-                        'Registration',
557
-                        array(
558
-                            array(
559
-                                'STS_ID' => array('NOT IN', array(EEM_Registration::status_id_incomplete)),
560
-                            ),
561
-                        )
562
-                    );
563
-                    // set ticket formats
564
-                    $ticket->set_date_format($this->_date_format_strings['date']);
565
-                    $ticket->set_time_format($this->_date_format_strings['time']);
566
-                    // let's just check the total price for the existing ticket
567
-                    // and determine if it matches the new total price.
568
-                    // if they are different then we create a new ticket (if tickets sold)
569
-                    // if they aren't different then we go ahead and modify existing ticket.
570
-                    $create_new_TKT = $tickets_sold > 0 && $ticket_price !== $ticket->price() && ! $ticket->deleted();
571
-                    // set new values
572
-                    foreach ($TKT_values as $field => $value) {
573
-                        if ($field === 'TKT_qty') {
574
-                            $ticket->set_qty($value);
575
-                        } else {
576
-                            $ticket->set($field, $value);
577
-                        }
578
-                    }
579
-                    // if $create_new_TKT is false then we can safely update the existing ticket.
580
-                    // Otherwise we have to create a new ticket.
581
-                    if ($create_new_TKT) {
582
-                        $new_tkt = $this->_duplicate_ticket(
583
-                            $ticket,
584
-                            $price_rows,
585
-                            $ticket_price,
586
-                            $base_price,
587
-                            $base_price_id
588
-                        );
589
-                    }
590
-                }
591
-            } else {
592
-                // no TKT_id so a new TKT
593
-                $ticket = EE_Ticket::new_instance(
594
-                    $TKT_values,
595
-                    $timezone,
596
-                    array($this->_date_format_strings['date'], $this->_date_format_strings['time'])
597
-                );
598
-                if ($ticket instanceof EE_Ticket) {
599
-                    // make sure ticket has an ID of setting relations won't work
600
-                    $ticket->save();
601
-                    $ticket = $this->_update_ticket_datetimes(
602
-                        $ticket,
603
-                        $saved_datetimes,
604
-                        $datetimes_added,
605
-                        $datetimes_removed
606
-                    );
607
-                    $update_prices = true;
608
-                }
609
-            }
610
-            // make sure any current values have been saved.
611
-            // $ticket->save();
612
-            // before going any further make sure our dates are setup correctly
613
-            // so that the end date is always equal or greater than the start date.
614
-            if ($ticket->get_raw('TKT_start_date') > $ticket->get_raw('TKT_end_date')) {
615
-                $ticket->set('TKT_end_date', $ticket->get('TKT_start_date'));
616
-                $ticket = EEH_DTT_Helper::date_time_add($ticket, 'TKT_end_date', 'days');
617
-            }
618
-            // let's make sure the base price is handled
619
-            $ticket = ! $create_new_TKT
620
-                ? $this->_add_prices_to_ticket(
621
-                    array(),
622
-                    $ticket,
623
-                    $update_prices,
624
-                    $base_price,
625
-                    $base_price_id
626
-                )
627
-                : $ticket;
628
-            // add/update price_modifiers
629
-            $ticket = ! $create_new_TKT
630
-                ? $this->_add_prices_to_ticket($price_rows, $ticket, $update_prices)
631
-                : $ticket;
632
-            // need to make sue that the TKT_price is accurate after saving the prices.
633
-            $ticket->ensure_TKT_Price_correct();
634
-            // handle CREATING a default tkt from the incoming tkt but ONLY if this isn't an autosave.
635
-            if (! defined('DOING_AUTOSAVE') && ! empty($tkt['TKT_is_default_selector'])) {
636
-                $update_prices = true;
637
-                $new_default = clone $ticket;
638
-                $new_default->set('TKT_ID', 0);
639
-                $new_default->set('TKT_is_default', 1);
640
-                $new_default->set('TKT_row', 1);
641
-                $new_default->set('TKT_price', $ticket_price);
642
-                // remove any dtt relations cause we DON'T want dtt relations attached
643
-                // (note this is just removing the cached relations in the object)
644
-                $new_default->_remove_relations('Datetime');
645
-                // @todo we need to add the current attached prices as new prices to the new default ticket.
646
-                $new_default = $this->_add_prices_to_ticket(
647
-                    $price_rows,
648
-                    $new_default,
649
-                    $update_prices
650
-                );
651
-                // don't forget the base price!
652
-                $new_default = $this->_add_prices_to_ticket(
653
-                    array(),
654
-                    $new_default,
655
-                    $update_prices,
656
-                    $base_price,
657
-                    $base_price_id
658
-                );
659
-                $new_default->save();
660
-                do_action(
661
-                    'AHEE__espresso_events_Pricing_Hooks___update_tkts_new_default_ticket',
662
-                    $new_default,
663
-                    $row,
664
-                    $ticket,
665
-                    $data
666
-                );
667
-            }
668
-            // DO ALL dtt relationships for both current tickets and any archived tickets
669
-            // for the given dtt that are related to the current ticket.
670
-            // TODO... not sure exactly how we're going to do this considering we don't know
671
-            // what current ticket the archived tickets are related to
672
-            // (and TKT_parent is used for autosaves so that's not a field we can reliably use).
673
-            // let's assign any tickets that have been setup to the saved_tickets tracker
674
-            // save existing TKT
675
-            $ticket->save();
676
-            if ($create_new_TKT && $new_tkt instanceof EE_Ticket) {
677
-                // save new TKT
678
-                $new_tkt->save();
679
-                // add new ticket to array
680
-                $saved_tickets[ $new_tkt->ID() ] = $new_tkt;
681
-                do_action(
682
-                    'AHEE__espresso_events_Pricing_Hooks___update_tkts_new_ticket',
683
-                    $new_tkt,
684
-                    $row,
685
-                    $tkt,
686
-                    $data
687
-                );
688
-            } else {
689
-                // add tkt to saved tkts
690
-                $saved_tickets[ $ticket->ID() ] = $ticket;
691
-                do_action(
692
-                    'AHEE__espresso_events_Pricing_Hooks___update_tkts_update_ticket',
693
-                    $ticket,
694
-                    $row,
695
-                    $tkt,
696
-                    $data
697
-                );
698
-            }
699
-        }
700
-        // now we need to handle tickets actually "deleted permanently".
701
-        // There are cases where we'd want this to happen
702
-        // (i.e. autosaves are happening and then in between autosaves the user trashes a ticket).
703
-        // Or a draft event was saved and in the process of editing a ticket is trashed.
704
-        // No sense in keeping all the related data in the db!
705
-        $old_tickets = isset($old_tickets[0]) && $old_tickets[0] === '' ? array() : $old_tickets;
706
-        $tickets_removed = array_diff($old_tickets, array_keys($saved_tickets));
707
-        foreach ($tickets_removed as $id) {
708
-            $id = absint($id);
709
-            // get the ticket for this id
710
-            $tkt_to_remove = EE_Registry::instance()->load_model('Ticket')->get_one_by_ID($id);
711
-            // if this tkt is a default tkt we leave it alone cause it won't be attached to the datetime
712
-            if ($tkt_to_remove->get('TKT_is_default')) {
713
-                continue;
714
-            }
715
-            // if this tkt has any registrations attached so then we just ARCHIVE
716
-            // because we don't actually permanently delete these tickets.
717
-            if ($tkt_to_remove->count_related('Registration') > 0) {
718
-                $tkt_to_remove->delete();
719
-                continue;
720
-            }
721
-            // need to get all the related datetimes on this ticket and remove from every single one of them
722
-            // (remember this process can ONLY kick off if there are NO tkts_sold)
723
-            $datetimes = $tkt_to_remove->get_many_related('Datetime');
724
-            foreach ($datetimes as $datetime) {
725
-                $tkt_to_remove->_remove_relation_to($datetime, 'Datetime');
726
-            }
727
-            // need to do the same for prices (except these prices can also be deleted because again,
728
-            // tickets can only be trashed if they don't have any TKTs sold (otherwise they are just archived))
729
-            $tkt_to_remove->delete_related_permanently('Price');
730
-            do_action('AHEE__espresso_events_Pricing_Hooks___update_tkts_delete_ticket', $tkt_to_remove);
731
-            // finally let's delete this ticket
732
-            // (which should not be blocked at this point b/c we've removed all our relationships)
733
-            $tkt_to_remove->delete_permanently();
734
-        }
735
-        return $saved_tickets;
736
-    }
427
+	/**
428
+	 * update tickets
429
+	 *
430
+	 * @param  EE_Event      $event           Event object being updated
431
+	 * @param  EE_Datetime[] $saved_datetimes an array of datetime ids being updated
432
+	 * @param  array         $data            incoming request data
433
+	 * @return EE_Ticket[]
434
+	 * @throws Exception
435
+	 * @throws ReflectionException
436
+	 * @throws InvalidInterfaceException
437
+	 * @throws InvalidDataTypeException
438
+	 * @throws InvalidArgumentException
439
+	 * @throws EE_Error
440
+	 */
441
+	protected function _update_tickets($event, $saved_datetimes, $data)
442
+	{
443
+		$new_tkt = null;
444
+		// stripslashes because WP filtered the $_POST ($data) array to add slashes
445
+		$data = stripslashes_deep($data);
446
+		$timezone = $data['timezone_string'] ?? null;
447
+		$saved_tickets = array();
448
+		$old_tickets = isset($data['ticket_IDs']) ? explode(',', $data['ticket_IDs']) : array();
449
+		if (empty($data['edit_tickets']) || ! is_array($data['edit_tickets'])) {
450
+			throw new InvalidArgumentException(
451
+				esc_html__(
452
+					'The "edit_tickets" array is invalid therefore the event can not be updated.',
453
+					'event_espresso'
454
+				)
455
+			);
456
+		}
457
+		foreach ($data['edit_tickets'] as $row => $tkt) {
458
+			$update_prices = $create_new_TKT = false;
459
+			// figure out what datetimes were added to the ticket
460
+			// and what datetimes were removed from the ticket in the session.
461
+			$starting_tkt_dtt_rows = explode(',', $data['starting_ticket_datetime_rows'][ $row ]);
462
+			$tkt_dtt_rows = explode(',', $data['ticket_datetime_rows'][ $row ]);
463
+			$datetimes_added = array_diff($tkt_dtt_rows, $starting_tkt_dtt_rows);
464
+			$datetimes_removed = array_diff($starting_tkt_dtt_rows, $tkt_dtt_rows);
465
+			// trim inputs to ensure any excess whitespace is removed.
466
+			$tkt = array_map(
467
+				function ($ticket_data) {
468
+					return is_array($ticket_data) ? $ticket_data : trim($ticket_data);
469
+				},
470
+				$tkt
471
+			);
472
+			// note we are doing conversions to floats here instead of allowing EE_Money_Field to handle
473
+			// because we're doing calculations prior to using the models.
474
+			// note incoming ['TKT_price'] value is already in standard notation (via js).
475
+			$ticket_price = isset($tkt['TKT_price'])
476
+				? round((float) $tkt['TKT_price'], 3)
477
+				: 0;
478
+			// note incoming base price needs converted from localized value.
479
+			$base_price = isset($tkt['TKT_base_price'])
480
+				? EEH_Money::convert_to_float_from_localized_money($tkt['TKT_base_price'])
481
+				: 0;
482
+			// if ticket price == 0 and $base_price != 0 then ticket price == base_price
483
+			$ticket_price = $ticket_price === 0 && $base_price !== 0
484
+				? $base_price
485
+				: $ticket_price;
486
+			$base_price_id = $tkt['TKT_base_price_ID'] ?? 0;
487
+			$price_rows = is_array($data['edit_prices']) && isset($data['edit_prices'][ $row ])
488
+				? $data['edit_prices'][ $row ]
489
+				: array();
490
+			$now = null;
491
+			if (empty($tkt['TKT_start_date'])) {
492
+				// lets' use now in the set timezone.
493
+				$now = new DateTime('now', new DateTimeZone($event->get_timezone()));
494
+				$tkt['TKT_start_date'] = $now->format($this->_date_time_format);
495
+			}
496
+			if (empty($tkt['TKT_end_date'])) {
497
+				/**
498
+				 * set the TKT_end_date to the first datetime attached to the ticket.
499
+				 */
500
+				$first_dtt = $saved_datetimes[ reset($tkt_dtt_rows) ];
501
+				$tkt['TKT_end_date'] = $first_dtt->start_date_and_time($this->_date_time_format);
502
+			}
503
+			$TKT_values = array(
504
+				'TKT_ID'          => ! empty($tkt['TKT_ID']) ? $tkt['TKT_ID'] : null,
505
+				'TTM_ID'          => ! empty($tkt['TTM_ID']) ? $tkt['TTM_ID'] : 0,
506
+				'TKT_name'        => ! empty($tkt['TKT_name']) ? $tkt['TKT_name'] : '',
507
+				'TKT_description' => ! empty($tkt['TKT_description'])
508
+									 && $tkt['TKT_description'] !== esc_html__(
509
+										 'You can modify this description',
510
+										 'event_espresso'
511
+									 )
512
+					? $tkt['TKT_description']
513
+					: '',
514
+				'TKT_start_date'  => $tkt['TKT_start_date'],
515
+				'TKT_end_date'    => $tkt['TKT_end_date'],
516
+				'TKT_qty'         => ! isset($tkt['TKT_qty']) || $tkt['TKT_qty'] === ''
517
+					? EE_INF
518
+					: $tkt['TKT_qty'],
519
+				'TKT_uses'        => ! isset($tkt['TKT_uses']) || $tkt['TKT_uses'] === ''
520
+					? EE_INF
521
+					: $tkt['TKT_uses'],
522
+				'TKT_min'         => empty($tkt['TKT_min']) ? 0 : $tkt['TKT_min'],
523
+				'TKT_max'         => empty($tkt['TKT_max']) ? EE_INF : $tkt['TKT_max'],
524
+				'TKT_row'         => $row,
525
+				'TKT_order'       => $tkt['TKT_order'] ?? 0,
526
+				'TKT_taxable'     => ! empty($tkt['TKT_taxable']) ? 1 : 0,
527
+				'TKT_required'    => ! empty($tkt['TKT_required']) ? 1 : 0,
528
+				'TKT_price'       => $ticket_price,
529
+			);
530
+			// if this is a default TKT, then we need to set the TKT_ID to 0 and update accordingly,
531
+			// which means in turn that the prices will become new prices as well.
532
+			if (isset($tkt['TKT_is_default']) && $tkt['TKT_is_default']) {
533
+				$TKT_values['TKT_ID'] = 0;
534
+				$TKT_values['TKT_is_default'] = 0;
535
+				$update_prices = true;
536
+			}
537
+			// if we have a TKT_ID then we need to get that existing TKT_obj and update it
538
+			// we actually do our saves ahead of doing any add_relations to
539
+			// because its entirely possible that this ticket wasn't removed or added to any datetime in the session
540
+			// but DID have it's items modified.
541
+			// keep in mind that if the TKT has been sold (and we have changed pricing information),
542
+			// then we won't be updating the tkt but instead a new tkt will be created and the old one archived.
543
+			if (absint($TKT_values['TKT_ID'])) {
544
+				$ticket = EE_Registry::instance()
545
+									 ->load_model('Ticket', array($timezone))
546
+									 ->get_one_by_ID($tkt['TKT_ID']);
547
+				if ($ticket instanceof EE_Ticket) {
548
+					$ticket = $this->_update_ticket_datetimes(
549
+						$ticket,
550
+						$saved_datetimes,
551
+						$datetimes_added,
552
+						$datetimes_removed
553
+					);
554
+					// are there any registrations using this ticket ?
555
+					$tickets_sold = $ticket->count_related(
556
+						'Registration',
557
+						array(
558
+							array(
559
+								'STS_ID' => array('NOT IN', array(EEM_Registration::status_id_incomplete)),
560
+							),
561
+						)
562
+					);
563
+					// set ticket formats
564
+					$ticket->set_date_format($this->_date_format_strings['date']);
565
+					$ticket->set_time_format($this->_date_format_strings['time']);
566
+					// let's just check the total price for the existing ticket
567
+					// and determine if it matches the new total price.
568
+					// if they are different then we create a new ticket (if tickets sold)
569
+					// if they aren't different then we go ahead and modify existing ticket.
570
+					$create_new_TKT = $tickets_sold > 0 && $ticket_price !== $ticket->price() && ! $ticket->deleted();
571
+					// set new values
572
+					foreach ($TKT_values as $field => $value) {
573
+						if ($field === 'TKT_qty') {
574
+							$ticket->set_qty($value);
575
+						} else {
576
+							$ticket->set($field, $value);
577
+						}
578
+					}
579
+					// if $create_new_TKT is false then we can safely update the existing ticket.
580
+					// Otherwise we have to create a new ticket.
581
+					if ($create_new_TKT) {
582
+						$new_tkt = $this->_duplicate_ticket(
583
+							$ticket,
584
+							$price_rows,
585
+							$ticket_price,
586
+							$base_price,
587
+							$base_price_id
588
+						);
589
+					}
590
+				}
591
+			} else {
592
+				// no TKT_id so a new TKT
593
+				$ticket = EE_Ticket::new_instance(
594
+					$TKT_values,
595
+					$timezone,
596
+					array($this->_date_format_strings['date'], $this->_date_format_strings['time'])
597
+				);
598
+				if ($ticket instanceof EE_Ticket) {
599
+					// make sure ticket has an ID of setting relations won't work
600
+					$ticket->save();
601
+					$ticket = $this->_update_ticket_datetimes(
602
+						$ticket,
603
+						$saved_datetimes,
604
+						$datetimes_added,
605
+						$datetimes_removed
606
+					);
607
+					$update_prices = true;
608
+				}
609
+			}
610
+			// make sure any current values have been saved.
611
+			// $ticket->save();
612
+			// before going any further make sure our dates are setup correctly
613
+			// so that the end date is always equal or greater than the start date.
614
+			if ($ticket->get_raw('TKT_start_date') > $ticket->get_raw('TKT_end_date')) {
615
+				$ticket->set('TKT_end_date', $ticket->get('TKT_start_date'));
616
+				$ticket = EEH_DTT_Helper::date_time_add($ticket, 'TKT_end_date', 'days');
617
+			}
618
+			// let's make sure the base price is handled
619
+			$ticket = ! $create_new_TKT
620
+				? $this->_add_prices_to_ticket(
621
+					array(),
622
+					$ticket,
623
+					$update_prices,
624
+					$base_price,
625
+					$base_price_id
626
+				)
627
+				: $ticket;
628
+			// add/update price_modifiers
629
+			$ticket = ! $create_new_TKT
630
+				? $this->_add_prices_to_ticket($price_rows, $ticket, $update_prices)
631
+				: $ticket;
632
+			// need to make sue that the TKT_price is accurate after saving the prices.
633
+			$ticket->ensure_TKT_Price_correct();
634
+			// handle CREATING a default tkt from the incoming tkt but ONLY if this isn't an autosave.
635
+			if (! defined('DOING_AUTOSAVE') && ! empty($tkt['TKT_is_default_selector'])) {
636
+				$update_prices = true;
637
+				$new_default = clone $ticket;
638
+				$new_default->set('TKT_ID', 0);
639
+				$new_default->set('TKT_is_default', 1);
640
+				$new_default->set('TKT_row', 1);
641
+				$new_default->set('TKT_price', $ticket_price);
642
+				// remove any dtt relations cause we DON'T want dtt relations attached
643
+				// (note this is just removing the cached relations in the object)
644
+				$new_default->_remove_relations('Datetime');
645
+				// @todo we need to add the current attached prices as new prices to the new default ticket.
646
+				$new_default = $this->_add_prices_to_ticket(
647
+					$price_rows,
648
+					$new_default,
649
+					$update_prices
650
+				);
651
+				// don't forget the base price!
652
+				$new_default = $this->_add_prices_to_ticket(
653
+					array(),
654
+					$new_default,
655
+					$update_prices,
656
+					$base_price,
657
+					$base_price_id
658
+				);
659
+				$new_default->save();
660
+				do_action(
661
+					'AHEE__espresso_events_Pricing_Hooks___update_tkts_new_default_ticket',
662
+					$new_default,
663
+					$row,
664
+					$ticket,
665
+					$data
666
+				);
667
+			}
668
+			// DO ALL dtt relationships for both current tickets and any archived tickets
669
+			// for the given dtt that are related to the current ticket.
670
+			// TODO... not sure exactly how we're going to do this considering we don't know
671
+			// what current ticket the archived tickets are related to
672
+			// (and TKT_parent is used for autosaves so that's not a field we can reliably use).
673
+			// let's assign any tickets that have been setup to the saved_tickets tracker
674
+			// save existing TKT
675
+			$ticket->save();
676
+			if ($create_new_TKT && $new_tkt instanceof EE_Ticket) {
677
+				// save new TKT
678
+				$new_tkt->save();
679
+				// add new ticket to array
680
+				$saved_tickets[ $new_tkt->ID() ] = $new_tkt;
681
+				do_action(
682
+					'AHEE__espresso_events_Pricing_Hooks___update_tkts_new_ticket',
683
+					$new_tkt,
684
+					$row,
685
+					$tkt,
686
+					$data
687
+				);
688
+			} else {
689
+				// add tkt to saved tkts
690
+				$saved_tickets[ $ticket->ID() ] = $ticket;
691
+				do_action(
692
+					'AHEE__espresso_events_Pricing_Hooks___update_tkts_update_ticket',
693
+					$ticket,
694
+					$row,
695
+					$tkt,
696
+					$data
697
+				);
698
+			}
699
+		}
700
+		// now we need to handle tickets actually "deleted permanently".
701
+		// There are cases where we'd want this to happen
702
+		// (i.e. autosaves are happening and then in between autosaves the user trashes a ticket).
703
+		// Or a draft event was saved and in the process of editing a ticket is trashed.
704
+		// No sense in keeping all the related data in the db!
705
+		$old_tickets = isset($old_tickets[0]) && $old_tickets[0] === '' ? array() : $old_tickets;
706
+		$tickets_removed = array_diff($old_tickets, array_keys($saved_tickets));
707
+		foreach ($tickets_removed as $id) {
708
+			$id = absint($id);
709
+			// get the ticket for this id
710
+			$tkt_to_remove = EE_Registry::instance()->load_model('Ticket')->get_one_by_ID($id);
711
+			// if this tkt is a default tkt we leave it alone cause it won't be attached to the datetime
712
+			if ($tkt_to_remove->get('TKT_is_default')) {
713
+				continue;
714
+			}
715
+			// if this tkt has any registrations attached so then we just ARCHIVE
716
+			// because we don't actually permanently delete these tickets.
717
+			if ($tkt_to_remove->count_related('Registration') > 0) {
718
+				$tkt_to_remove->delete();
719
+				continue;
720
+			}
721
+			// need to get all the related datetimes on this ticket and remove from every single one of them
722
+			// (remember this process can ONLY kick off if there are NO tkts_sold)
723
+			$datetimes = $tkt_to_remove->get_many_related('Datetime');
724
+			foreach ($datetimes as $datetime) {
725
+				$tkt_to_remove->_remove_relation_to($datetime, 'Datetime');
726
+			}
727
+			// need to do the same for prices (except these prices can also be deleted because again,
728
+			// tickets can only be trashed if they don't have any TKTs sold (otherwise they are just archived))
729
+			$tkt_to_remove->delete_related_permanently('Price');
730
+			do_action('AHEE__espresso_events_Pricing_Hooks___update_tkts_delete_ticket', $tkt_to_remove);
731
+			// finally let's delete this ticket
732
+			// (which should not be blocked at this point b/c we've removed all our relationships)
733
+			$tkt_to_remove->delete_permanently();
734
+		}
735
+		return $saved_tickets;
736
+	}
737 737
 
738 738
 
739
-    /**
740
-     * @access  protected
741
-     * @param EE_Ticket      $ticket
742
-     * @param \EE_Datetime[] $saved_datetimes
743
-     * @param \EE_Datetime[] $added_datetimes
744
-     * @param \EE_Datetime[] $removed_datetimes
745
-     * @return EE_Ticket
746
-     * @throws EE_Error
747
-     */
748
-    protected function _update_ticket_datetimes(
749
-        EE_Ticket $ticket,
750
-        $saved_datetimes = array(),
751
-        $added_datetimes = array(),
752
-        $removed_datetimes = array()
753
-    ) {
754
-        // to start we have to add the ticket to all the datetimes its supposed to be with,
755
-        // and removing the ticket from datetimes it got removed from.
756
-        // first let's add datetimes
757
-        if (! empty($added_datetimes) && is_array($added_datetimes)) {
758
-            foreach ($added_datetimes as $row_id) {
759
-                $row_id = (int) $row_id;
760
-                if (isset($saved_datetimes[ $row_id ]) && $saved_datetimes[ $row_id ] instanceof EE_Datetime) {
761
-                    $ticket->_add_relation_to($saved_datetimes[ $row_id ], 'Datetime');
762
-                }
763
-            }
764
-        }
765
-        // then remove datetimes
766
-        if (! empty($removed_datetimes) && is_array($removed_datetimes)) {
767
-            foreach ($removed_datetimes as $row_id) {
768
-                $row_id = (int) $row_id;
769
-                // its entirely possible that a datetime got deleted (instead of just removed from relationship.
770
-                // So make sure we skip over this if the dtt isn't in the $saved_datetimes array)
771
-                if (isset($saved_datetimes[ $row_id ]) && $saved_datetimes[ $row_id ] instanceof EE_Datetime) {
772
-                    $ticket->_remove_relation_to($saved_datetimes[ $row_id ], 'Datetime');
773
-                }
774
-            }
775
-        }
776
-        // cap ticket qty by datetime reg limits
777
-        $ticket->set_qty(min($ticket->qty(), $ticket->qty('reg_limit')));
778
-        return $ticket;
779
-    }
739
+	/**
740
+	 * @access  protected
741
+	 * @param EE_Ticket      $ticket
742
+	 * @param \EE_Datetime[] $saved_datetimes
743
+	 * @param \EE_Datetime[] $added_datetimes
744
+	 * @param \EE_Datetime[] $removed_datetimes
745
+	 * @return EE_Ticket
746
+	 * @throws EE_Error
747
+	 */
748
+	protected function _update_ticket_datetimes(
749
+		EE_Ticket $ticket,
750
+		$saved_datetimes = array(),
751
+		$added_datetimes = array(),
752
+		$removed_datetimes = array()
753
+	) {
754
+		// to start we have to add the ticket to all the datetimes its supposed to be with,
755
+		// and removing the ticket from datetimes it got removed from.
756
+		// first let's add datetimes
757
+		if (! empty($added_datetimes) && is_array($added_datetimes)) {
758
+			foreach ($added_datetimes as $row_id) {
759
+				$row_id = (int) $row_id;
760
+				if (isset($saved_datetimes[ $row_id ]) && $saved_datetimes[ $row_id ] instanceof EE_Datetime) {
761
+					$ticket->_add_relation_to($saved_datetimes[ $row_id ], 'Datetime');
762
+				}
763
+			}
764
+		}
765
+		// then remove datetimes
766
+		if (! empty($removed_datetimes) && is_array($removed_datetimes)) {
767
+			foreach ($removed_datetimes as $row_id) {
768
+				$row_id = (int) $row_id;
769
+				// its entirely possible that a datetime got deleted (instead of just removed from relationship.
770
+				// So make sure we skip over this if the dtt isn't in the $saved_datetimes array)
771
+				if (isset($saved_datetimes[ $row_id ]) && $saved_datetimes[ $row_id ] instanceof EE_Datetime) {
772
+					$ticket->_remove_relation_to($saved_datetimes[ $row_id ], 'Datetime');
773
+				}
774
+			}
775
+		}
776
+		// cap ticket qty by datetime reg limits
777
+		$ticket->set_qty(min($ticket->qty(), $ticket->qty('reg_limit')));
778
+		return $ticket;
779
+	}
780 780
 
781 781
 
782
-    /**
783
-     * @access  protected
784
-     * @param EE_Ticket $ticket
785
-     * @param array     $price_rows
786
-     * @param int       $ticket_price
787
-     * @param int       $base_price
788
-     * @param int       $base_price_id
789
-     * @return EE_Ticket
790
-     * @throws ReflectionException
791
-     * @throws InvalidArgumentException
792
-     * @throws InvalidInterfaceException
793
-     * @throws InvalidDataTypeException
794
-     * @throws EE_Error
795
-     */
796
-    protected function _duplicate_ticket(
797
-        EE_Ticket $ticket,
798
-        $price_rows = array(),
799
-        $ticket_price = 0,
800
-        $base_price = 0,
801
-        $base_price_id = 0
802
-    ) {
803
-        // create new ticket that's a copy of the existing
804
-        // except a new id of course (and not archived)
805
-        // AND has the new TKT_price associated with it.
806
-        $new_ticket = clone $ticket;
807
-        $new_ticket->set('TKT_ID', 0);
808
-        $new_ticket->set_deleted(0);
809
-        $new_ticket->set_price($ticket_price);
810
-        $new_ticket->set_sold(0);
811
-        // let's get a new ID for this ticket
812
-        $new_ticket->save();
813
-        // we also need to make sure this new ticket gets the same datetime attachments as the archived ticket
814
-        $datetimes_on_existing = $ticket->datetimes();
815
-        $new_ticket = $this->_update_ticket_datetimes(
816
-            $new_ticket,
817
-            $datetimes_on_existing,
818
-            array_keys($datetimes_on_existing)
819
-        );
820
-        // $ticket will get archived later b/c we are NOT adding it to the saved_tickets array.
821
-        // if existing $ticket has sold amount, then we need to adjust the qty for the new TKT to = the remaining
822
-        // available.
823
-        if ($ticket->sold() > 0) {
824
-            $new_qty = $ticket->qty() - $ticket->sold();
825
-            $new_ticket->set_qty($new_qty);
826
-        }
827
-        // now we update the prices just for this ticket
828
-        $new_ticket = $this->_add_prices_to_ticket($price_rows, $new_ticket, true);
829
-        // and we update the base price
830
-        $new_ticket = $this->_add_prices_to_ticket(
831
-            array(),
832
-            $new_ticket,
833
-            true,
834
-            $base_price,
835
-            $base_price_id
836
-        );
837
-        return $new_ticket;
838
-    }
782
+	/**
783
+	 * @access  protected
784
+	 * @param EE_Ticket $ticket
785
+	 * @param array     $price_rows
786
+	 * @param int       $ticket_price
787
+	 * @param int       $base_price
788
+	 * @param int       $base_price_id
789
+	 * @return EE_Ticket
790
+	 * @throws ReflectionException
791
+	 * @throws InvalidArgumentException
792
+	 * @throws InvalidInterfaceException
793
+	 * @throws InvalidDataTypeException
794
+	 * @throws EE_Error
795
+	 */
796
+	protected function _duplicate_ticket(
797
+		EE_Ticket $ticket,
798
+		$price_rows = array(),
799
+		$ticket_price = 0,
800
+		$base_price = 0,
801
+		$base_price_id = 0
802
+	) {
803
+		// create new ticket that's a copy of the existing
804
+		// except a new id of course (and not archived)
805
+		// AND has the new TKT_price associated with it.
806
+		$new_ticket = clone $ticket;
807
+		$new_ticket->set('TKT_ID', 0);
808
+		$new_ticket->set_deleted(0);
809
+		$new_ticket->set_price($ticket_price);
810
+		$new_ticket->set_sold(0);
811
+		// let's get a new ID for this ticket
812
+		$new_ticket->save();
813
+		// we also need to make sure this new ticket gets the same datetime attachments as the archived ticket
814
+		$datetimes_on_existing = $ticket->datetimes();
815
+		$new_ticket = $this->_update_ticket_datetimes(
816
+			$new_ticket,
817
+			$datetimes_on_existing,
818
+			array_keys($datetimes_on_existing)
819
+		);
820
+		// $ticket will get archived later b/c we are NOT adding it to the saved_tickets array.
821
+		// if existing $ticket has sold amount, then we need to adjust the qty for the new TKT to = the remaining
822
+		// available.
823
+		if ($ticket->sold() > 0) {
824
+			$new_qty = $ticket->qty() - $ticket->sold();
825
+			$new_ticket->set_qty($new_qty);
826
+		}
827
+		// now we update the prices just for this ticket
828
+		$new_ticket = $this->_add_prices_to_ticket($price_rows, $new_ticket, true);
829
+		// and we update the base price
830
+		$new_ticket = $this->_add_prices_to_ticket(
831
+			array(),
832
+			$new_ticket,
833
+			true,
834
+			$base_price,
835
+			$base_price_id
836
+		);
837
+		return $new_ticket;
838
+	}
839 839
 
840 840
 
841
-    /**
842
-     * This attaches a list of given prices to a ticket.
843
-     * Note we dont' have to worry about ever removing relationships (or archiving prices) because if there is a change
844
-     * in price information on a ticket, a new ticket is created anyways so the archived ticket will retain the old
845
-     * price info and prices are automatically "archived" via the ticket.
846
-     *
847
-     * @access  private
848
-     * @param array     $prices        Array of prices from the form.
849
-     * @param EE_Ticket $ticket        EE_Ticket object that prices are being attached to.
850
-     * @param bool      $new_prices    Whether attach existing incoming prices or create new ones.
851
-     * @param int|bool  $base_price    if FALSE then NOT doing a base price add.
852
-     * @param int|bool  $base_price_id if present then this is the base_price_id being updated.
853
-     * @return EE_Ticket
854
-     * @throws ReflectionException
855
-     * @throws InvalidArgumentException
856
-     * @throws InvalidInterfaceException
857
-     * @throws InvalidDataTypeException
858
-     * @throws EE_Error
859
-     */
860
-    protected function _add_prices_to_ticket(
861
-        $prices = array(),
862
-        EE_Ticket $ticket,
863
-        $new_prices = false,
864
-        $base_price = false,
865
-        $base_price_id = false
866
-    ) {
867
-        // let's just get any current prices that may exist on the given ticket
868
-        // so we can remove any prices that got trashed in this session.
869
-        $current_prices_on_ticket = $base_price !== false
870
-            ? $ticket->base_price(true)
871
-            : $ticket->price_modifiers();
872
-        $updated_prices = array();
873
-        // if $base_price ! FALSE then updating a base price.
874
-        if ($base_price !== false) {
875
-            $prices[1] = array(
876
-                'PRC_ID'     => $new_prices || $base_price_id === 1 ? null : $base_price_id,
877
-                'PRT_ID'     => 1,
878
-                'PRC_amount' => $base_price,
879
-                'PRC_name'   => $ticket->get('TKT_name'),
880
-                'PRC_desc'   => $ticket->get('TKT_description'),
881
-            );
882
-        }
883
-        // possibly need to save tkt
884
-        if (! $ticket->ID()) {
885
-            $ticket->save();
886
-        }
887
-        foreach ($prices as $row => $prc) {
888
-            $prt_id = ! empty($prc['PRT_ID']) ? $prc['PRT_ID'] : null;
889
-            if (empty($prt_id)) {
890
-                continue;
891
-            } //prices MUST have a price type id.
892
-            $PRC_values = array(
893
-                'PRC_ID'         => ! empty($prc['PRC_ID']) ? $prc['PRC_ID'] : null,
894
-                'PRT_ID'         => $prt_id,
895
-                'PRC_amount'     => ! empty($prc['PRC_amount']) ? $prc['PRC_amount'] : 0,
896
-                'PRC_name'       => ! empty($prc['PRC_name']) ? $prc['PRC_name'] : '',
897
-                'PRC_desc'       => ! empty($prc['PRC_desc']) ? $prc['PRC_desc'] : '',
898
-                'PRC_is_default' => false,
899
-                // make sure we set PRC_is_default to false for all ticket saves from event_editor
900
-                'PRC_order'      => $row,
901
-            );
902
-            if ($new_prices || empty($PRC_values['PRC_ID'])) {
903
-                $PRC_values['PRC_ID'] = 0;
904
-                $price = EE_Registry::instance()->load_class(
905
-                    'Price',
906
-                    array($PRC_values),
907
-                    false,
908
-                    false
909
-                );
910
-            } else {
911
-                $price = EE_Registry::instance()->load_model('Price')->get_one_by_ID($prc['PRC_ID']);
912
-                // update this price with new values
913
-                foreach ($PRC_values as $field => $value) {
914
-                    $price->set($field, $value);
915
-                }
916
-            }
917
-            $price->save();
918
-            $updated_prices[ $price->ID() ] = $price;
919
-            $ticket->_add_relation_to($price, 'Price');
920
-        }
921
-        // now let's remove any prices that got removed from the ticket
922
-        if (! empty($current_prices_on_ticket)) {
923
-            $current = array_keys($current_prices_on_ticket);
924
-            $updated = array_keys($updated_prices);
925
-            $prices_to_remove = array_diff($current, $updated);
926
-            if (! empty($prices_to_remove)) {
927
-                foreach ($prices_to_remove as $prc_id) {
928
-                    $p = $current_prices_on_ticket[ $prc_id ];
929
-                    $ticket->_remove_relation_to($p, 'Price');
930
-                    // delete permanently the price
931
-                    $p->delete_permanently();
932
-                }
933
-            }
934
-        }
935
-        return $ticket;
936
-    }
841
+	/**
842
+	 * This attaches a list of given prices to a ticket.
843
+	 * Note we dont' have to worry about ever removing relationships (or archiving prices) because if there is a change
844
+	 * in price information on a ticket, a new ticket is created anyways so the archived ticket will retain the old
845
+	 * price info and prices are automatically "archived" via the ticket.
846
+	 *
847
+	 * @access  private
848
+	 * @param array     $prices        Array of prices from the form.
849
+	 * @param EE_Ticket $ticket        EE_Ticket object that prices are being attached to.
850
+	 * @param bool      $new_prices    Whether attach existing incoming prices or create new ones.
851
+	 * @param int|bool  $base_price    if FALSE then NOT doing a base price add.
852
+	 * @param int|bool  $base_price_id if present then this is the base_price_id being updated.
853
+	 * @return EE_Ticket
854
+	 * @throws ReflectionException
855
+	 * @throws InvalidArgumentException
856
+	 * @throws InvalidInterfaceException
857
+	 * @throws InvalidDataTypeException
858
+	 * @throws EE_Error
859
+	 */
860
+	protected function _add_prices_to_ticket(
861
+		$prices = array(),
862
+		EE_Ticket $ticket,
863
+		$new_prices = false,
864
+		$base_price = false,
865
+		$base_price_id = false
866
+	) {
867
+		// let's just get any current prices that may exist on the given ticket
868
+		// so we can remove any prices that got trashed in this session.
869
+		$current_prices_on_ticket = $base_price !== false
870
+			? $ticket->base_price(true)
871
+			: $ticket->price_modifiers();
872
+		$updated_prices = array();
873
+		// if $base_price ! FALSE then updating a base price.
874
+		if ($base_price !== false) {
875
+			$prices[1] = array(
876
+				'PRC_ID'     => $new_prices || $base_price_id === 1 ? null : $base_price_id,
877
+				'PRT_ID'     => 1,
878
+				'PRC_amount' => $base_price,
879
+				'PRC_name'   => $ticket->get('TKT_name'),
880
+				'PRC_desc'   => $ticket->get('TKT_description'),
881
+			);
882
+		}
883
+		// possibly need to save tkt
884
+		if (! $ticket->ID()) {
885
+			$ticket->save();
886
+		}
887
+		foreach ($prices as $row => $prc) {
888
+			$prt_id = ! empty($prc['PRT_ID']) ? $prc['PRT_ID'] : null;
889
+			if (empty($prt_id)) {
890
+				continue;
891
+			} //prices MUST have a price type id.
892
+			$PRC_values = array(
893
+				'PRC_ID'         => ! empty($prc['PRC_ID']) ? $prc['PRC_ID'] : null,
894
+				'PRT_ID'         => $prt_id,
895
+				'PRC_amount'     => ! empty($prc['PRC_amount']) ? $prc['PRC_amount'] : 0,
896
+				'PRC_name'       => ! empty($prc['PRC_name']) ? $prc['PRC_name'] : '',
897
+				'PRC_desc'       => ! empty($prc['PRC_desc']) ? $prc['PRC_desc'] : '',
898
+				'PRC_is_default' => false,
899
+				// make sure we set PRC_is_default to false for all ticket saves from event_editor
900
+				'PRC_order'      => $row,
901
+			);
902
+			if ($new_prices || empty($PRC_values['PRC_ID'])) {
903
+				$PRC_values['PRC_ID'] = 0;
904
+				$price = EE_Registry::instance()->load_class(
905
+					'Price',
906
+					array($PRC_values),
907
+					false,
908
+					false
909
+				);
910
+			} else {
911
+				$price = EE_Registry::instance()->load_model('Price')->get_one_by_ID($prc['PRC_ID']);
912
+				// update this price with new values
913
+				foreach ($PRC_values as $field => $value) {
914
+					$price->set($field, $value);
915
+				}
916
+			}
917
+			$price->save();
918
+			$updated_prices[ $price->ID() ] = $price;
919
+			$ticket->_add_relation_to($price, 'Price');
920
+		}
921
+		// now let's remove any prices that got removed from the ticket
922
+		if (! empty($current_prices_on_ticket)) {
923
+			$current = array_keys($current_prices_on_ticket);
924
+			$updated = array_keys($updated_prices);
925
+			$prices_to_remove = array_diff($current, $updated);
926
+			if (! empty($prices_to_remove)) {
927
+				foreach ($prices_to_remove as $prc_id) {
928
+					$p = $current_prices_on_ticket[ $prc_id ];
929
+					$ticket->_remove_relation_to($p, 'Price');
930
+					// delete permanently the price
931
+					$p->delete_permanently();
932
+				}
933
+			}
934
+		}
935
+		return $ticket;
936
+	}
937 937
 
938 938
 
939
-    /**
940
-     * @param Events_Admin_Page $event_admin_obj
941
-     * @return Events_Admin_Page
942
-     */
943
-    public function autosave_handling(Events_Admin_Page $event_admin_obj)
944
-    {
945
-        return $event_admin_obj;
946
-        // doing nothing for the moment.
947
-        // todo when I get to this remember that I need to set the template args on the $event_admin_obj
948
-        // (use the set_template_args() method)
949
-        /**
950
-         * need to remember to handle TICKET DEFAULT saves correctly:  I've got two input fields in the dom:
951
-         * 1. TKT_is_default_selector (visible)
952
-         * 2. TKT_is_default (hidden)
953
-         * I think we'll use the TKT_is_default for recording whether the ticket displayed IS a default ticket
954
-         * (on new event creations). Whereas the TKT_is_default_selector is for the user to indicate they want
955
-         * this ticket to be saved as a default.
956
-         * The tricky part is, on an initial display on create or edit (or after manually updating),
957
-         * the TKT_is_default_selector will always be unselected and the TKT_is_default will only be true
958
-         * if this is a create.  However, after an autosave, users will want some sort of indicator that
959
-         * the TKT HAS been saved as a default..
960
-         * in other words we don't want to remove the check on TKT_is_default_selector. So here's what I'm thinking.
961
-         * On Autosave:
962
-         * 1. If TKT_is_default is true: we create a new TKT, send back the new id and add id to related elements,
963
-         * then set the TKT_is_default to false.
964
-         * 2. If TKT_is_default_selector is true: we create/edit existing ticket (following conditions above as well).
965
-         *  We do NOT create a new default ticket.  The checkbox stays selected after autosave.
966
-         * 3. only on MANUAL update do we check for the selection and if selected create the new default ticket.
967
-         */
968
-    }
939
+	/**
940
+	 * @param Events_Admin_Page $event_admin_obj
941
+	 * @return Events_Admin_Page
942
+	 */
943
+	public function autosave_handling(Events_Admin_Page $event_admin_obj)
944
+	{
945
+		return $event_admin_obj;
946
+		// doing nothing for the moment.
947
+		// todo when I get to this remember that I need to set the template args on the $event_admin_obj
948
+		// (use the set_template_args() method)
949
+		/**
950
+		 * need to remember to handle TICKET DEFAULT saves correctly:  I've got two input fields in the dom:
951
+		 * 1. TKT_is_default_selector (visible)
952
+		 * 2. TKT_is_default (hidden)
953
+		 * I think we'll use the TKT_is_default for recording whether the ticket displayed IS a default ticket
954
+		 * (on new event creations). Whereas the TKT_is_default_selector is for the user to indicate they want
955
+		 * this ticket to be saved as a default.
956
+		 * The tricky part is, on an initial display on create or edit (or after manually updating),
957
+		 * the TKT_is_default_selector will always be unselected and the TKT_is_default will only be true
958
+		 * if this is a create.  However, after an autosave, users will want some sort of indicator that
959
+		 * the TKT HAS been saved as a default..
960
+		 * in other words we don't want to remove the check on TKT_is_default_selector. So here's what I'm thinking.
961
+		 * On Autosave:
962
+		 * 1. If TKT_is_default is true: we create a new TKT, send back the new id and add id to related elements,
963
+		 * then set the TKT_is_default to false.
964
+		 * 2. If TKT_is_default_selector is true: we create/edit existing ticket (following conditions above as well).
965
+		 *  We do NOT create a new default ticket.  The checkbox stays selected after autosave.
966
+		 * 3. only on MANUAL update do we check for the selection and if selected create the new default ticket.
967
+		 */
968
+	}
969 969
 
970 970
 
971
-    /**
972
-     * @throws ReflectionException
973
-     * @throws InvalidArgumentException
974
-     * @throws InvalidInterfaceException
975
-     * @throws InvalidDataTypeException
976
-     * @throws DomainException
977
-     * @throws EE_Error
978
-     */
979
-    public function pricing_metabox()
980
-    {
981
-        $existing_datetime_ids = $existing_ticket_ids = $datetime_tickets = $ticket_datetimes = array();
982
-        $event = $this->_adminpage_obj->get_cpt_model_obj();
983
-        // set is_creating_event property.
984
-        $EVT_ID = $event->ID();
985
-        $this->_is_creating_event = empty($this->_req_data['post']);
986
-        // default main template args
987
-        $main_template_args = array(
988
-            'event_datetime_help_link' => EEH_Template::get_help_tab_link(
989
-                'event_editor_event_datetimes_help_tab',
990
-                $this->_adminpage_obj->page_slug,
991
-                $this->_adminpage_obj->get_req_action(),
992
-                false,
993
-                false
994
-            ),
995
-            // todo need to add a filter to the template for the help text
996
-            // in the Events_Admin_Page core file so we can add further help
997
-            'existing_datetime_ids'    => '',
998
-            'total_dtt_rows'           => 1,
999
-            'add_new_dtt_help_link'    => EEH_Template::get_help_tab_link(
1000
-                'add_new_dtt_info',
1001
-                $this->_adminpage_obj->page_slug,
1002
-                $this->_adminpage_obj->get_req_action(),
1003
-                false,
1004
-                false
1005
-            ),
1006
-            // todo need to add this help info id to the Events_Admin_Page core file so we can access it here.
1007
-            'datetime_rows'            => '',
1008
-            'show_tickets_container'   => '',
1009
-            // $this->_adminpage_obj->get_cpt_model_obj()->ID() > 1 ? ' style="display:none;"' : '',
1010
-            'ticket_rows'              => '',
1011
-            'existing_ticket_ids'      => '',
1012
-            'total_ticket_rows'        => 1,
1013
-            'ticket_js_structure'      => '',
1014
-            'ee_collapsible_status'    => ' ee-collapsible-open'
1015
-            // $this->_adminpage_obj->get_cpt_model_obj()->ID() > 0 ? ' ee-collapsible-closed' : ' ee-collapsible-open'
1016
-        );
1017
-        $timezone = $event instanceof EE_Event ? $event->timezone_string() : null;
1018
-        do_action('AHEE_log', __FILE__, __FUNCTION__, '');
1019
-        /**
1020
-         * 1. Start with retrieving Datetimes
1021
-         * 2. For each datetime get related tickets
1022
-         * 3. For each ticket get related prices
1023
-         */
1024
-        /** @var EEM_Datetime $datetime_model */
1025
-        $datetime_model = EE_Registry::instance()->load_model('Datetime', array($timezone));
1026
-        $datetimes = $datetime_model->get_all_event_dates($EVT_ID);
1027
-        $main_template_args['total_dtt_rows'] = count($datetimes);
1028
-        /**
1029
-         * @see https://events.codebasehq.com/projects/event-espresso/tickets/9486
1030
-         * for why we are counting $datetime_row and then setting that on the Datetime object
1031
-         */
1032
-        $datetime_row = 1;
1033
-        foreach ($datetimes as $datetime) {
1034
-            $DTT_ID = $datetime->get('DTT_ID');
1035
-            $datetime->set('DTT_order', $datetime_row);
1036
-            $existing_datetime_ids[] = $DTT_ID;
1037
-            // tickets attached
1038
-            $related_tickets = $datetime->ID() > 0
1039
-                ? $datetime->get_many_related(
1040
-                    'Ticket',
1041
-                    array(
1042
-                        array(
1043
-                            'OR' => array('TKT_deleted' => 1, 'TKT_deleted*' => 0),
1044
-                        ),
1045
-                        'default_where_conditions' => 'none',
1046
-                        'order_by'                 => array('TKT_order' => 'ASC'),
1047
-                    )
1048
-                )
1049
-                : array();
1050
-            // if there are no related tickets this is likely a new event OR autodraft
1051
-            // event so we need to generate the default tickets because datetimes
1052
-            // ALWAYS have at least one related ticket!!.  EXCEPT, we dont' do this if there is already more than one
1053
-            // datetime on the event.
1054
-            if (empty($related_tickets) && count($datetimes) < 2) {
1055
-                /** @var EEM_Ticket $ticket_model */
1056
-                $ticket_model = EE_Registry::instance()->load_model('Ticket');
1057
-                $related_tickets = $ticket_model->get_all_default_tickets();
1058
-                // this should be ordered by TKT_ID, so let's grab the first default ticket
1059
-                // (which will be the main default) and ensure it has any default prices added to it (but do NOT save).
1060
-                $default_prices = EEM_Price::instance()->get_all_default_prices();
1061
-                $main_default_ticket = reset($related_tickets);
1062
-                if ($main_default_ticket instanceof EE_Ticket) {
1063
-                    foreach ($default_prices as $default_price) {
1064
-                        if ($default_price instanceof EE_Price && $default_price->is_base_price()) {
1065
-                            continue;
1066
-                        }
1067
-                        $main_default_ticket->cache('Price', $default_price);
1068
-                    }
1069
-                }
1070
-            }
1071
-            // we can't actually setup rows in this loop yet cause we don't know all
1072
-            // the unique tickets for this event yet (tickets are linked through all datetimes).
1073
-            // So we're going to temporarily cache some of that information.
1074
-            // loop through and setup the ticket rows and make sure the order is set.
1075
-            foreach ($related_tickets as $ticket) {
1076
-                $TKT_ID = $ticket->get('TKT_ID');
1077
-                $ticket_row = $ticket->get('TKT_row');
1078
-                // we only want unique tickets in our final display!!
1079
-                if (! in_array($TKT_ID, $existing_ticket_ids, true)) {
1080
-                    $existing_ticket_ids[] = $TKT_ID;
1081
-                    $all_tickets[] = $ticket;
1082
-                }
1083
-                // temporary cache of this ticket info for this datetime for later processing of datetime rows.
1084
-                $datetime_tickets[ $DTT_ID ][] = $ticket_row;
1085
-                // temporary cache of this datetime info for this ticket for later processing of ticket rows.
1086
-                if (
1087
-                    ! isset($ticket_datetimes[ $TKT_ID ])
1088
-                    || ! in_array($datetime_row, $ticket_datetimes[ $TKT_ID ], true)
1089
-                ) {
1090
-                    $ticket_datetimes[ $TKT_ID ][] = $datetime_row;
1091
-                }
1092
-            }
1093
-            $datetime_row++;
1094
-        }
1095
-        $main_template_args['total_ticket_rows'] = count($existing_ticket_ids);
1096
-        $main_template_args['existing_ticket_ids'] = implode(',', $existing_ticket_ids);
1097
-        $main_template_args['existing_datetime_ids'] = implode(',', $existing_datetime_ids);
1098
-        // sort $all_tickets by order
1099
-        usort(
1100
-            $all_tickets,
1101
-            function (EE_Ticket $a, EE_Ticket $b) {
1102
-                $a_order = (int) $a->get('TKT_order');
1103
-                $b_order = (int) $b->get('TKT_order');
1104
-                if ($a_order === $b_order) {
1105
-                    return 0;
1106
-                }
1107
-                return ($a_order < $b_order) ? -1 : 1;
1108
-            }
1109
-        );
1110
-        // k NOW we have all the data we need for setting up the dtt rows
1111
-        // and ticket rows so we start our dtt loop again.
1112
-        $datetime_row = 1;
1113
-        foreach ($datetimes as $datetime) {
1114
-            $main_template_args['datetime_rows'] .= $this->_get_datetime_row(
1115
-                $datetime_row,
1116
-                $datetime,
1117
-                $datetime_tickets,
1118
-                $all_tickets,
1119
-                false,
1120
-                $datetimes
1121
-            );
1122
-            $datetime_row++;
1123
-        }
1124
-        // then loop through all tickets for the ticket rows.
1125
-        $ticket_row = 1;
1126
-        foreach ($all_tickets as $ticket) {
1127
-            $main_template_args['ticket_rows'] .= $this->_get_ticket_row(
1128
-                $ticket_row,
1129
-                $ticket,
1130
-                $ticket_datetimes,
1131
-                $datetimes,
1132
-                false,
1133
-                $all_tickets
1134
-            );
1135
-            $ticket_row++;
1136
-        }
1137
-        $main_template_args['ticket_js_structure'] = $this->_get_ticket_js_structure($datetimes, $all_tickets);
971
+	/**
972
+	 * @throws ReflectionException
973
+	 * @throws InvalidArgumentException
974
+	 * @throws InvalidInterfaceException
975
+	 * @throws InvalidDataTypeException
976
+	 * @throws DomainException
977
+	 * @throws EE_Error
978
+	 */
979
+	public function pricing_metabox()
980
+	{
981
+		$existing_datetime_ids = $existing_ticket_ids = $datetime_tickets = $ticket_datetimes = array();
982
+		$event = $this->_adminpage_obj->get_cpt_model_obj();
983
+		// set is_creating_event property.
984
+		$EVT_ID = $event->ID();
985
+		$this->_is_creating_event = empty($this->_req_data['post']);
986
+		// default main template args
987
+		$main_template_args = array(
988
+			'event_datetime_help_link' => EEH_Template::get_help_tab_link(
989
+				'event_editor_event_datetimes_help_tab',
990
+				$this->_adminpage_obj->page_slug,
991
+				$this->_adminpage_obj->get_req_action(),
992
+				false,
993
+				false
994
+			),
995
+			// todo need to add a filter to the template for the help text
996
+			// in the Events_Admin_Page core file so we can add further help
997
+			'existing_datetime_ids'    => '',
998
+			'total_dtt_rows'           => 1,
999
+			'add_new_dtt_help_link'    => EEH_Template::get_help_tab_link(
1000
+				'add_new_dtt_info',
1001
+				$this->_adminpage_obj->page_slug,
1002
+				$this->_adminpage_obj->get_req_action(),
1003
+				false,
1004
+				false
1005
+			),
1006
+			// todo need to add this help info id to the Events_Admin_Page core file so we can access it here.
1007
+			'datetime_rows'            => '',
1008
+			'show_tickets_container'   => '',
1009
+			// $this->_adminpage_obj->get_cpt_model_obj()->ID() > 1 ? ' style="display:none;"' : '',
1010
+			'ticket_rows'              => '',
1011
+			'existing_ticket_ids'      => '',
1012
+			'total_ticket_rows'        => 1,
1013
+			'ticket_js_structure'      => '',
1014
+			'ee_collapsible_status'    => ' ee-collapsible-open'
1015
+			// $this->_adminpage_obj->get_cpt_model_obj()->ID() > 0 ? ' ee-collapsible-closed' : ' ee-collapsible-open'
1016
+		);
1017
+		$timezone = $event instanceof EE_Event ? $event->timezone_string() : null;
1018
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
1019
+		/**
1020
+		 * 1. Start with retrieving Datetimes
1021
+		 * 2. For each datetime get related tickets
1022
+		 * 3. For each ticket get related prices
1023
+		 */
1024
+		/** @var EEM_Datetime $datetime_model */
1025
+		$datetime_model = EE_Registry::instance()->load_model('Datetime', array($timezone));
1026
+		$datetimes = $datetime_model->get_all_event_dates($EVT_ID);
1027
+		$main_template_args['total_dtt_rows'] = count($datetimes);
1028
+		/**
1029
+		 * @see https://events.codebasehq.com/projects/event-espresso/tickets/9486
1030
+		 * for why we are counting $datetime_row and then setting that on the Datetime object
1031
+		 */
1032
+		$datetime_row = 1;
1033
+		foreach ($datetimes as $datetime) {
1034
+			$DTT_ID = $datetime->get('DTT_ID');
1035
+			$datetime->set('DTT_order', $datetime_row);
1036
+			$existing_datetime_ids[] = $DTT_ID;
1037
+			// tickets attached
1038
+			$related_tickets = $datetime->ID() > 0
1039
+				? $datetime->get_many_related(
1040
+					'Ticket',
1041
+					array(
1042
+						array(
1043
+							'OR' => array('TKT_deleted' => 1, 'TKT_deleted*' => 0),
1044
+						),
1045
+						'default_where_conditions' => 'none',
1046
+						'order_by'                 => array('TKT_order' => 'ASC'),
1047
+					)
1048
+				)
1049
+				: array();
1050
+			// if there are no related tickets this is likely a new event OR autodraft
1051
+			// event so we need to generate the default tickets because datetimes
1052
+			// ALWAYS have at least one related ticket!!.  EXCEPT, we dont' do this if there is already more than one
1053
+			// datetime on the event.
1054
+			if (empty($related_tickets) && count($datetimes) < 2) {
1055
+				/** @var EEM_Ticket $ticket_model */
1056
+				$ticket_model = EE_Registry::instance()->load_model('Ticket');
1057
+				$related_tickets = $ticket_model->get_all_default_tickets();
1058
+				// this should be ordered by TKT_ID, so let's grab the first default ticket
1059
+				// (which will be the main default) and ensure it has any default prices added to it (but do NOT save).
1060
+				$default_prices = EEM_Price::instance()->get_all_default_prices();
1061
+				$main_default_ticket = reset($related_tickets);
1062
+				if ($main_default_ticket instanceof EE_Ticket) {
1063
+					foreach ($default_prices as $default_price) {
1064
+						if ($default_price instanceof EE_Price && $default_price->is_base_price()) {
1065
+							continue;
1066
+						}
1067
+						$main_default_ticket->cache('Price', $default_price);
1068
+					}
1069
+				}
1070
+			}
1071
+			// we can't actually setup rows in this loop yet cause we don't know all
1072
+			// the unique tickets for this event yet (tickets are linked through all datetimes).
1073
+			// So we're going to temporarily cache some of that information.
1074
+			// loop through and setup the ticket rows and make sure the order is set.
1075
+			foreach ($related_tickets as $ticket) {
1076
+				$TKT_ID = $ticket->get('TKT_ID');
1077
+				$ticket_row = $ticket->get('TKT_row');
1078
+				// we only want unique tickets in our final display!!
1079
+				if (! in_array($TKT_ID, $existing_ticket_ids, true)) {
1080
+					$existing_ticket_ids[] = $TKT_ID;
1081
+					$all_tickets[] = $ticket;
1082
+				}
1083
+				// temporary cache of this ticket info for this datetime for later processing of datetime rows.
1084
+				$datetime_tickets[ $DTT_ID ][] = $ticket_row;
1085
+				// temporary cache of this datetime info for this ticket for later processing of ticket rows.
1086
+				if (
1087
+					! isset($ticket_datetimes[ $TKT_ID ])
1088
+					|| ! in_array($datetime_row, $ticket_datetimes[ $TKT_ID ], true)
1089
+				) {
1090
+					$ticket_datetimes[ $TKT_ID ][] = $datetime_row;
1091
+				}
1092
+			}
1093
+			$datetime_row++;
1094
+		}
1095
+		$main_template_args['total_ticket_rows'] = count($existing_ticket_ids);
1096
+		$main_template_args['existing_ticket_ids'] = implode(',', $existing_ticket_ids);
1097
+		$main_template_args['existing_datetime_ids'] = implode(',', $existing_datetime_ids);
1098
+		// sort $all_tickets by order
1099
+		usort(
1100
+			$all_tickets,
1101
+			function (EE_Ticket $a, EE_Ticket $b) {
1102
+				$a_order = (int) $a->get('TKT_order');
1103
+				$b_order = (int) $b->get('TKT_order');
1104
+				if ($a_order === $b_order) {
1105
+					return 0;
1106
+				}
1107
+				return ($a_order < $b_order) ? -1 : 1;
1108
+			}
1109
+		);
1110
+		// k NOW we have all the data we need for setting up the dtt rows
1111
+		// and ticket rows so we start our dtt loop again.
1112
+		$datetime_row = 1;
1113
+		foreach ($datetimes as $datetime) {
1114
+			$main_template_args['datetime_rows'] .= $this->_get_datetime_row(
1115
+				$datetime_row,
1116
+				$datetime,
1117
+				$datetime_tickets,
1118
+				$all_tickets,
1119
+				false,
1120
+				$datetimes
1121
+			);
1122
+			$datetime_row++;
1123
+		}
1124
+		// then loop through all tickets for the ticket rows.
1125
+		$ticket_row = 1;
1126
+		foreach ($all_tickets as $ticket) {
1127
+			$main_template_args['ticket_rows'] .= $this->_get_ticket_row(
1128
+				$ticket_row,
1129
+				$ticket,
1130
+				$ticket_datetimes,
1131
+				$datetimes,
1132
+				false,
1133
+				$all_tickets
1134
+			);
1135
+			$ticket_row++;
1136
+		}
1137
+		$main_template_args['ticket_js_structure'] = $this->_get_ticket_js_structure($datetimes, $all_tickets);
1138 1138
 
1139
-        $status_change_notice = EventEspresso\core\services\loaders\LoaderFactory::getLoader()->getShared(
1140
-            'EventEspresso\core\admin\StatusChangeNotice'
1141
-        );
1142
-        if (! $status_change_notice->isDismissed()) {
1143
-            $main_template_args['status_change_notice'] = EEH_Template::display_template(
1144
-                EE_ADMIN_TEMPLATE . 'status_change_notice.template.php',
1145
-                ['context' => '__event-editor', 'page_slug' => 'espresso-events'],
1146
-                true
1147
-            );
1148
-        }
1139
+		$status_change_notice = EventEspresso\core\services\loaders\LoaderFactory::getLoader()->getShared(
1140
+			'EventEspresso\core\admin\StatusChangeNotice'
1141
+		);
1142
+		if (! $status_change_notice->isDismissed()) {
1143
+			$main_template_args['status_change_notice'] = EEH_Template::display_template(
1144
+				EE_ADMIN_TEMPLATE . 'status_change_notice.template.php',
1145
+				['context' => '__event-editor', 'page_slug' => 'espresso-events'],
1146
+				true
1147
+			);
1148
+		}
1149 1149
 
1150
-        EEH_Template::display_template(
1151
-            PRICING_TEMPLATE_PATH . 'event_tickets_metabox_main.template.php',
1152
-            $main_template_args
1153
-        );
1154
-    }
1150
+		EEH_Template::display_template(
1151
+			PRICING_TEMPLATE_PATH . 'event_tickets_metabox_main.template.php',
1152
+			$main_template_args
1153
+		);
1154
+	}
1155 1155
 
1156 1156
 
1157
-    /**
1158
-     * @param int         $datetime_row
1159
-     * @param EE_Datetime $datetime
1160
-     * @param array       $datetime_tickets
1161
-     * @param array       $all_tickets
1162
-     * @param bool        $default
1163
-     * @param array       $all_datetimes
1164
-     * @return mixed
1165
-     * @throws DomainException
1166
-     * @throws EE_Error
1167
-     */
1168
-    protected function _get_datetime_row(
1169
-        $datetime_row,
1170
-        EE_Datetime $datetime,
1171
-        $datetime_tickets = array(),
1172
-        $all_tickets = array(),
1173
-        $default = false,
1174
-        $all_datetimes = array()
1175
-    ) {
1176
-        $dtt_display_template_args = array(
1177
-            'dtt_edit_row'             => $this->_get_dtt_edit_row(
1178
-                $datetime_row,
1179
-                $datetime,
1180
-                $default,
1181
-                $all_datetimes
1182
-            ),
1183
-            'dtt_attached_tickets_row' => $this->_get_dtt_attached_tickets_row(
1184
-                $datetime_row,
1185
-                $datetime,
1186
-                $datetime_tickets,
1187
-                $all_tickets,
1188
-                $default
1189
-            ),
1190
-            'dtt_row'                  => $default ? 'DTTNUM' : $datetime_row,
1191
-        );
1192
-        return EEH_Template::display_template(
1193
-            PRICING_TEMPLATE_PATH . 'event_tickets_datetime_row_wrapper.template.php',
1194
-            $dtt_display_template_args,
1195
-            true
1196
-        );
1197
-    }
1157
+	/**
1158
+	 * @param int         $datetime_row
1159
+	 * @param EE_Datetime $datetime
1160
+	 * @param array       $datetime_tickets
1161
+	 * @param array       $all_tickets
1162
+	 * @param bool        $default
1163
+	 * @param array       $all_datetimes
1164
+	 * @return mixed
1165
+	 * @throws DomainException
1166
+	 * @throws EE_Error
1167
+	 */
1168
+	protected function _get_datetime_row(
1169
+		$datetime_row,
1170
+		EE_Datetime $datetime,
1171
+		$datetime_tickets = array(),
1172
+		$all_tickets = array(),
1173
+		$default = false,
1174
+		$all_datetimes = array()
1175
+	) {
1176
+		$dtt_display_template_args = array(
1177
+			'dtt_edit_row'             => $this->_get_dtt_edit_row(
1178
+				$datetime_row,
1179
+				$datetime,
1180
+				$default,
1181
+				$all_datetimes
1182
+			),
1183
+			'dtt_attached_tickets_row' => $this->_get_dtt_attached_tickets_row(
1184
+				$datetime_row,
1185
+				$datetime,
1186
+				$datetime_tickets,
1187
+				$all_tickets,
1188
+				$default
1189
+			),
1190
+			'dtt_row'                  => $default ? 'DTTNUM' : $datetime_row,
1191
+		);
1192
+		return EEH_Template::display_template(
1193
+			PRICING_TEMPLATE_PATH . 'event_tickets_datetime_row_wrapper.template.php',
1194
+			$dtt_display_template_args,
1195
+			true
1196
+		);
1197
+	}
1198 1198
 
1199 1199
 
1200
-    /**
1201
-     * This method is used to generate a dtt fields  edit row.
1202
-     * The same row is used to generate a row with valid DTT objects
1203
-     * and the default row that is used as the skeleton by the js.
1204
-     *
1205
-     * @param int           $datetime_row  The row number for the row being generated.
1206
-     * @param EE_Datetime   $datetime
1207
-     * @param bool          $default       Whether a default row is being generated or not.
1208
-     * @param EE_Datetime[] $all_datetimes This is the array of all datetimes used in the editor.
1209
-     * @return string
1210
-     * @throws DomainException
1211
-     * @throws EE_Error
1212
-     */
1213
-    protected function _get_dtt_edit_row($datetime_row, $datetime, $default, $all_datetimes)
1214
-    {
1215
-        // if the incoming $datetime object is NOT an instance of EE_Datetime then force default to true.
1216
-        $default = ! $datetime instanceof EE_Datetime ? true : $default;
1217
-        $template_args = array(
1218
-            'dtt_row'              => $default ? 'DTTNUM' : $datetime_row,
1219
-            'event_datetimes_name' => $default ? 'DTTNAMEATTR' : 'edit_event_datetimes',
1220
-            'edit_dtt_expanded'    => '',
1221
-            'DTT_ID'               => $default ? '' : $datetime->ID(),
1222
-            'DTT_name'             => $default ? '' : $datetime->get_f('DTT_name'),
1223
-            'DTT_description'      => $default ? '' : $datetime->get_f('DTT_description'),
1224
-            'DTT_EVT_start'        => $default ? '' : $datetime->start_date($this->_date_time_format),
1225
-            'DTT_EVT_end'          => $default ? '' : $datetime->end_date($this->_date_time_format),
1226
-            'DTT_reg_limit'        => $default
1227
-                ? ''
1228
-                : $datetime->get_pretty(
1229
-                    'DTT_reg_limit',
1230
-                    'input'
1231
-                ),
1232
-            'DTT_order'            => $default ? 'DTTNUM' : $datetime_row,
1233
-            'dtt_sold'             => $default ? '0' : $datetime->get('DTT_sold'),
1234
-            'dtt_reserved'         => $default ? '0' : $datetime->reserved(),
1235
-            'clone_icon'           => ! empty($datetime) && $datetime->get('DTT_sold') > 0
1236
-                ? ''
1237
-                : 'clone-icon ee-icon ee-icon-clone clickable',
1238
-            'trash_icon'           => ! empty($datetime) && $datetime->get('DTT_sold') > 0
1239
-                ? 'dashicons dashicons-lock'
1240
-                : 'trash-icon dashicons dashicons-post-trash clickable',
1241
-            'reg_list_url'         => $default || ! $datetime->event() instanceof \EE_Event
1242
-                ? ''
1243
-                : EE_Admin_Page::add_query_args_and_nonce(
1244
-                    array('event_id' => $datetime->event()->ID(), 'datetime_id' => $datetime->ID()),
1245
-                    REG_ADMIN_URL
1246
-                ),
1247
-        );
1248
-        $template_args['show_trash'] = count($all_datetimes) === 1 && $template_args['trash_icon'] !== 'dashicons dashicons-lock'
1249
-            ? ' style="display:none"'
1250
-            : '';
1251
-        // allow filtering of template args at this point.
1252
-        $template_args = apply_filters(
1253
-            'FHEE__espresso_events_Pricing_Hooks___get_dtt_edit_row__template_args',
1254
-            $template_args,
1255
-            $datetime_row,
1256
-            $datetime,
1257
-            $default,
1258
-            $all_datetimes,
1259
-            $this->_is_creating_event
1260
-        );
1261
-        return EEH_Template::display_template(
1262
-            PRICING_TEMPLATE_PATH . 'event_tickets_datetime_edit_row.template.php',
1263
-            $template_args,
1264
-            true
1265
-        );
1266
-    }
1200
+	/**
1201
+	 * This method is used to generate a dtt fields  edit row.
1202
+	 * The same row is used to generate a row with valid DTT objects
1203
+	 * and the default row that is used as the skeleton by the js.
1204
+	 *
1205
+	 * @param int           $datetime_row  The row number for the row being generated.
1206
+	 * @param EE_Datetime   $datetime
1207
+	 * @param bool          $default       Whether a default row is being generated or not.
1208
+	 * @param EE_Datetime[] $all_datetimes This is the array of all datetimes used in the editor.
1209
+	 * @return string
1210
+	 * @throws DomainException
1211
+	 * @throws EE_Error
1212
+	 */
1213
+	protected function _get_dtt_edit_row($datetime_row, $datetime, $default, $all_datetimes)
1214
+	{
1215
+		// if the incoming $datetime object is NOT an instance of EE_Datetime then force default to true.
1216
+		$default = ! $datetime instanceof EE_Datetime ? true : $default;
1217
+		$template_args = array(
1218
+			'dtt_row'              => $default ? 'DTTNUM' : $datetime_row,
1219
+			'event_datetimes_name' => $default ? 'DTTNAMEATTR' : 'edit_event_datetimes',
1220
+			'edit_dtt_expanded'    => '',
1221
+			'DTT_ID'               => $default ? '' : $datetime->ID(),
1222
+			'DTT_name'             => $default ? '' : $datetime->get_f('DTT_name'),
1223
+			'DTT_description'      => $default ? '' : $datetime->get_f('DTT_description'),
1224
+			'DTT_EVT_start'        => $default ? '' : $datetime->start_date($this->_date_time_format),
1225
+			'DTT_EVT_end'          => $default ? '' : $datetime->end_date($this->_date_time_format),
1226
+			'DTT_reg_limit'        => $default
1227
+				? ''
1228
+				: $datetime->get_pretty(
1229
+					'DTT_reg_limit',
1230
+					'input'
1231
+				),
1232
+			'DTT_order'            => $default ? 'DTTNUM' : $datetime_row,
1233
+			'dtt_sold'             => $default ? '0' : $datetime->get('DTT_sold'),
1234
+			'dtt_reserved'         => $default ? '0' : $datetime->reserved(),
1235
+			'clone_icon'           => ! empty($datetime) && $datetime->get('DTT_sold') > 0
1236
+				? ''
1237
+				: 'clone-icon ee-icon ee-icon-clone clickable',
1238
+			'trash_icon'           => ! empty($datetime) && $datetime->get('DTT_sold') > 0
1239
+				? 'dashicons dashicons-lock'
1240
+				: 'trash-icon dashicons dashicons-post-trash clickable',
1241
+			'reg_list_url'         => $default || ! $datetime->event() instanceof \EE_Event
1242
+				? ''
1243
+				: EE_Admin_Page::add_query_args_and_nonce(
1244
+					array('event_id' => $datetime->event()->ID(), 'datetime_id' => $datetime->ID()),
1245
+					REG_ADMIN_URL
1246
+				),
1247
+		);
1248
+		$template_args['show_trash'] = count($all_datetimes) === 1 && $template_args['trash_icon'] !== 'dashicons dashicons-lock'
1249
+			? ' style="display:none"'
1250
+			: '';
1251
+		// allow filtering of template args at this point.
1252
+		$template_args = apply_filters(
1253
+			'FHEE__espresso_events_Pricing_Hooks___get_dtt_edit_row__template_args',
1254
+			$template_args,
1255
+			$datetime_row,
1256
+			$datetime,
1257
+			$default,
1258
+			$all_datetimes,
1259
+			$this->_is_creating_event
1260
+		);
1261
+		return EEH_Template::display_template(
1262
+			PRICING_TEMPLATE_PATH . 'event_tickets_datetime_edit_row.template.php',
1263
+			$template_args,
1264
+			true
1265
+		);
1266
+	}
1267 1267
 
1268 1268
 
1269
-    /**
1270
-     * @param int         $datetime_row
1271
-     * @param EE_Datetime $datetime
1272
-     * @param array       $datetime_tickets
1273
-     * @param array       $all_tickets
1274
-     * @param bool        $default
1275
-     * @return mixed
1276
-     * @throws DomainException
1277
-     * @throws EE_Error
1278
-     */
1279
-    protected function _get_dtt_attached_tickets_row(
1280
-        $datetime_row,
1281
-        $datetime,
1282
-        $datetime_tickets = array(),
1283
-        $all_tickets = array(),
1284
-        $default
1285
-    ) {
1286
-        $template_args = array(
1287
-            'dtt_row'                           => $default ? 'DTTNUM' : $datetime_row,
1288
-            'event_datetimes_name'              => $default ? 'DTTNAMEATTR' : 'edit_event_datetimes',
1289
-            'DTT_description'                   => $default ? '' : $datetime->get_f('DTT_description'),
1290
-            'datetime_tickets_list'             => $default ? '<li class="hidden"></li>' : '',
1291
-            'show_tickets_row'                  => ' style="display:none;"',
1292
-            'add_new_datetime_ticket_help_link' => EEH_Template::get_help_tab_link(
1293
-                'add_new_ticket_via_datetime',
1294
-                $this->_adminpage_obj->page_slug,
1295
-                $this->_adminpage_obj->get_req_action(),
1296
-                false,
1297
-                false
1298
-            ),
1299
-            // todo need to add this help info id to the Events_Admin_Page core file so we can access it here.
1300
-            'DTT_ID'                            => $default ? '' : $datetime->ID(),
1301
-        );
1302
-        // need to setup the list items (but only if this isn't a default skeleton setup)
1303
-        if (! $default) {
1304
-            $ticket_row = 1;
1305
-            foreach ($all_tickets as $ticket) {
1306
-                $template_args['datetime_tickets_list'] .= $this->_get_datetime_tickets_list_item(
1307
-                    $datetime_row,
1308
-                    $ticket_row,
1309
-                    $datetime,
1310
-                    $ticket,
1311
-                    $datetime_tickets,
1312
-                    $default
1313
-                );
1314
-                $ticket_row++;
1315
-            }
1316
-        }
1317
-        // filter template args at this point
1318
-        $template_args = apply_filters(
1319
-            'FHEE__espresso_events_Pricing_Hooks___get_dtt_attached_ticket_row__template_args',
1320
-            $template_args,
1321
-            $datetime_row,
1322
-            $datetime,
1323
-            $datetime_tickets,
1324
-            $all_tickets,
1325
-            $default,
1326
-            $this->_is_creating_event
1327
-        );
1328
-        return EEH_Template::display_template(
1329
-            PRICING_TEMPLATE_PATH . 'event_tickets_datetime_attached_tickets_row.template.php',
1330
-            $template_args,
1331
-            true
1332
-        );
1333
-    }
1269
+	/**
1270
+	 * @param int         $datetime_row
1271
+	 * @param EE_Datetime $datetime
1272
+	 * @param array       $datetime_tickets
1273
+	 * @param array       $all_tickets
1274
+	 * @param bool        $default
1275
+	 * @return mixed
1276
+	 * @throws DomainException
1277
+	 * @throws EE_Error
1278
+	 */
1279
+	protected function _get_dtt_attached_tickets_row(
1280
+		$datetime_row,
1281
+		$datetime,
1282
+		$datetime_tickets = array(),
1283
+		$all_tickets = array(),
1284
+		$default
1285
+	) {
1286
+		$template_args = array(
1287
+			'dtt_row'                           => $default ? 'DTTNUM' : $datetime_row,
1288
+			'event_datetimes_name'              => $default ? 'DTTNAMEATTR' : 'edit_event_datetimes',
1289
+			'DTT_description'                   => $default ? '' : $datetime->get_f('DTT_description'),
1290
+			'datetime_tickets_list'             => $default ? '<li class="hidden"></li>' : '',
1291
+			'show_tickets_row'                  => ' style="display:none;"',
1292
+			'add_new_datetime_ticket_help_link' => EEH_Template::get_help_tab_link(
1293
+				'add_new_ticket_via_datetime',
1294
+				$this->_adminpage_obj->page_slug,
1295
+				$this->_adminpage_obj->get_req_action(),
1296
+				false,
1297
+				false
1298
+			),
1299
+			// todo need to add this help info id to the Events_Admin_Page core file so we can access it here.
1300
+			'DTT_ID'                            => $default ? '' : $datetime->ID(),
1301
+		);
1302
+		// need to setup the list items (but only if this isn't a default skeleton setup)
1303
+		if (! $default) {
1304
+			$ticket_row = 1;
1305
+			foreach ($all_tickets as $ticket) {
1306
+				$template_args['datetime_tickets_list'] .= $this->_get_datetime_tickets_list_item(
1307
+					$datetime_row,
1308
+					$ticket_row,
1309
+					$datetime,
1310
+					$ticket,
1311
+					$datetime_tickets,
1312
+					$default
1313
+				);
1314
+				$ticket_row++;
1315
+			}
1316
+		}
1317
+		// filter template args at this point
1318
+		$template_args = apply_filters(
1319
+			'FHEE__espresso_events_Pricing_Hooks___get_dtt_attached_ticket_row__template_args',
1320
+			$template_args,
1321
+			$datetime_row,
1322
+			$datetime,
1323
+			$datetime_tickets,
1324
+			$all_tickets,
1325
+			$default,
1326
+			$this->_is_creating_event
1327
+		);
1328
+		return EEH_Template::display_template(
1329
+			PRICING_TEMPLATE_PATH . 'event_tickets_datetime_attached_tickets_row.template.php',
1330
+			$template_args,
1331
+			true
1332
+		);
1333
+	}
1334 1334
 
1335 1335
 
1336
-    /**
1337
-     * @param int         $datetime_row
1338
-     * @param int         $ticket_row
1339
-     * @param EE_Datetime $datetime
1340
-     * @param EE_Ticket   $ticket
1341
-     * @param array       $datetime_tickets
1342
-     * @param bool        $default
1343
-     * @return mixed
1344
-     * @throws DomainException
1345
-     * @throws EE_Error
1346
-     */
1347
-    protected function _get_datetime_tickets_list_item(
1348
-        $datetime_row,
1349
-        $ticket_row,
1350
-        $datetime,
1351
-        $ticket,
1352
-        $datetime_tickets = array(),
1353
-        $default
1354
-    ) {
1355
-        $dtt_tkts = $datetime instanceof EE_Datetime && isset($datetime_tickets[ $datetime->ID() ])
1356
-            ? $datetime_tickets[ $datetime->ID() ]
1357
-            : array();
1358
-        $display_row = $ticket instanceof EE_Ticket ? $ticket->get('TKT_row') : 0;
1359
-        $no_ticket = $default && empty($ticket);
1360
-        $template_args = array(
1361
-            'dtt_row'                 => $default
1362
-                ? 'DTTNUM'
1363
-                : $datetime_row,
1364
-            'tkt_row'                 => $no_ticket
1365
-                ? 'TICKETNUM'
1366
-                : $ticket_row,
1367
-            'datetime_ticket_checked' => in_array($display_row, $dtt_tkts, true)
1368
-                ? ' checked="checked"'
1369
-                : '',
1370
-            'ticket_selected'         => in_array($display_row, $dtt_tkts, true)
1371
-                ? ' ticket-selected'
1372
-                : '',
1373
-            'TKT_name'                => $no_ticket
1374
-                ? 'TKTNAME'
1375
-                : $ticket->get('TKT_name'),
1376
-            'tkt_status_class'        => $no_ticket || $this->_is_creating_event
1377
-                ? ' tkt-status-' . EE_Ticket::onsale
1378
-                : ' tkt-status-' . $ticket->ticket_status(),
1379
-        );
1380
-        // filter template args
1381
-        $template_args = apply_filters(
1382
-            'FHEE__espresso_events_Pricing_Hooks___get_datetime_tickets_list_item__template_args',
1383
-            $template_args,
1384
-            $datetime_row,
1385
-            $ticket_row,
1386
-            $datetime,
1387
-            $ticket,
1388
-            $datetime_tickets,
1389
-            $default,
1390
-            $this->_is_creating_event
1391
-        );
1392
-        return EEH_Template::display_template(
1393
-            PRICING_TEMPLATE_PATH . 'event_tickets_datetime_dtt_tickets_list.template.php',
1394
-            $template_args,
1395
-            true
1396
-        );
1397
-    }
1336
+	/**
1337
+	 * @param int         $datetime_row
1338
+	 * @param int         $ticket_row
1339
+	 * @param EE_Datetime $datetime
1340
+	 * @param EE_Ticket   $ticket
1341
+	 * @param array       $datetime_tickets
1342
+	 * @param bool        $default
1343
+	 * @return mixed
1344
+	 * @throws DomainException
1345
+	 * @throws EE_Error
1346
+	 */
1347
+	protected function _get_datetime_tickets_list_item(
1348
+		$datetime_row,
1349
+		$ticket_row,
1350
+		$datetime,
1351
+		$ticket,
1352
+		$datetime_tickets = array(),
1353
+		$default
1354
+	) {
1355
+		$dtt_tkts = $datetime instanceof EE_Datetime && isset($datetime_tickets[ $datetime->ID() ])
1356
+			? $datetime_tickets[ $datetime->ID() ]
1357
+			: array();
1358
+		$display_row = $ticket instanceof EE_Ticket ? $ticket->get('TKT_row') : 0;
1359
+		$no_ticket = $default && empty($ticket);
1360
+		$template_args = array(
1361
+			'dtt_row'                 => $default
1362
+				? 'DTTNUM'
1363
+				: $datetime_row,
1364
+			'tkt_row'                 => $no_ticket
1365
+				? 'TICKETNUM'
1366
+				: $ticket_row,
1367
+			'datetime_ticket_checked' => in_array($display_row, $dtt_tkts, true)
1368
+				? ' checked="checked"'
1369
+				: '',
1370
+			'ticket_selected'         => in_array($display_row, $dtt_tkts, true)
1371
+				? ' ticket-selected'
1372
+				: '',
1373
+			'TKT_name'                => $no_ticket
1374
+				? 'TKTNAME'
1375
+				: $ticket->get('TKT_name'),
1376
+			'tkt_status_class'        => $no_ticket || $this->_is_creating_event
1377
+				? ' tkt-status-' . EE_Ticket::onsale
1378
+				: ' tkt-status-' . $ticket->ticket_status(),
1379
+		);
1380
+		// filter template args
1381
+		$template_args = apply_filters(
1382
+			'FHEE__espresso_events_Pricing_Hooks___get_datetime_tickets_list_item__template_args',
1383
+			$template_args,
1384
+			$datetime_row,
1385
+			$ticket_row,
1386
+			$datetime,
1387
+			$ticket,
1388
+			$datetime_tickets,
1389
+			$default,
1390
+			$this->_is_creating_event
1391
+		);
1392
+		return EEH_Template::display_template(
1393
+			PRICING_TEMPLATE_PATH . 'event_tickets_datetime_dtt_tickets_list.template.php',
1394
+			$template_args,
1395
+			true
1396
+		);
1397
+	}
1398 1398
 
1399 1399
 
1400
-    /**
1401
-     * This generates the ticket row for tickets.
1402
-     * This same method is used to generate both the actual rows and the js skeleton row
1403
-     * (when default === true)
1404
-     *
1405
-     * @param int           $ticket_row       Represents the row number being generated.
1406
-     * @param               $ticket
1407
-     * @param EE_Datetime[] $ticket_datetimes Either an array of all datetimes on all tickets indexed by each ticket
1408
-     *                                        or empty for default
1409
-     * @param EE_Datetime[] $all_datetimes    All Datetimes on the event or empty for default.
1410
-     * @param bool          $default          Whether default row being generated or not.
1411
-     * @param EE_Ticket[]   $all_tickets      This is an array of all tickets attached to the event
1412
-     *                                        (or empty in the case of defaults)
1413
-     * @return mixed
1414
-     * @throws InvalidArgumentException
1415
-     * @throws InvalidInterfaceException
1416
-     * @throws InvalidDataTypeException
1417
-     * @throws DomainException
1418
-     * @throws EE_Error
1419
-     * @throws ReflectionException
1420
-     */
1421
-    protected function _get_ticket_row(
1422
-        $ticket_row,
1423
-        $ticket,
1424
-        $ticket_datetimes,
1425
-        $all_datetimes,
1426
-        $default = false,
1427
-        $all_tickets = array()
1428
-    ) {
1429
-        // if $ticket is not an instance of EE_Ticket then force default to true.
1430
-        $default = ! $ticket instanceof EE_Ticket ? true : $default;
1431
-        $prices = ! empty($ticket) && ! $default
1432
-            ? $ticket->get_many_related(
1433
-                'Price',
1434
-                array('default_where_conditions' => 'none', 'order_by' => array('PRC_order' => 'ASC'))
1435
-            )
1436
-            : array();
1437
-        // if there is only one price (which would be the base price)
1438
-        // or NO prices and this ticket is a default ticket,
1439
-        // let's just make sure there are no cached default prices on the object.
1440
-        // This is done by not including any query_params.
1441
-        if ($ticket instanceof EE_Ticket && $ticket->is_default() && (count($prices) === 1 || empty($prices))) {
1442
-            $prices = $ticket->prices();
1443
-        }
1444
-        // check if we're dealing with a default ticket in which case
1445
-        // we don't want any starting_ticket_datetime_row values set
1446
-        // (otherwise there won't be any new relationships created for tickets based off of the default ticket).
1447
-        // This will future proof in case there is ever any behaviour change between what the primary_key defaults to.
1448
-        $default_dtt = $default || ($ticket instanceof EE_Ticket && $ticket->is_default());
1449
-        $tkt_datetimes = $ticket instanceof EE_Ticket && isset($ticket_datetimes[ $ticket->ID() ])
1450
-            ? $ticket_datetimes[ $ticket->ID() ]
1451
-            : array();
1452
-        $ticket_subtotal = $default ? 0 : $ticket->get_ticket_subtotal();
1453
-        $base_price = $default ? null : $ticket->base_price();
1454
-        $count_price_mods = EEM_Price::instance()->get_all_default_prices(true);
1455
-        // breaking out complicated condition for ticket_status
1456
-        if ($default) {
1457
-            $ticket_status_class = ' tkt-status-' . EE_Ticket::onsale;
1458
-        } else {
1459
-            $ticket_status_class = $ticket->is_default()
1460
-                ? ' tkt-status-' . EE_Ticket::onsale
1461
-                : ' tkt-status-' . $ticket->ticket_status();
1462
-        }
1463
-        // breaking out complicated condition for TKT_taxable
1464
-        if ($default) {
1465
-            $TKT_taxable = '';
1466
-        } else {
1467
-            $TKT_taxable = $ticket->taxable()
1468
-                ? ' checked="checked"'
1469
-                : '';
1470
-        }
1471
-        if ($default) {
1472
-            $TKT_status = EEH_Template::pretty_status(EE_Ticket::onsale, false, 'sentence');
1473
-        } elseif ($ticket->is_default()) {
1474
-            $TKT_status = EEH_Template::pretty_status(EE_Ticket::onsale, false, 'sentence');
1475
-        } else {
1476
-            $TKT_status = $ticket->ticket_status(true);
1477
-        }
1478
-        if ($default) {
1479
-            $TKT_min = '';
1480
-        } else {
1481
-            $TKT_min = $ticket->min();
1482
-            if ($TKT_min === -1 || $TKT_min === 0) {
1483
-                $TKT_min = '';
1484
-            }
1485
-        }
1486
-        $template_args = array(
1487
-            'tkt_row'                       => $default ? 'TICKETNUM' : $ticket_row,
1488
-            'TKT_order'                     => $default ? 'TICKETNUM' : $ticket_row,
1489
-            // on initial page load this will always be the correct order.
1490
-            'tkt_status_class'              => $ticket_status_class,
1491
-            'display_edit_tkt_row'          => ' style="display:none;"',
1492
-            'edit_tkt_expanded'             => '',
1493
-            'edit_tickets_name'             => $default ? 'TICKETNAMEATTR' : 'edit_tickets',
1494
-            'TKT_name'                      => $default ? '' : $ticket->get_f('TKT_name'),
1495
-            'TKT_start_date'                => $default
1496
-                ? ''
1497
-                : $ticket->get_date('TKT_start_date', $this->_date_time_format),
1498
-            'TKT_end_date'                  => $default
1499
-                ? ''
1500
-                : $ticket->get_date('TKT_end_date', $this->_date_time_format),
1501
-            'TKT_status'                    => $TKT_status,
1502
-            'TKT_price'                     => $default
1503
-                ? ''
1504
-                : EEH_Template::format_currency(
1505
-                    $ticket->get_ticket_total_with_taxes(),
1506
-                    false,
1507
-                    false
1508
-                ),
1509
-            'TKT_price_code'                => EE_Registry::instance()->CFG->currency->code,
1510
-            'TKT_price_amount'              => $default ? 0 : $ticket_subtotal,
1511
-            'TKT_qty'                       => $default
1512
-                ? ''
1513
-                : $ticket->get_pretty('TKT_qty', 'symbol'),
1514
-            'TKT_qty_for_input'             => $default
1515
-                ? ''
1516
-                : $ticket->get_pretty('TKT_qty', 'input'),
1517
-            'TKT_uses'                      => $default
1518
-                ? ''
1519
-                : $ticket->get_pretty('TKT_uses', 'input'),
1520
-            'TKT_min'                       => $TKT_min,
1521
-            'TKT_max'                       => $default
1522
-                ? ''
1523
-                : $ticket->get_pretty('TKT_max', 'input'),
1524
-            'TKT_sold'                      => $default ? 0 : $ticket->tickets_sold('ticket'),
1525
-            'TKT_reserved'                  => $default ? 0 : $ticket->reserved(),
1526
-            'TKT_registrations'             => $default
1527
-                ? 0
1528
-                : $ticket->count_registrations(
1529
-                    array(
1530
-                        array(
1531
-                            'STS_ID' => array(
1532
-                                '!=',
1533
-                                EEM_Registration::status_id_incomplete,
1534
-                            ),
1535
-                        ),
1536
-                    )
1537
-                ),
1538
-            'TKT_ID'                        => $default ? 0 : $ticket->ID(),
1539
-            'TKT_description'               => $default ? '' : $ticket->get_f('TKT_description'),
1540
-            'TKT_is_default'                => $default ? 0 : $ticket->is_default(),
1541
-            'TKT_required'                  => $default ? 0 : $ticket->required(),
1542
-            'TKT_is_default_selector'       => '',
1543
-            'ticket_price_rows'             => '',
1544
-            'TKT_base_price'                => $default || ! $base_price instanceof EE_Price
1545
-                ? ''
1546
-                : $base_price->get_pretty('PRC_amount', 'localized_float'),
1547
-            'TKT_base_price_ID'             => $default || ! $base_price instanceof EE_Price ? 0 : $base_price->ID(),
1548
-            'show_price_modifier'           => count($prices) > 1 || ($default && $count_price_mods > 0)
1549
-                ? ''
1550
-                : ' style="display:none;"',
1551
-            'show_price_mod_button'         => count($prices) > 1
1552
-                                               || ($default && $count_price_mods > 0)
1553
-                                               || (! $default && $ticket->deleted())
1554
-                ? ' style="display:none;"'
1555
-                : '',
1556
-            'total_price_rows'              => count($prices) > 1 ? count($prices) : 1,
1557
-            'ticket_datetimes_list'         => $default ? '<li class="hidden"></li>' : '',
1558
-            'starting_ticket_datetime_rows' => $default || $default_dtt ? '' : implode(',', $tkt_datetimes),
1559
-            'ticket_datetime_rows'          => $default ? '' : implode(',', $tkt_datetimes),
1560
-            'existing_ticket_price_ids'     => $default ? '' : implode(',', array_keys($prices)),
1561
-            'ticket_template_id'            => $default ? 0 : $ticket->get('TTM_ID'),
1562
-            'TKT_taxable'                   => $TKT_taxable,
1563
-            'display_subtotal'              => $ticket instanceof EE_Ticket && $ticket->taxable()
1564
-                ? ''
1565
-                : ' style="display:none"',
1566
-            'price_currency_symbol'         => EE_Registry::instance()->CFG->currency->sign,
1567
-            'TKT_subtotal_amount_display'   => EEH_Template::format_currency(
1568
-                $ticket_subtotal,
1569
-                false,
1570
-                false
1571
-            ),
1572
-            'TKT_subtotal_amount'           => $ticket_subtotal,
1573
-            'tax_rows'                      => $this->_get_tax_rows($ticket_row, $ticket),
1574
-            'disabled'                      => $ticket instanceof EE_Ticket && $ticket->deleted(),
1575
-            'ticket_archive_class'          => $ticket instanceof EE_Ticket && $ticket->deleted()
1576
-                ? ' ticket-archived'
1577
-                : '',
1578
-            'trash_icon'                    => $ticket instanceof EE_Ticket
1579
-                                               && $ticket->deleted()
1580
-                                               && ! $ticket->is_permanently_deleteable()
1581
-                ? 'dashicons dashicons-lock '
1582
-                : 'trash-icon dashicons dashicons-post-trash clickable',
1583
-            'clone_icon'                    => $ticket instanceof EE_Ticket && $ticket->deleted()
1584
-                ? ''
1585
-                : 'clone-icon ee-icon ee-icon-clone clickable',
1586
-        );
1587
-        $template_args['trash_hidden'] = count($all_tickets) === 1 && $template_args['trash_icon'] !== 'dashicons dashicons-lock'
1588
-            ? ' style="display:none"'
1589
-            : '';
1590
-        // handle rows that should NOT be empty
1591
-        if (empty($template_args['TKT_start_date'])) {
1592
-            // if empty then the start date will be now.
1593
-            $template_args['TKT_start_date'] = date(
1594
-                $this->_date_time_format,
1595
-                current_time('timestamp')
1596
-            );
1597
-            $template_args['tkt_status_class'] = ' tkt-status-' . EE_Ticket::onsale;
1598
-        }
1599
-        if (empty($template_args['TKT_end_date'])) {
1600
-            // get the earliest datetime (if present);
1601
-            $earliest_dtt = $this->_adminpage_obj->get_cpt_model_obj()->ID() > 0
1602
-                ? $this->_adminpage_obj->get_cpt_model_obj()->get_first_related(
1603
-                    'Datetime',
1604
-                    array('order_by' => array('DTT_EVT_start' => 'ASC'))
1605
-                )
1606
-                : null;
1607
-            if (! empty($earliest_dtt)) {
1608
-                $template_args['TKT_end_date'] = $earliest_dtt->get_datetime(
1609
-                    'DTT_EVT_start',
1610
-                    $this->_date_time_format
1611
-                );
1612
-            } else {
1613
-                // default so let's just use what's been set for the default date-time which is 30 days from now.
1614
-                $template_args['TKT_end_date'] = date(
1615
-                    $this->_date_time_format,
1616
-                    mktime(
1617
-                        24,
1618
-                        0,
1619
-                        0,
1620
-                        date('m'),
1621
-                        date('d') + 29,
1622
-                        date('Y')
1623
-                    )
1624
-                );
1625
-            }
1626
-            $template_args['tkt_status_class'] = ' tkt-status-' . EE_Ticket::onsale;
1627
-        }
1628
-        // generate ticket_datetime items
1629
-        if (! $default) {
1630
-            $datetime_row = 1;
1631
-            foreach ($all_datetimes as $datetime) {
1632
-                $template_args['ticket_datetimes_list'] .= $this->_get_ticket_datetime_list_item(
1633
-                    $datetime_row,
1634
-                    $ticket_row,
1635
-                    $datetime,
1636
-                    $ticket,
1637
-                    $ticket_datetimes,
1638
-                    $default
1639
-                );
1640
-                $datetime_row++;
1641
-            }
1642
-        }
1643
-        $price_row = 1;
1644
-        foreach ($prices as $price) {
1645
-            if (! $price instanceof EE_Price) {
1646
-                continue;
1647
-            }
1648
-            if ($price->is_base_price()) {
1649
-                $price_row++;
1650
-                continue;
1651
-            }
1652
-            $show_trash = ! ((count($prices) > 1 && $price_row === 1) || count($prices) === 1);
1653
-            $show_create = ! (count($prices) > 1 && count($prices) !== $price_row);
1654
-            $template_args['ticket_price_rows'] .= $this->_get_ticket_price_row(
1655
-                $ticket_row,
1656
-                $price_row,
1657
-                $price,
1658
-                $default,
1659
-                $ticket,
1660
-                $show_trash,
1661
-                $show_create
1662
-            );
1663
-            $price_row++;
1664
-        }
1665
-        // filter $template_args
1666
-        $template_args = apply_filters(
1667
-            'FHEE__espresso_events_Pricing_Hooks___get_ticket_row__template_args',
1668
-            $template_args,
1669
-            $ticket_row,
1670
-            $ticket,
1671
-            $ticket_datetimes,
1672
-            $all_datetimes,
1673
-            $default,
1674
-            $all_tickets,
1675
-            $this->_is_creating_event
1676
-        );
1677
-        return EEH_Template::display_template(
1678
-            PRICING_TEMPLATE_PATH . 'event_tickets_datetime_ticket_row.template.php',
1679
-            $template_args,
1680
-            true
1681
-        );
1682
-    }
1400
+	/**
1401
+	 * This generates the ticket row for tickets.
1402
+	 * This same method is used to generate both the actual rows and the js skeleton row
1403
+	 * (when default === true)
1404
+	 *
1405
+	 * @param int           $ticket_row       Represents the row number being generated.
1406
+	 * @param               $ticket
1407
+	 * @param EE_Datetime[] $ticket_datetimes Either an array of all datetimes on all tickets indexed by each ticket
1408
+	 *                                        or empty for default
1409
+	 * @param EE_Datetime[] $all_datetimes    All Datetimes on the event or empty for default.
1410
+	 * @param bool          $default          Whether default row being generated or not.
1411
+	 * @param EE_Ticket[]   $all_tickets      This is an array of all tickets attached to the event
1412
+	 *                                        (or empty in the case of defaults)
1413
+	 * @return mixed
1414
+	 * @throws InvalidArgumentException
1415
+	 * @throws InvalidInterfaceException
1416
+	 * @throws InvalidDataTypeException
1417
+	 * @throws DomainException
1418
+	 * @throws EE_Error
1419
+	 * @throws ReflectionException
1420
+	 */
1421
+	protected function _get_ticket_row(
1422
+		$ticket_row,
1423
+		$ticket,
1424
+		$ticket_datetimes,
1425
+		$all_datetimes,
1426
+		$default = false,
1427
+		$all_tickets = array()
1428
+	) {
1429
+		// if $ticket is not an instance of EE_Ticket then force default to true.
1430
+		$default = ! $ticket instanceof EE_Ticket ? true : $default;
1431
+		$prices = ! empty($ticket) && ! $default
1432
+			? $ticket->get_many_related(
1433
+				'Price',
1434
+				array('default_where_conditions' => 'none', 'order_by' => array('PRC_order' => 'ASC'))
1435
+			)
1436
+			: array();
1437
+		// if there is only one price (which would be the base price)
1438
+		// or NO prices and this ticket is a default ticket,
1439
+		// let's just make sure there are no cached default prices on the object.
1440
+		// This is done by not including any query_params.
1441
+		if ($ticket instanceof EE_Ticket && $ticket->is_default() && (count($prices) === 1 || empty($prices))) {
1442
+			$prices = $ticket->prices();
1443
+		}
1444
+		// check if we're dealing with a default ticket in which case
1445
+		// we don't want any starting_ticket_datetime_row values set
1446
+		// (otherwise there won't be any new relationships created for tickets based off of the default ticket).
1447
+		// This will future proof in case there is ever any behaviour change between what the primary_key defaults to.
1448
+		$default_dtt = $default || ($ticket instanceof EE_Ticket && $ticket->is_default());
1449
+		$tkt_datetimes = $ticket instanceof EE_Ticket && isset($ticket_datetimes[ $ticket->ID() ])
1450
+			? $ticket_datetimes[ $ticket->ID() ]
1451
+			: array();
1452
+		$ticket_subtotal = $default ? 0 : $ticket->get_ticket_subtotal();
1453
+		$base_price = $default ? null : $ticket->base_price();
1454
+		$count_price_mods = EEM_Price::instance()->get_all_default_prices(true);
1455
+		// breaking out complicated condition for ticket_status
1456
+		if ($default) {
1457
+			$ticket_status_class = ' tkt-status-' . EE_Ticket::onsale;
1458
+		} else {
1459
+			$ticket_status_class = $ticket->is_default()
1460
+				? ' tkt-status-' . EE_Ticket::onsale
1461
+				: ' tkt-status-' . $ticket->ticket_status();
1462
+		}
1463
+		// breaking out complicated condition for TKT_taxable
1464
+		if ($default) {
1465
+			$TKT_taxable = '';
1466
+		} else {
1467
+			$TKT_taxable = $ticket->taxable()
1468
+				? ' checked="checked"'
1469
+				: '';
1470
+		}
1471
+		if ($default) {
1472
+			$TKT_status = EEH_Template::pretty_status(EE_Ticket::onsale, false, 'sentence');
1473
+		} elseif ($ticket->is_default()) {
1474
+			$TKT_status = EEH_Template::pretty_status(EE_Ticket::onsale, false, 'sentence');
1475
+		} else {
1476
+			$TKT_status = $ticket->ticket_status(true);
1477
+		}
1478
+		if ($default) {
1479
+			$TKT_min = '';
1480
+		} else {
1481
+			$TKT_min = $ticket->min();
1482
+			if ($TKT_min === -1 || $TKT_min === 0) {
1483
+				$TKT_min = '';
1484
+			}
1485
+		}
1486
+		$template_args = array(
1487
+			'tkt_row'                       => $default ? 'TICKETNUM' : $ticket_row,
1488
+			'TKT_order'                     => $default ? 'TICKETNUM' : $ticket_row,
1489
+			// on initial page load this will always be the correct order.
1490
+			'tkt_status_class'              => $ticket_status_class,
1491
+			'display_edit_tkt_row'          => ' style="display:none;"',
1492
+			'edit_tkt_expanded'             => '',
1493
+			'edit_tickets_name'             => $default ? 'TICKETNAMEATTR' : 'edit_tickets',
1494
+			'TKT_name'                      => $default ? '' : $ticket->get_f('TKT_name'),
1495
+			'TKT_start_date'                => $default
1496
+				? ''
1497
+				: $ticket->get_date('TKT_start_date', $this->_date_time_format),
1498
+			'TKT_end_date'                  => $default
1499
+				? ''
1500
+				: $ticket->get_date('TKT_end_date', $this->_date_time_format),
1501
+			'TKT_status'                    => $TKT_status,
1502
+			'TKT_price'                     => $default
1503
+				? ''
1504
+				: EEH_Template::format_currency(
1505
+					$ticket->get_ticket_total_with_taxes(),
1506
+					false,
1507
+					false
1508
+				),
1509
+			'TKT_price_code'                => EE_Registry::instance()->CFG->currency->code,
1510
+			'TKT_price_amount'              => $default ? 0 : $ticket_subtotal,
1511
+			'TKT_qty'                       => $default
1512
+				? ''
1513
+				: $ticket->get_pretty('TKT_qty', 'symbol'),
1514
+			'TKT_qty_for_input'             => $default
1515
+				? ''
1516
+				: $ticket->get_pretty('TKT_qty', 'input'),
1517
+			'TKT_uses'                      => $default
1518
+				? ''
1519
+				: $ticket->get_pretty('TKT_uses', 'input'),
1520
+			'TKT_min'                       => $TKT_min,
1521
+			'TKT_max'                       => $default
1522
+				? ''
1523
+				: $ticket->get_pretty('TKT_max', 'input'),
1524
+			'TKT_sold'                      => $default ? 0 : $ticket->tickets_sold('ticket'),
1525
+			'TKT_reserved'                  => $default ? 0 : $ticket->reserved(),
1526
+			'TKT_registrations'             => $default
1527
+				? 0
1528
+				: $ticket->count_registrations(
1529
+					array(
1530
+						array(
1531
+							'STS_ID' => array(
1532
+								'!=',
1533
+								EEM_Registration::status_id_incomplete,
1534
+							),
1535
+						),
1536
+					)
1537
+				),
1538
+			'TKT_ID'                        => $default ? 0 : $ticket->ID(),
1539
+			'TKT_description'               => $default ? '' : $ticket->get_f('TKT_description'),
1540
+			'TKT_is_default'                => $default ? 0 : $ticket->is_default(),
1541
+			'TKT_required'                  => $default ? 0 : $ticket->required(),
1542
+			'TKT_is_default_selector'       => '',
1543
+			'ticket_price_rows'             => '',
1544
+			'TKT_base_price'                => $default || ! $base_price instanceof EE_Price
1545
+				? ''
1546
+				: $base_price->get_pretty('PRC_amount', 'localized_float'),
1547
+			'TKT_base_price_ID'             => $default || ! $base_price instanceof EE_Price ? 0 : $base_price->ID(),
1548
+			'show_price_modifier'           => count($prices) > 1 || ($default && $count_price_mods > 0)
1549
+				? ''
1550
+				: ' style="display:none;"',
1551
+			'show_price_mod_button'         => count($prices) > 1
1552
+											   || ($default && $count_price_mods > 0)
1553
+											   || (! $default && $ticket->deleted())
1554
+				? ' style="display:none;"'
1555
+				: '',
1556
+			'total_price_rows'              => count($prices) > 1 ? count($prices) : 1,
1557
+			'ticket_datetimes_list'         => $default ? '<li class="hidden"></li>' : '',
1558
+			'starting_ticket_datetime_rows' => $default || $default_dtt ? '' : implode(',', $tkt_datetimes),
1559
+			'ticket_datetime_rows'          => $default ? '' : implode(',', $tkt_datetimes),
1560
+			'existing_ticket_price_ids'     => $default ? '' : implode(',', array_keys($prices)),
1561
+			'ticket_template_id'            => $default ? 0 : $ticket->get('TTM_ID'),
1562
+			'TKT_taxable'                   => $TKT_taxable,
1563
+			'display_subtotal'              => $ticket instanceof EE_Ticket && $ticket->taxable()
1564
+				? ''
1565
+				: ' style="display:none"',
1566
+			'price_currency_symbol'         => EE_Registry::instance()->CFG->currency->sign,
1567
+			'TKT_subtotal_amount_display'   => EEH_Template::format_currency(
1568
+				$ticket_subtotal,
1569
+				false,
1570
+				false
1571
+			),
1572
+			'TKT_subtotal_amount'           => $ticket_subtotal,
1573
+			'tax_rows'                      => $this->_get_tax_rows($ticket_row, $ticket),
1574
+			'disabled'                      => $ticket instanceof EE_Ticket && $ticket->deleted(),
1575
+			'ticket_archive_class'          => $ticket instanceof EE_Ticket && $ticket->deleted()
1576
+				? ' ticket-archived'
1577
+				: '',
1578
+			'trash_icon'                    => $ticket instanceof EE_Ticket
1579
+											   && $ticket->deleted()
1580
+											   && ! $ticket->is_permanently_deleteable()
1581
+				? 'dashicons dashicons-lock '
1582
+				: 'trash-icon dashicons dashicons-post-trash clickable',
1583
+			'clone_icon'                    => $ticket instanceof EE_Ticket && $ticket->deleted()
1584
+				? ''
1585
+				: 'clone-icon ee-icon ee-icon-clone clickable',
1586
+		);
1587
+		$template_args['trash_hidden'] = count($all_tickets) === 1 && $template_args['trash_icon'] !== 'dashicons dashicons-lock'
1588
+			? ' style="display:none"'
1589
+			: '';
1590
+		// handle rows that should NOT be empty
1591
+		if (empty($template_args['TKT_start_date'])) {
1592
+			// if empty then the start date will be now.
1593
+			$template_args['TKT_start_date'] = date(
1594
+				$this->_date_time_format,
1595
+				current_time('timestamp')
1596
+			);
1597
+			$template_args['tkt_status_class'] = ' tkt-status-' . EE_Ticket::onsale;
1598
+		}
1599
+		if (empty($template_args['TKT_end_date'])) {
1600
+			// get the earliest datetime (if present);
1601
+			$earliest_dtt = $this->_adminpage_obj->get_cpt_model_obj()->ID() > 0
1602
+				? $this->_adminpage_obj->get_cpt_model_obj()->get_first_related(
1603
+					'Datetime',
1604
+					array('order_by' => array('DTT_EVT_start' => 'ASC'))
1605
+				)
1606
+				: null;
1607
+			if (! empty($earliest_dtt)) {
1608
+				$template_args['TKT_end_date'] = $earliest_dtt->get_datetime(
1609
+					'DTT_EVT_start',
1610
+					$this->_date_time_format
1611
+				);
1612
+			} else {
1613
+				// default so let's just use what's been set for the default date-time which is 30 days from now.
1614
+				$template_args['TKT_end_date'] = date(
1615
+					$this->_date_time_format,
1616
+					mktime(
1617
+						24,
1618
+						0,
1619
+						0,
1620
+						date('m'),
1621
+						date('d') + 29,
1622
+						date('Y')
1623
+					)
1624
+				);
1625
+			}
1626
+			$template_args['tkt_status_class'] = ' tkt-status-' . EE_Ticket::onsale;
1627
+		}
1628
+		// generate ticket_datetime items
1629
+		if (! $default) {
1630
+			$datetime_row = 1;
1631
+			foreach ($all_datetimes as $datetime) {
1632
+				$template_args['ticket_datetimes_list'] .= $this->_get_ticket_datetime_list_item(
1633
+					$datetime_row,
1634
+					$ticket_row,
1635
+					$datetime,
1636
+					$ticket,
1637
+					$ticket_datetimes,
1638
+					$default
1639
+				);
1640
+				$datetime_row++;
1641
+			}
1642
+		}
1643
+		$price_row = 1;
1644
+		foreach ($prices as $price) {
1645
+			if (! $price instanceof EE_Price) {
1646
+				continue;
1647
+			}
1648
+			if ($price->is_base_price()) {
1649
+				$price_row++;
1650
+				continue;
1651
+			}
1652
+			$show_trash = ! ((count($prices) > 1 && $price_row === 1) || count($prices) === 1);
1653
+			$show_create = ! (count($prices) > 1 && count($prices) !== $price_row);
1654
+			$template_args['ticket_price_rows'] .= $this->_get_ticket_price_row(
1655
+				$ticket_row,
1656
+				$price_row,
1657
+				$price,
1658
+				$default,
1659
+				$ticket,
1660
+				$show_trash,
1661
+				$show_create
1662
+			);
1663
+			$price_row++;
1664
+		}
1665
+		// filter $template_args
1666
+		$template_args = apply_filters(
1667
+			'FHEE__espresso_events_Pricing_Hooks___get_ticket_row__template_args',
1668
+			$template_args,
1669
+			$ticket_row,
1670
+			$ticket,
1671
+			$ticket_datetimes,
1672
+			$all_datetimes,
1673
+			$default,
1674
+			$all_tickets,
1675
+			$this->_is_creating_event
1676
+		);
1677
+		return EEH_Template::display_template(
1678
+			PRICING_TEMPLATE_PATH . 'event_tickets_datetime_ticket_row.template.php',
1679
+			$template_args,
1680
+			true
1681
+		);
1682
+	}
1683 1683
 
1684 1684
 
1685
-    /**
1686
-     * @param int            $ticket_row
1687
-     * @param EE_Ticket|null $ticket
1688
-     * @return string
1689
-     * @throws DomainException
1690
-     * @throws EE_Error
1691
-     */
1692
-    protected function _get_tax_rows($ticket_row, $ticket)
1693
-    {
1694
-        $tax_rows = '';
1695
-        /** @var EE_Price[] $taxes */
1696
-        $taxes = empty($ticket) ? EE_Taxes::get_taxes_for_admin() : $ticket->get_ticket_taxes_for_admin();
1697
-        foreach ($taxes as $tax) {
1698
-            $tax_added = $this->_get_tax_added($tax, $ticket);
1699
-            $template_args = array(
1700
-                'display_tax'       => ! empty($ticket) && $ticket->get('TKT_taxable')
1701
-                    ? ''
1702
-                    : ' style="display:none;"',
1703
-                'tax_id'            => $tax->ID(),
1704
-                'tkt_row'           => $ticket_row,
1705
-                'tax_label'         => $tax->get('PRC_name'),
1706
-                'tax_added'         => $tax_added,
1707
-                'tax_added_display' => EEH_Template::format_currency($tax_added, false, false),
1708
-                'tax_amount'        => $tax->get('PRC_amount'),
1709
-            );
1710
-            $template_args = apply_filters(
1711
-                'FHEE__espresso_events_Pricing_Hooks___get_tax_rows__template_args',
1712
-                $template_args,
1713
-                $ticket_row,
1714
-                $ticket,
1715
-                $this->_is_creating_event
1716
-            );
1717
-            $tax_rows .= EEH_Template::display_template(
1718
-                PRICING_TEMPLATE_PATH . 'event_tickets_datetime_ticket_tax_row.template.php',
1719
-                $template_args,
1720
-                true
1721
-            );
1722
-        }
1723
-        return $tax_rows;
1724
-    }
1685
+	/**
1686
+	 * @param int            $ticket_row
1687
+	 * @param EE_Ticket|null $ticket
1688
+	 * @return string
1689
+	 * @throws DomainException
1690
+	 * @throws EE_Error
1691
+	 */
1692
+	protected function _get_tax_rows($ticket_row, $ticket)
1693
+	{
1694
+		$tax_rows = '';
1695
+		/** @var EE_Price[] $taxes */
1696
+		$taxes = empty($ticket) ? EE_Taxes::get_taxes_for_admin() : $ticket->get_ticket_taxes_for_admin();
1697
+		foreach ($taxes as $tax) {
1698
+			$tax_added = $this->_get_tax_added($tax, $ticket);
1699
+			$template_args = array(
1700
+				'display_tax'       => ! empty($ticket) && $ticket->get('TKT_taxable')
1701
+					? ''
1702
+					: ' style="display:none;"',
1703
+				'tax_id'            => $tax->ID(),
1704
+				'tkt_row'           => $ticket_row,
1705
+				'tax_label'         => $tax->get('PRC_name'),
1706
+				'tax_added'         => $tax_added,
1707
+				'tax_added_display' => EEH_Template::format_currency($tax_added, false, false),
1708
+				'tax_amount'        => $tax->get('PRC_amount'),
1709
+			);
1710
+			$template_args = apply_filters(
1711
+				'FHEE__espresso_events_Pricing_Hooks___get_tax_rows__template_args',
1712
+				$template_args,
1713
+				$ticket_row,
1714
+				$ticket,
1715
+				$this->_is_creating_event
1716
+			);
1717
+			$tax_rows .= EEH_Template::display_template(
1718
+				PRICING_TEMPLATE_PATH . 'event_tickets_datetime_ticket_tax_row.template.php',
1719
+				$template_args,
1720
+				true
1721
+			);
1722
+		}
1723
+		return $tax_rows;
1724
+	}
1725 1725
 
1726 1726
 
1727
-    /**
1728
-     * @param EE_Price       $tax
1729
-     * @param EE_Ticket|null $ticket
1730
-     * @return float|int
1731
-     * @throws EE_Error
1732
-     */
1733
-    protected function _get_tax_added(EE_Price $tax, $ticket)
1734
-    {
1735
-        $subtotal = empty($ticket) ? 0 : $ticket->get_ticket_subtotal();
1736
-        return $subtotal * $tax->get('PRC_amount') / 100;
1737
-    }
1727
+	/**
1728
+	 * @param EE_Price       $tax
1729
+	 * @param EE_Ticket|null $ticket
1730
+	 * @return float|int
1731
+	 * @throws EE_Error
1732
+	 */
1733
+	protected function _get_tax_added(EE_Price $tax, $ticket)
1734
+	{
1735
+		$subtotal = empty($ticket) ? 0 : $ticket->get_ticket_subtotal();
1736
+		return $subtotal * $tax->get('PRC_amount') / 100;
1737
+	}
1738 1738
 
1739 1739
 
1740
-    /**
1741
-     * @param int            $ticket_row
1742
-     * @param int            $price_row
1743
-     * @param EE_Price|null  $price
1744
-     * @param bool           $default
1745
-     * @param EE_Ticket|null $ticket
1746
-     * @param bool           $show_trash
1747
-     * @param bool           $show_create
1748
-     * @return mixed
1749
-     * @throws InvalidArgumentException
1750
-     * @throws InvalidInterfaceException
1751
-     * @throws InvalidDataTypeException
1752
-     * @throws DomainException
1753
-     * @throws EE_Error
1754
-     * @throws ReflectionException
1755
-     */
1756
-    protected function _get_ticket_price_row(
1757
-        $ticket_row,
1758
-        $price_row,
1759
-        $price,
1760
-        $default,
1761
-        $ticket,
1762
-        $show_trash = true,
1763
-        $show_create = true
1764
-    ) {
1765
-        $send_disabled = ! empty($ticket) && $ticket->get('TKT_deleted');
1766
-        $template_args = array(
1767
-            'tkt_row'               => $default && empty($ticket)
1768
-                ? 'TICKETNUM'
1769
-                : $ticket_row,
1770
-            'PRC_order'             => $default && empty($price)
1771
-                ? 'PRICENUM'
1772
-                : $price_row,
1773
-            'edit_prices_name'      => $default && empty($price)
1774
-                ? 'PRICENAMEATTR'
1775
-                : 'edit_prices',
1776
-            'price_type_selector'   => $default && empty($price)
1777
-                ? $this->_get_base_price_template($ticket_row, $price_row, $price, $default)
1778
-                : $this->_get_price_type_selector(
1779
-                    $ticket_row,
1780
-                    $price_row,
1781
-                    $price,
1782
-                    $default,
1783
-                    $send_disabled
1784
-                ),
1785
-            'PRC_ID'                => $default && empty($price)
1786
-                ? 0
1787
-                : $price->ID(),
1788
-            'PRC_is_default'        => $default && empty($price)
1789
-                ? 0
1790
-                : $price->get('PRC_is_default'),
1791
-            'PRC_name'              => $default && empty($price)
1792
-                ? ''
1793
-                : $price->get('PRC_name'),
1794
-            'price_currency_symbol' => EE_Registry::instance()->CFG->currency->sign,
1795
-            'show_plus_or_minus'    => $default && empty($price)
1796
-                ? ''
1797
-                : ' style="display:none;"',
1798
-            'show_plus'             => ($default && empty($price)) || ($price->is_discount() || $price->is_base_price())
1799
-                ? ' style="display:none;"'
1800
-                : '',
1801
-            'show_minus'            => ($default && empty($price)) || ! $price->is_discount()
1802
-                ? ' style="display:none;"'
1803
-                : '',
1804
-            'show_currency_symbol'  => ($default && empty($price)) || $price->is_percent()
1805
-                ? ' style="display:none"'
1806
-                : '',
1807
-            'PRC_amount'            => $default && empty($price)
1808
-                ? 0
1809
-                : $price->get_pretty('PRC_amount', 'localized_float'),
1810
-            'show_percentage'       => ($default && empty($price)) || ! $price->is_percent()
1811
-                ? ' style="display:none;"'
1812
-                : '',
1813
-            'show_trash_icon'       => $show_trash
1814
-                ? ''
1815
-                : ' style="display:none;"',
1816
-            'show_create_button'    => $show_create
1817
-                ? ''
1818
-                : ' style="display:none;"',
1819
-            'PRC_desc'              => $default && empty($price)
1820
-                ? ''
1821
-                : $price->get('PRC_desc'),
1822
-            'disabled'              => ! empty($ticket) && $ticket->get('TKT_deleted'),
1823
-        );
1824
-        $template_args = apply_filters(
1825
-            'FHEE__espresso_events_Pricing_Hooks___get_ticket_price_row__template_args',
1826
-            $template_args,
1827
-            $ticket_row,
1828
-            $price_row,
1829
-            $price,
1830
-            $default,
1831
-            $ticket,
1832
-            $show_trash,
1833
-            $show_create,
1834
-            $this->_is_creating_event
1835
-        );
1836
-        return EEH_Template::display_template(
1837
-            PRICING_TEMPLATE_PATH . 'event_tickets_datetime_ticket_price_row.template.php',
1838
-            $template_args,
1839
-            true
1840
-        );
1841
-    }
1740
+	/**
1741
+	 * @param int            $ticket_row
1742
+	 * @param int            $price_row
1743
+	 * @param EE_Price|null  $price
1744
+	 * @param bool           $default
1745
+	 * @param EE_Ticket|null $ticket
1746
+	 * @param bool           $show_trash
1747
+	 * @param bool           $show_create
1748
+	 * @return mixed
1749
+	 * @throws InvalidArgumentException
1750
+	 * @throws InvalidInterfaceException
1751
+	 * @throws InvalidDataTypeException
1752
+	 * @throws DomainException
1753
+	 * @throws EE_Error
1754
+	 * @throws ReflectionException
1755
+	 */
1756
+	protected function _get_ticket_price_row(
1757
+		$ticket_row,
1758
+		$price_row,
1759
+		$price,
1760
+		$default,
1761
+		$ticket,
1762
+		$show_trash = true,
1763
+		$show_create = true
1764
+	) {
1765
+		$send_disabled = ! empty($ticket) && $ticket->get('TKT_deleted');
1766
+		$template_args = array(
1767
+			'tkt_row'               => $default && empty($ticket)
1768
+				? 'TICKETNUM'
1769
+				: $ticket_row,
1770
+			'PRC_order'             => $default && empty($price)
1771
+				? 'PRICENUM'
1772
+				: $price_row,
1773
+			'edit_prices_name'      => $default && empty($price)
1774
+				? 'PRICENAMEATTR'
1775
+				: 'edit_prices',
1776
+			'price_type_selector'   => $default && empty($price)
1777
+				? $this->_get_base_price_template($ticket_row, $price_row, $price, $default)
1778
+				: $this->_get_price_type_selector(
1779
+					$ticket_row,
1780
+					$price_row,
1781
+					$price,
1782
+					$default,
1783
+					$send_disabled
1784
+				),
1785
+			'PRC_ID'                => $default && empty($price)
1786
+				? 0
1787
+				: $price->ID(),
1788
+			'PRC_is_default'        => $default && empty($price)
1789
+				? 0
1790
+				: $price->get('PRC_is_default'),
1791
+			'PRC_name'              => $default && empty($price)
1792
+				? ''
1793
+				: $price->get('PRC_name'),
1794
+			'price_currency_symbol' => EE_Registry::instance()->CFG->currency->sign,
1795
+			'show_plus_or_minus'    => $default && empty($price)
1796
+				? ''
1797
+				: ' style="display:none;"',
1798
+			'show_plus'             => ($default && empty($price)) || ($price->is_discount() || $price->is_base_price())
1799
+				? ' style="display:none;"'
1800
+				: '',
1801
+			'show_minus'            => ($default && empty($price)) || ! $price->is_discount()
1802
+				? ' style="display:none;"'
1803
+				: '',
1804
+			'show_currency_symbol'  => ($default && empty($price)) || $price->is_percent()
1805
+				? ' style="display:none"'
1806
+				: '',
1807
+			'PRC_amount'            => $default && empty($price)
1808
+				? 0
1809
+				: $price->get_pretty('PRC_amount', 'localized_float'),
1810
+			'show_percentage'       => ($default && empty($price)) || ! $price->is_percent()
1811
+				? ' style="display:none;"'
1812
+				: '',
1813
+			'show_trash_icon'       => $show_trash
1814
+				? ''
1815
+				: ' style="display:none;"',
1816
+			'show_create_button'    => $show_create
1817
+				? ''
1818
+				: ' style="display:none;"',
1819
+			'PRC_desc'              => $default && empty($price)
1820
+				? ''
1821
+				: $price->get('PRC_desc'),
1822
+			'disabled'              => ! empty($ticket) && $ticket->get('TKT_deleted'),
1823
+		);
1824
+		$template_args = apply_filters(
1825
+			'FHEE__espresso_events_Pricing_Hooks___get_ticket_price_row__template_args',
1826
+			$template_args,
1827
+			$ticket_row,
1828
+			$price_row,
1829
+			$price,
1830
+			$default,
1831
+			$ticket,
1832
+			$show_trash,
1833
+			$show_create,
1834
+			$this->_is_creating_event
1835
+		);
1836
+		return EEH_Template::display_template(
1837
+			PRICING_TEMPLATE_PATH . 'event_tickets_datetime_ticket_price_row.template.php',
1838
+			$template_args,
1839
+			true
1840
+		);
1841
+	}
1842 1842
 
1843 1843
 
1844
-    /**
1845
-     * @param int      $ticket_row
1846
-     * @param int      $price_row
1847
-     * @param EE_Price $price
1848
-     * @param bool     $default
1849
-     * @param bool     $disabled
1850
-     * @return mixed
1851
-     * @throws ReflectionException
1852
-     * @throws InvalidArgumentException
1853
-     * @throws InvalidInterfaceException
1854
-     * @throws InvalidDataTypeException
1855
-     * @throws DomainException
1856
-     * @throws EE_Error
1857
-     */
1858
-    protected function _get_price_type_selector($ticket_row, $price_row, $price, $default, $disabled = false)
1859
-    {
1860
-        if ($price->is_base_price()) {
1861
-            return $this->_get_base_price_template(
1862
-                $ticket_row,
1863
-                $price_row,
1864
-                $price,
1865
-                $default
1866
-            );
1867
-        }
1868
-        return $this->_get_price_modifier_template(
1869
-            $ticket_row,
1870
-            $price_row,
1871
-            $price,
1872
-            $default,
1873
-            $disabled
1874
-        );
1875
-    }
1844
+	/**
1845
+	 * @param int      $ticket_row
1846
+	 * @param int      $price_row
1847
+	 * @param EE_Price $price
1848
+	 * @param bool     $default
1849
+	 * @param bool     $disabled
1850
+	 * @return mixed
1851
+	 * @throws ReflectionException
1852
+	 * @throws InvalidArgumentException
1853
+	 * @throws InvalidInterfaceException
1854
+	 * @throws InvalidDataTypeException
1855
+	 * @throws DomainException
1856
+	 * @throws EE_Error
1857
+	 */
1858
+	protected function _get_price_type_selector($ticket_row, $price_row, $price, $default, $disabled = false)
1859
+	{
1860
+		if ($price->is_base_price()) {
1861
+			return $this->_get_base_price_template(
1862
+				$ticket_row,
1863
+				$price_row,
1864
+				$price,
1865
+				$default
1866
+			);
1867
+		}
1868
+		return $this->_get_price_modifier_template(
1869
+			$ticket_row,
1870
+			$price_row,
1871
+			$price,
1872
+			$default,
1873
+			$disabled
1874
+		);
1875
+	}
1876 1876
 
1877 1877
 
1878
-    /**
1879
-     * @param int      $ticket_row
1880
-     * @param int      $price_row
1881
-     * @param EE_Price $price
1882
-     * @param bool     $default
1883
-     * @return mixed
1884
-     * @throws DomainException
1885
-     * @throws EE_Error
1886
-     */
1887
-    protected function _get_base_price_template($ticket_row, $price_row, $price, $default)
1888
-    {
1889
-        $template_args = array(
1890
-            'tkt_row'                   => $default ? 'TICKETNUM' : $ticket_row,
1891
-            'PRC_order'                 => $default && empty($price) ? 'PRICENUM' : $price_row,
1892
-            'PRT_ID'                    => $default && empty($price) ? 1 : $price->get('PRT_ID'),
1893
-            'PRT_name'                  => esc_html__('Price', 'event_espresso'),
1894
-            'price_selected_operator'   => '+',
1895
-            'price_selected_is_percent' => 0,
1896
-        );
1897
-        $template_args = apply_filters(
1898
-            'FHEE__espresso_events_Pricing_Hooks___get_base_price_template__template_args',
1899
-            $template_args,
1900
-            $ticket_row,
1901
-            $price_row,
1902
-            $price,
1903
-            $default,
1904
-            $this->_is_creating_event
1905
-        );
1906
-        return EEH_Template::display_template(
1907
-            PRICING_TEMPLATE_PATH . 'event_tickets_datetime_price_type_base.template.php',
1908
-            $template_args,
1909
-            true
1910
-        );
1911
-    }
1878
+	/**
1879
+	 * @param int      $ticket_row
1880
+	 * @param int      $price_row
1881
+	 * @param EE_Price $price
1882
+	 * @param bool     $default
1883
+	 * @return mixed
1884
+	 * @throws DomainException
1885
+	 * @throws EE_Error
1886
+	 */
1887
+	protected function _get_base_price_template($ticket_row, $price_row, $price, $default)
1888
+	{
1889
+		$template_args = array(
1890
+			'tkt_row'                   => $default ? 'TICKETNUM' : $ticket_row,
1891
+			'PRC_order'                 => $default && empty($price) ? 'PRICENUM' : $price_row,
1892
+			'PRT_ID'                    => $default && empty($price) ? 1 : $price->get('PRT_ID'),
1893
+			'PRT_name'                  => esc_html__('Price', 'event_espresso'),
1894
+			'price_selected_operator'   => '+',
1895
+			'price_selected_is_percent' => 0,
1896
+		);
1897
+		$template_args = apply_filters(
1898
+			'FHEE__espresso_events_Pricing_Hooks___get_base_price_template__template_args',
1899
+			$template_args,
1900
+			$ticket_row,
1901
+			$price_row,
1902
+			$price,
1903
+			$default,
1904
+			$this->_is_creating_event
1905
+		);
1906
+		return EEH_Template::display_template(
1907
+			PRICING_TEMPLATE_PATH . 'event_tickets_datetime_price_type_base.template.php',
1908
+			$template_args,
1909
+			true
1910
+		);
1911
+	}
1912 1912
 
1913 1913
 
1914
-    /**
1915
-     * @param int      $ticket_row
1916
-     * @param int      $price_row
1917
-     * @param EE_Price $price
1918
-     * @param bool     $default
1919
-     * @param bool     $disabled
1920
-     * @return mixed
1921
-     * @throws ReflectionException
1922
-     * @throws InvalidArgumentException
1923
-     * @throws InvalidInterfaceException
1924
-     * @throws InvalidDataTypeException
1925
-     * @throws DomainException
1926
-     * @throws EE_Error
1927
-     */
1928
-    protected function _get_price_modifier_template(
1929
-        $ticket_row,
1930
-        $price_row,
1931
-        $price,
1932
-        $default,
1933
-        $disabled = false
1934
-    ) {
1935
-        $select_name = $default && ! $price instanceof EE_Price
1936
-            ? 'edit_prices[TICKETNUM][PRICENUM][PRT_ID]'
1937
-            : 'edit_prices[' . esc_attr($ticket_row) . '][' . esc_attr($price_row) . '][PRT_ID]';
1938
-        /** @var EEM_Price_Type $price_type_model */
1939
-        $price_type_model = EE_Registry::instance()->load_model('Price_Type');
1940
-        $price_types = $price_type_model->get_all(array(
1941
-            array(
1942
-                'OR' => array(
1943
-                    'PBT_ID'  => '2',
1944
-                    'PBT_ID*' => '3',
1945
-                ),
1946
-            ),
1947
-        ));
1948
-        $all_price_types = $default && ! $price instanceof EE_Price
1949
-            ? array(esc_html__('Select Modifier', 'event_espresso'))
1950
-            : array();
1951
-        $selected_price_type_id = $default && ! $price instanceof EE_Price ? 0 : $price->type();
1952
-        $price_option_spans = '';
1953
-        // setup price types for selector
1954
-        foreach ($price_types as $price_type) {
1955
-            if (! $price_type instanceof EE_Price_Type) {
1956
-                continue;
1957
-            }
1958
-            $all_price_types[ $price_type->ID() ] = $price_type->get('PRT_name');
1959
-            // while we're in the loop let's setup the option spans used by js
1960
-            $span_args = array(
1961
-                'PRT_ID'         => $price_type->ID(),
1962
-                'PRT_operator'   => $price_type->is_discount() ? '-' : '+',
1963
-                'PRT_is_percent' => $price_type->get('PRT_is_percent') ? 1 : 0,
1964
-            );
1965
-            $price_option_spans .= EEH_Template::display_template(
1966
-                PRICING_TEMPLATE_PATH . 'event_tickets_datetime_price_option_span.template.php',
1967
-                $span_args,
1968
-                true
1969
-            );
1970
-        }
1971
-        $select_name = $disabled ? 'archive_price[' . $ticket_row . '][' . $price_row . '][PRT_ID]'
1972
-            : $select_name;
1973
-        $select_input = new EE_Select_Input(
1974
-            $all_price_types,
1975
-            array(
1976
-                'default'               => $selected_price_type_id,
1977
-                'html_name'             => $select_name,
1978
-                'html_class'            => 'edit-price-PRT_ID',
1979
-                'other_html_attributes' => $disabled ? 'style="width:auto;" disabled' : 'style="width:auto;"',
1980
-            )
1981
-        );
1982
-        $price_selected_operator = $price instanceof EE_Price && $price->is_discount() ? '-' : '+';
1983
-        $price_selected_operator = $default && ! $price instanceof EE_Price ? '' : $price_selected_operator;
1984
-        $price_selected_is_percent = $price instanceof EE_Price && $price->is_percent() ? 1 : 0;
1985
-        $price_selected_is_percent = $default && ! $price instanceof EE_Price ? '' : $price_selected_is_percent;
1986
-        $template_args = array(
1987
-            'tkt_row'                   => $default ? 'TICKETNUM' : $ticket_row,
1988
-            'PRC_order'                 => $default && ! $price instanceof EE_Price ? 'PRICENUM' : $price_row,
1989
-            'price_modifier_selector'   => $select_input->get_html_for_input(),
1990
-            'main_name'                 => $select_name,
1991
-            'selected_price_type_id'    => $selected_price_type_id,
1992
-            'price_option_spans'        => $price_option_spans,
1993
-            'price_selected_operator'   => $price_selected_operator,
1994
-            'price_selected_is_percent' => $price_selected_is_percent,
1995
-            'disabled'                  => $disabled,
1996
-        );
1997
-        $template_args = apply_filters(
1998
-            'FHEE__espresso_events_Pricing_Hooks___get_price_modifier_template__template_args',
1999
-            $template_args,
2000
-            $ticket_row,
2001
-            $price_row,
2002
-            $price,
2003
-            $default,
2004
-            $disabled,
2005
-            $this->_is_creating_event
2006
-        );
2007
-        return EEH_Template::display_template(
2008
-            PRICING_TEMPLATE_PATH . 'event_tickets_datetime_price_modifier_selector.template.php',
2009
-            $template_args,
2010
-            true
2011
-        );
2012
-    }
1914
+	/**
1915
+	 * @param int      $ticket_row
1916
+	 * @param int      $price_row
1917
+	 * @param EE_Price $price
1918
+	 * @param bool     $default
1919
+	 * @param bool     $disabled
1920
+	 * @return mixed
1921
+	 * @throws ReflectionException
1922
+	 * @throws InvalidArgumentException
1923
+	 * @throws InvalidInterfaceException
1924
+	 * @throws InvalidDataTypeException
1925
+	 * @throws DomainException
1926
+	 * @throws EE_Error
1927
+	 */
1928
+	protected function _get_price_modifier_template(
1929
+		$ticket_row,
1930
+		$price_row,
1931
+		$price,
1932
+		$default,
1933
+		$disabled = false
1934
+	) {
1935
+		$select_name = $default && ! $price instanceof EE_Price
1936
+			? 'edit_prices[TICKETNUM][PRICENUM][PRT_ID]'
1937
+			: 'edit_prices[' . esc_attr($ticket_row) . '][' . esc_attr($price_row) . '][PRT_ID]';
1938
+		/** @var EEM_Price_Type $price_type_model */
1939
+		$price_type_model = EE_Registry::instance()->load_model('Price_Type');
1940
+		$price_types = $price_type_model->get_all(array(
1941
+			array(
1942
+				'OR' => array(
1943
+					'PBT_ID'  => '2',
1944
+					'PBT_ID*' => '3',
1945
+				),
1946
+			),
1947
+		));
1948
+		$all_price_types = $default && ! $price instanceof EE_Price
1949
+			? array(esc_html__('Select Modifier', 'event_espresso'))
1950
+			: array();
1951
+		$selected_price_type_id = $default && ! $price instanceof EE_Price ? 0 : $price->type();
1952
+		$price_option_spans = '';
1953
+		// setup price types for selector
1954
+		foreach ($price_types as $price_type) {
1955
+			if (! $price_type instanceof EE_Price_Type) {
1956
+				continue;
1957
+			}
1958
+			$all_price_types[ $price_type->ID() ] = $price_type->get('PRT_name');
1959
+			// while we're in the loop let's setup the option spans used by js
1960
+			$span_args = array(
1961
+				'PRT_ID'         => $price_type->ID(),
1962
+				'PRT_operator'   => $price_type->is_discount() ? '-' : '+',
1963
+				'PRT_is_percent' => $price_type->get('PRT_is_percent') ? 1 : 0,
1964
+			);
1965
+			$price_option_spans .= EEH_Template::display_template(
1966
+				PRICING_TEMPLATE_PATH . 'event_tickets_datetime_price_option_span.template.php',
1967
+				$span_args,
1968
+				true
1969
+			);
1970
+		}
1971
+		$select_name = $disabled ? 'archive_price[' . $ticket_row . '][' . $price_row . '][PRT_ID]'
1972
+			: $select_name;
1973
+		$select_input = new EE_Select_Input(
1974
+			$all_price_types,
1975
+			array(
1976
+				'default'               => $selected_price_type_id,
1977
+				'html_name'             => $select_name,
1978
+				'html_class'            => 'edit-price-PRT_ID',
1979
+				'other_html_attributes' => $disabled ? 'style="width:auto;" disabled' : 'style="width:auto;"',
1980
+			)
1981
+		);
1982
+		$price_selected_operator = $price instanceof EE_Price && $price->is_discount() ? '-' : '+';
1983
+		$price_selected_operator = $default && ! $price instanceof EE_Price ? '' : $price_selected_operator;
1984
+		$price_selected_is_percent = $price instanceof EE_Price && $price->is_percent() ? 1 : 0;
1985
+		$price_selected_is_percent = $default && ! $price instanceof EE_Price ? '' : $price_selected_is_percent;
1986
+		$template_args = array(
1987
+			'tkt_row'                   => $default ? 'TICKETNUM' : $ticket_row,
1988
+			'PRC_order'                 => $default && ! $price instanceof EE_Price ? 'PRICENUM' : $price_row,
1989
+			'price_modifier_selector'   => $select_input->get_html_for_input(),
1990
+			'main_name'                 => $select_name,
1991
+			'selected_price_type_id'    => $selected_price_type_id,
1992
+			'price_option_spans'        => $price_option_spans,
1993
+			'price_selected_operator'   => $price_selected_operator,
1994
+			'price_selected_is_percent' => $price_selected_is_percent,
1995
+			'disabled'                  => $disabled,
1996
+		);
1997
+		$template_args = apply_filters(
1998
+			'FHEE__espresso_events_Pricing_Hooks___get_price_modifier_template__template_args',
1999
+			$template_args,
2000
+			$ticket_row,
2001
+			$price_row,
2002
+			$price,
2003
+			$default,
2004
+			$disabled,
2005
+			$this->_is_creating_event
2006
+		);
2007
+		return EEH_Template::display_template(
2008
+			PRICING_TEMPLATE_PATH . 'event_tickets_datetime_price_modifier_selector.template.php',
2009
+			$template_args,
2010
+			true
2011
+		);
2012
+	}
2013 2013
 
2014 2014
 
2015
-    /**
2016
-     * @param int              $datetime_row
2017
-     * @param int              $ticket_row
2018
-     * @param EE_Datetime|null $datetime
2019
-     * @param EE_Ticket|null   $ticket
2020
-     * @param array            $ticket_datetimes
2021
-     * @param bool             $default
2022
-     * @return mixed
2023
-     * @throws DomainException
2024
-     * @throws EE_Error
2025
-     */
2026
-    protected function _get_ticket_datetime_list_item(
2027
-        $datetime_row,
2028
-        $ticket_row,
2029
-        $datetime,
2030
-        $ticket,
2031
-        $ticket_datetimes = array(),
2032
-        $default
2033
-    ) {
2034
-        $tkt_datetimes = $ticket instanceof EE_Ticket && isset($ticket_datetimes[ $ticket->ID() ])
2035
-            ? $ticket_datetimes[ $ticket->ID() ]
2036
-            : array();
2037
-        $template_args = array(
2038
-            'dtt_row'                  => $default && ! $datetime instanceof EE_Datetime
2039
-                ? 'DTTNUM'
2040
-                : $datetime_row,
2041
-            'tkt_row'                  => $default
2042
-                ? 'TICKETNUM'
2043
-                : $ticket_row,
2044
-            'ticket_datetime_selected' => in_array($datetime_row, $tkt_datetimes, true)
2045
-                ? ' ticket-selected'
2046
-                : '',
2047
-            'ticket_datetime_checked'  => in_array($datetime_row, $tkt_datetimes, true)
2048
-                ? ' checked="checked"'
2049
-                : '',
2050
-            'DTT_name'                 => $default && empty($datetime)
2051
-                ? 'DTTNAME'
2052
-                : $datetime->get_dtt_display_name(true),
2053
-            'tkt_status_class'         => '',
2054
-        );
2055
-        $template_args = apply_filters(
2056
-            'FHEE__espresso_events_Pricing_Hooks___get_ticket_datetime_list_item__template_args',
2057
-            $template_args,
2058
-            $datetime_row,
2059
-            $ticket_row,
2060
-            $datetime,
2061
-            $ticket,
2062
-            $ticket_datetimes,
2063
-            $default,
2064
-            $this->_is_creating_event
2065
-        );
2066
-        return EEH_Template::display_template(
2067
-            PRICING_TEMPLATE_PATH . 'event_tickets_datetime_ticket_datetimes_list_item.template.php',
2068
-            $template_args,
2069
-            true
2070
-        );
2071
-    }
2015
+	/**
2016
+	 * @param int              $datetime_row
2017
+	 * @param int              $ticket_row
2018
+	 * @param EE_Datetime|null $datetime
2019
+	 * @param EE_Ticket|null   $ticket
2020
+	 * @param array            $ticket_datetimes
2021
+	 * @param bool             $default
2022
+	 * @return mixed
2023
+	 * @throws DomainException
2024
+	 * @throws EE_Error
2025
+	 */
2026
+	protected function _get_ticket_datetime_list_item(
2027
+		$datetime_row,
2028
+		$ticket_row,
2029
+		$datetime,
2030
+		$ticket,
2031
+		$ticket_datetimes = array(),
2032
+		$default
2033
+	) {
2034
+		$tkt_datetimes = $ticket instanceof EE_Ticket && isset($ticket_datetimes[ $ticket->ID() ])
2035
+			? $ticket_datetimes[ $ticket->ID() ]
2036
+			: array();
2037
+		$template_args = array(
2038
+			'dtt_row'                  => $default && ! $datetime instanceof EE_Datetime
2039
+				? 'DTTNUM'
2040
+				: $datetime_row,
2041
+			'tkt_row'                  => $default
2042
+				? 'TICKETNUM'
2043
+				: $ticket_row,
2044
+			'ticket_datetime_selected' => in_array($datetime_row, $tkt_datetimes, true)
2045
+				? ' ticket-selected'
2046
+				: '',
2047
+			'ticket_datetime_checked'  => in_array($datetime_row, $tkt_datetimes, true)
2048
+				? ' checked="checked"'
2049
+				: '',
2050
+			'DTT_name'                 => $default && empty($datetime)
2051
+				? 'DTTNAME'
2052
+				: $datetime->get_dtt_display_name(true),
2053
+			'tkt_status_class'         => '',
2054
+		);
2055
+		$template_args = apply_filters(
2056
+			'FHEE__espresso_events_Pricing_Hooks___get_ticket_datetime_list_item__template_args',
2057
+			$template_args,
2058
+			$datetime_row,
2059
+			$ticket_row,
2060
+			$datetime,
2061
+			$ticket,
2062
+			$ticket_datetimes,
2063
+			$default,
2064
+			$this->_is_creating_event
2065
+		);
2066
+		return EEH_Template::display_template(
2067
+			PRICING_TEMPLATE_PATH . 'event_tickets_datetime_ticket_datetimes_list_item.template.php',
2068
+			$template_args,
2069
+			true
2070
+		);
2071
+	}
2072 2072
 
2073 2073
 
2074
-    /**
2075
-     * @param array $all_datetimes
2076
-     * @param array $all_tickets
2077
-     * @return mixed
2078
-     * @throws ReflectionException
2079
-     * @throws InvalidArgumentException
2080
-     * @throws InvalidInterfaceException
2081
-     * @throws InvalidDataTypeException
2082
-     * @throws DomainException
2083
-     * @throws EE_Error
2084
-     */
2085
-    protected function _get_ticket_js_structure($all_datetimes = array(), $all_tickets = array())
2086
-    {
2087
-        $template_args = array(
2088
-            'default_datetime_edit_row'                => $this->_get_dtt_edit_row(
2089
-                'DTTNUM',
2090
-                null,
2091
-                true,
2092
-                $all_datetimes
2093
-            ),
2094
-            'default_ticket_row'                       => $this->_get_ticket_row(
2095
-                'TICKETNUM',
2096
-                null,
2097
-                array(),
2098
-                array(),
2099
-                true
2100
-            ),
2101
-            'default_price_row'                        => $this->_get_ticket_price_row(
2102
-                'TICKETNUM',
2103
-                'PRICENUM',
2104
-                null,
2105
-                true,
2106
-                null
2107
-            ),
2108
-            'default_price_rows'                       => '',
2109
-            'default_base_price_amount'                => 0,
2110
-            'default_base_price_name'                  => '',
2111
-            'default_base_price_description'           => '',
2112
-            'default_price_modifier_selector_row'      => $this->_get_price_modifier_template(
2113
-                'TICKETNUM',
2114
-                'PRICENUM',
2115
-                null,
2116
-                true
2117
-            ),
2118
-            'default_available_tickets_for_datetime'   => $this->_get_dtt_attached_tickets_row(
2119
-                'DTTNUM',
2120
-                null,
2121
-                array(),
2122
-                array(),
2123
-                true
2124
-            ),
2125
-            'existing_available_datetime_tickets_list' => '',
2126
-            'existing_available_ticket_datetimes_list' => '',
2127
-            'new_available_datetime_ticket_list_item'  => $this->_get_datetime_tickets_list_item(
2128
-                'DTTNUM',
2129
-                'TICKETNUM',
2130
-                null,
2131
-                null,
2132
-                array(),
2133
-                true
2134
-            ),
2135
-            'new_available_ticket_datetime_list_item'  => $this->_get_ticket_datetime_list_item(
2136
-                'DTTNUM',
2137
-                'TICKETNUM',
2138
-                null,
2139
-                null,
2140
-                array(),
2141
-                true
2142
-            ),
2143
-        );
2144
-        $ticket_row = 1;
2145
-        foreach ($all_tickets as $ticket) {
2146
-            $template_args['existing_available_datetime_tickets_list'] .= $this->_get_datetime_tickets_list_item(
2147
-                'DTTNUM',
2148
-                $ticket_row,
2149
-                null,
2150
-                $ticket,
2151
-                array(),
2152
-                true
2153
-            );
2154
-            $ticket_row++;
2155
-        }
2156
-        $datetime_row = 1;
2157
-        foreach ($all_datetimes as $datetime) {
2158
-            $template_args['existing_available_ticket_datetimes_list'] .= $this->_get_ticket_datetime_list_item(
2159
-                $datetime_row,
2160
-                'TICKETNUM',
2161
-                $datetime,
2162
-                null,
2163
-                array(),
2164
-                true
2165
-            );
2166
-            $datetime_row++;
2167
-        }
2168
-        /** @var EEM_Price $price_model */
2169
-        $price_model = EE_Registry::instance()->load_model('Price');
2170
-        $default_prices = $price_model->get_all_default_prices();
2171
-        $price_row = 1;
2172
-        foreach ($default_prices as $price) {
2173
-            if (! $price instanceof EE_Price) {
2174
-                continue;
2175
-            }
2176
-            if ($price->is_base_price()) {
2177
-                $template_args['default_base_price_amount'] = $price->get_pretty(
2178
-                    'PRC_amount',
2179
-                    'localized_float'
2180
-                );
2181
-                $template_args['default_base_price_name'] = $price->get('PRC_name');
2182
-                $template_args['default_base_price_description'] = $price->get('PRC_desc');
2183
-                $price_row++;
2184
-                continue;
2185
-            }
2186
-            $show_trash = ! ((count($default_prices) > 1 && $price_row === 1)
2187
-                             || count($default_prices) === 1);
2188
-            $show_create = ! (count($default_prices) > 1
2189
-                              && count($default_prices)
2190
-                                 !== $price_row);
2191
-            $template_args['default_price_rows'] .= $this->_get_ticket_price_row(
2192
-                'TICKETNUM',
2193
-                $price_row,
2194
-                $price,
2195
-                true,
2196
-                null,
2197
-                $show_trash,
2198
-                $show_create
2199
-            );
2200
-            $price_row++;
2201
-        }
2202
-        $template_args = apply_filters(
2203
-            'FHEE__espresso_events_Pricing_Hooks___get_ticket_js_structure__template_args',
2204
-            $template_args,
2205
-            $all_datetimes,
2206
-            $all_tickets,
2207
-            $this->_is_creating_event
2208
-        );
2209
-        return EEH_Template::display_template(
2210
-            PRICING_TEMPLATE_PATH . 'event_tickets_datetime_ticket_js_structure.template.php',
2211
-            $template_args,
2212
-            true
2213
-        );
2214
-    }
2074
+	/**
2075
+	 * @param array $all_datetimes
2076
+	 * @param array $all_tickets
2077
+	 * @return mixed
2078
+	 * @throws ReflectionException
2079
+	 * @throws InvalidArgumentException
2080
+	 * @throws InvalidInterfaceException
2081
+	 * @throws InvalidDataTypeException
2082
+	 * @throws DomainException
2083
+	 * @throws EE_Error
2084
+	 */
2085
+	protected function _get_ticket_js_structure($all_datetimes = array(), $all_tickets = array())
2086
+	{
2087
+		$template_args = array(
2088
+			'default_datetime_edit_row'                => $this->_get_dtt_edit_row(
2089
+				'DTTNUM',
2090
+				null,
2091
+				true,
2092
+				$all_datetimes
2093
+			),
2094
+			'default_ticket_row'                       => $this->_get_ticket_row(
2095
+				'TICKETNUM',
2096
+				null,
2097
+				array(),
2098
+				array(),
2099
+				true
2100
+			),
2101
+			'default_price_row'                        => $this->_get_ticket_price_row(
2102
+				'TICKETNUM',
2103
+				'PRICENUM',
2104
+				null,
2105
+				true,
2106
+				null
2107
+			),
2108
+			'default_price_rows'                       => '',
2109
+			'default_base_price_amount'                => 0,
2110
+			'default_base_price_name'                  => '',
2111
+			'default_base_price_description'           => '',
2112
+			'default_price_modifier_selector_row'      => $this->_get_price_modifier_template(
2113
+				'TICKETNUM',
2114
+				'PRICENUM',
2115
+				null,
2116
+				true
2117
+			),
2118
+			'default_available_tickets_for_datetime'   => $this->_get_dtt_attached_tickets_row(
2119
+				'DTTNUM',
2120
+				null,
2121
+				array(),
2122
+				array(),
2123
+				true
2124
+			),
2125
+			'existing_available_datetime_tickets_list' => '',
2126
+			'existing_available_ticket_datetimes_list' => '',
2127
+			'new_available_datetime_ticket_list_item'  => $this->_get_datetime_tickets_list_item(
2128
+				'DTTNUM',
2129
+				'TICKETNUM',
2130
+				null,
2131
+				null,
2132
+				array(),
2133
+				true
2134
+			),
2135
+			'new_available_ticket_datetime_list_item'  => $this->_get_ticket_datetime_list_item(
2136
+				'DTTNUM',
2137
+				'TICKETNUM',
2138
+				null,
2139
+				null,
2140
+				array(),
2141
+				true
2142
+			),
2143
+		);
2144
+		$ticket_row = 1;
2145
+		foreach ($all_tickets as $ticket) {
2146
+			$template_args['existing_available_datetime_tickets_list'] .= $this->_get_datetime_tickets_list_item(
2147
+				'DTTNUM',
2148
+				$ticket_row,
2149
+				null,
2150
+				$ticket,
2151
+				array(),
2152
+				true
2153
+			);
2154
+			$ticket_row++;
2155
+		}
2156
+		$datetime_row = 1;
2157
+		foreach ($all_datetimes as $datetime) {
2158
+			$template_args['existing_available_ticket_datetimes_list'] .= $this->_get_ticket_datetime_list_item(
2159
+				$datetime_row,
2160
+				'TICKETNUM',
2161
+				$datetime,
2162
+				null,
2163
+				array(),
2164
+				true
2165
+			);
2166
+			$datetime_row++;
2167
+		}
2168
+		/** @var EEM_Price $price_model */
2169
+		$price_model = EE_Registry::instance()->load_model('Price');
2170
+		$default_prices = $price_model->get_all_default_prices();
2171
+		$price_row = 1;
2172
+		foreach ($default_prices as $price) {
2173
+			if (! $price instanceof EE_Price) {
2174
+				continue;
2175
+			}
2176
+			if ($price->is_base_price()) {
2177
+				$template_args['default_base_price_amount'] = $price->get_pretty(
2178
+					'PRC_amount',
2179
+					'localized_float'
2180
+				);
2181
+				$template_args['default_base_price_name'] = $price->get('PRC_name');
2182
+				$template_args['default_base_price_description'] = $price->get('PRC_desc');
2183
+				$price_row++;
2184
+				continue;
2185
+			}
2186
+			$show_trash = ! ((count($default_prices) > 1 && $price_row === 1)
2187
+							 || count($default_prices) === 1);
2188
+			$show_create = ! (count($default_prices) > 1
2189
+							  && count($default_prices)
2190
+								 !== $price_row);
2191
+			$template_args['default_price_rows'] .= $this->_get_ticket_price_row(
2192
+				'TICKETNUM',
2193
+				$price_row,
2194
+				$price,
2195
+				true,
2196
+				null,
2197
+				$show_trash,
2198
+				$show_create
2199
+			);
2200
+			$price_row++;
2201
+		}
2202
+		$template_args = apply_filters(
2203
+			'FHEE__espresso_events_Pricing_Hooks___get_ticket_js_structure__template_args',
2204
+			$template_args,
2205
+			$all_datetimes,
2206
+			$all_tickets,
2207
+			$this->_is_creating_event
2208
+		);
2209
+		return EEH_Template::display_template(
2210
+			PRICING_TEMPLATE_PATH . 'event_tickets_datetime_ticket_js_structure.template.php',
2211
+			$template_args,
2212
+			true
2213
+		);
2214
+	}
2215 2215
 }
Please login to merge, or discard this patch.
Spacing   +75 added lines, -75 removed lines patch added patch discarded remove patch
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
             );
153 153
             $msg .= '</p><ul>';
154 154
             foreach ($format_validation as $error) {
155
-                $msg .= '<li>' . $error . '</li>';
155
+                $msg .= '<li>'.$error.'</li>';
156 156
             }
157 157
             $msg .= '</ul><p>';
158 158
             $msg .= sprintf(
@@ -181,11 +181,11 @@  discard block
 block discarded – undo
181 181
         $this->_scripts_styles = array(
182 182
             'registers'   => array(
183 183
                 'ee-tickets-datetimes-css' => array(
184
-                    'url'  => PRICING_ASSETS_URL . 'event-tickets-datetimes.css',
184
+                    'url'  => PRICING_ASSETS_URL.'event-tickets-datetimes.css',
185 185
                     'type' => 'css',
186 186
                 ),
187 187
                 'ee-dtt-ticket-metabox'    => array(
188
-                    'url'     => PRICING_ASSETS_URL . 'ee-datetime-ticket-metabox.js',
188
+                    'url'     => PRICING_ASSETS_URL.'ee-datetime-ticket-metabox.js',
189 189
                     'depends' => array('ee-datepicker', 'ee-dialog', 'underscore'),
190 190
                 ),
191 191
             ),
@@ -209,9 +209,9 @@  discard block
 block discarded – undo
209 209
                             'event_espresso'
210 210
                         ),
211 211
                         'cancel_button'           => '<button class="button--secondary ee-modal-cancel">'
212
-                                                     . esc_html__('Cancel', 'event_espresso') . '</button>',
212
+                                                     . esc_html__('Cancel', 'event_espresso').'</button>',
213 213
                         'close_button'            => '<button class="button--secondary ee-modal-cancel">'
214
-                                                     . esc_html__('Close', 'event_espresso') . '</button>',
214
+                                                     . esc_html__('Close', 'event_espresso').'</button>',
215 215
                         'single_warning_from_tkt' => esc_html__(
216 216
                             'The Datetime you are attempting to unassign from this ticket is the only remaining datetime for this ticket. Tickets must always have at least one datetime assigned to them.',
217 217
                             'event_espresso'
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
                             'event_espresso'
222 222
                         ),
223 223
                         'dismiss_button'          => '<button class="button--secondary ee-modal-cancel">'
224
-                                                     . esc_html__('Dismiss', 'event_espresso') . '</button>',
224
+                                                     . esc_html__('Dismiss', 'event_espresso').'</button>',
225 225
                     ),
226 226
                     'DTT_ERROR_MSG'         => array(
227 227
                         'no_ticket_name' => esc_html__('General Admission', 'event_espresso'),
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
         foreach ($data['edit_event_datetimes'] as $row => $datetime_data) {
314 314
             // trim all values to ensure any excess whitespace is removed.
315 315
             $datetime_data = array_map(
316
-                function ($datetime_data) {
316
+                function($datetime_data) {
317 317
                     return is_array($datetime_data) ? $datetime_data : trim($datetime_data);
318 318
                 },
319 319
                 $datetime_data
@@ -343,7 +343,7 @@  discard block
 block discarded – undo
343 343
             );
344 344
             // if we have an id then let's get existing object first and then set the new values.
345 345
             // Otherwise we instantiate a new object for save.
346
-            if (! empty($datetime_data['DTT_ID'])) {
346
+            if ( ! empty($datetime_data['DTT_ID'])) {
347 347
                 $datetime = EE_Registry::instance()
348 348
                                        ->load_model('Datetime', array($timezone))
349 349
                                        ->get_one_by_ID($datetime_data['DTT_ID']);
@@ -357,7 +357,7 @@  discard block
 block discarded – undo
357 357
                 // after the add_relation_to() the autosave replaces it.
358 358
                 // We need to do this so we dont' TRASH the parent DTT.
359 359
                 // (save the ID for both key and value to avoid duplications)
360
-                $saved_dtt_ids[ $datetime->ID() ] = $datetime->ID();
360
+                $saved_dtt_ids[$datetime->ID()] = $datetime->ID();
361 361
             } else {
362 362
                 $datetime = EE_Registry::instance()->load_class(
363 363
                     'Datetime',
@@ -393,8 +393,8 @@  discard block
 block discarded – undo
393 393
             // because it is possible there was a new one created for the autosave.
394 394
             // (save the ID for both key and value to avoid duplications)
395 395
             $DTT_ID = $datetime->ID();
396
-            $saved_dtt_ids[ $DTT_ID ] = $DTT_ID;
397
-            $saved_dtt_objs[ $row ] = $datetime;
396
+            $saved_dtt_ids[$DTT_ID] = $DTT_ID;
397
+            $saved_dtt_objs[$row] = $datetime;
398 398
             // @todo if ANY of these updates fail then we want the appropriate global error message.
399 399
         }
400 400
         $event->save();
@@ -458,13 +458,13 @@  discard block
 block discarded – undo
458 458
             $update_prices = $create_new_TKT = false;
459 459
             // figure out what datetimes were added to the ticket
460 460
             // and what datetimes were removed from the ticket in the session.
461
-            $starting_tkt_dtt_rows = explode(',', $data['starting_ticket_datetime_rows'][ $row ]);
462
-            $tkt_dtt_rows = explode(',', $data['ticket_datetime_rows'][ $row ]);
461
+            $starting_tkt_dtt_rows = explode(',', $data['starting_ticket_datetime_rows'][$row]);
462
+            $tkt_dtt_rows = explode(',', $data['ticket_datetime_rows'][$row]);
463 463
             $datetimes_added = array_diff($tkt_dtt_rows, $starting_tkt_dtt_rows);
464 464
             $datetimes_removed = array_diff($starting_tkt_dtt_rows, $tkt_dtt_rows);
465 465
             // trim inputs to ensure any excess whitespace is removed.
466 466
             $tkt = array_map(
467
-                function ($ticket_data) {
467
+                function($ticket_data) {
468 468
                     return is_array($ticket_data) ? $ticket_data : trim($ticket_data);
469 469
                 },
470 470
                 $tkt
@@ -484,8 +484,8 @@  discard block
 block discarded – undo
484 484
                 ? $base_price
485 485
                 : $ticket_price;
486 486
             $base_price_id = $tkt['TKT_base_price_ID'] ?? 0;
487
-            $price_rows = is_array($data['edit_prices']) && isset($data['edit_prices'][ $row ])
488
-                ? $data['edit_prices'][ $row ]
487
+            $price_rows = is_array($data['edit_prices']) && isset($data['edit_prices'][$row])
488
+                ? $data['edit_prices'][$row]
489 489
                 : array();
490 490
             $now = null;
491 491
             if (empty($tkt['TKT_start_date'])) {
@@ -497,7 +497,7 @@  discard block
 block discarded – undo
497 497
                 /**
498 498
                  * set the TKT_end_date to the first datetime attached to the ticket.
499 499
                  */
500
-                $first_dtt = $saved_datetimes[ reset($tkt_dtt_rows) ];
500
+                $first_dtt = $saved_datetimes[reset($tkt_dtt_rows)];
501 501
                 $tkt['TKT_end_date'] = $first_dtt->start_date_and_time($this->_date_time_format);
502 502
             }
503 503
             $TKT_values = array(
@@ -632,7 +632,7 @@  discard block
 block discarded – undo
632 632
             // need to make sue that the TKT_price is accurate after saving the prices.
633 633
             $ticket->ensure_TKT_Price_correct();
634 634
             // handle CREATING a default tkt from the incoming tkt but ONLY if this isn't an autosave.
635
-            if (! defined('DOING_AUTOSAVE') && ! empty($tkt['TKT_is_default_selector'])) {
635
+            if ( ! defined('DOING_AUTOSAVE') && ! empty($tkt['TKT_is_default_selector'])) {
636 636
                 $update_prices = true;
637 637
                 $new_default = clone $ticket;
638 638
                 $new_default->set('TKT_ID', 0);
@@ -677,7 +677,7 @@  discard block
 block discarded – undo
677 677
                 // save new TKT
678 678
                 $new_tkt->save();
679 679
                 // add new ticket to array
680
-                $saved_tickets[ $new_tkt->ID() ] = $new_tkt;
680
+                $saved_tickets[$new_tkt->ID()] = $new_tkt;
681 681
                 do_action(
682 682
                     'AHEE__espresso_events_Pricing_Hooks___update_tkts_new_ticket',
683 683
                     $new_tkt,
@@ -687,7 +687,7 @@  discard block
 block discarded – undo
687 687
                 );
688 688
             } else {
689 689
                 // add tkt to saved tkts
690
-                $saved_tickets[ $ticket->ID() ] = $ticket;
690
+                $saved_tickets[$ticket->ID()] = $ticket;
691 691
                 do_action(
692 692
                     'AHEE__espresso_events_Pricing_Hooks___update_tkts_update_ticket',
693 693
                     $ticket,
@@ -754,22 +754,22 @@  discard block
 block discarded – undo
754 754
         // to start we have to add the ticket to all the datetimes its supposed to be with,
755 755
         // and removing the ticket from datetimes it got removed from.
756 756
         // first let's add datetimes
757
-        if (! empty($added_datetimes) && is_array($added_datetimes)) {
757
+        if ( ! empty($added_datetimes) && is_array($added_datetimes)) {
758 758
             foreach ($added_datetimes as $row_id) {
759 759
                 $row_id = (int) $row_id;
760
-                if (isset($saved_datetimes[ $row_id ]) && $saved_datetimes[ $row_id ] instanceof EE_Datetime) {
761
-                    $ticket->_add_relation_to($saved_datetimes[ $row_id ], 'Datetime');
760
+                if (isset($saved_datetimes[$row_id]) && $saved_datetimes[$row_id] instanceof EE_Datetime) {
761
+                    $ticket->_add_relation_to($saved_datetimes[$row_id], 'Datetime');
762 762
                 }
763 763
             }
764 764
         }
765 765
         // then remove datetimes
766
-        if (! empty($removed_datetimes) && is_array($removed_datetimes)) {
766
+        if ( ! empty($removed_datetimes) && is_array($removed_datetimes)) {
767 767
             foreach ($removed_datetimes as $row_id) {
768 768
                 $row_id = (int) $row_id;
769 769
                 // its entirely possible that a datetime got deleted (instead of just removed from relationship.
770 770
                 // So make sure we skip over this if the dtt isn't in the $saved_datetimes array)
771
-                if (isset($saved_datetimes[ $row_id ]) && $saved_datetimes[ $row_id ] instanceof EE_Datetime) {
772
-                    $ticket->_remove_relation_to($saved_datetimes[ $row_id ], 'Datetime');
771
+                if (isset($saved_datetimes[$row_id]) && $saved_datetimes[$row_id] instanceof EE_Datetime) {
772
+                    $ticket->_remove_relation_to($saved_datetimes[$row_id], 'Datetime');
773 773
                 }
774 774
             }
775 775
         }
@@ -881,7 +881,7 @@  discard block
 block discarded – undo
881 881
             );
882 882
         }
883 883
         // possibly need to save tkt
884
-        if (! $ticket->ID()) {
884
+        if ( ! $ticket->ID()) {
885 885
             $ticket->save();
886 886
         }
887 887
         foreach ($prices as $row => $prc) {
@@ -915,17 +915,17 @@  discard block
 block discarded – undo
915 915
                 }
916 916
             }
917 917
             $price->save();
918
-            $updated_prices[ $price->ID() ] = $price;
918
+            $updated_prices[$price->ID()] = $price;
919 919
             $ticket->_add_relation_to($price, 'Price');
920 920
         }
921 921
         // now let's remove any prices that got removed from the ticket
922
-        if (! empty($current_prices_on_ticket)) {
922
+        if ( ! empty($current_prices_on_ticket)) {
923 923
             $current = array_keys($current_prices_on_ticket);
924 924
             $updated = array_keys($updated_prices);
925 925
             $prices_to_remove = array_diff($current, $updated);
926
-            if (! empty($prices_to_remove)) {
926
+            if ( ! empty($prices_to_remove)) {
927 927
                 foreach ($prices_to_remove as $prc_id) {
928
-                    $p = $current_prices_on_ticket[ $prc_id ];
928
+                    $p = $current_prices_on_ticket[$prc_id];
929 929
                     $ticket->_remove_relation_to($p, 'Price');
930 930
                     // delete permanently the price
931 931
                     $p->delete_permanently();
@@ -1076,18 +1076,18 @@  discard block
 block discarded – undo
1076 1076
                 $TKT_ID = $ticket->get('TKT_ID');
1077 1077
                 $ticket_row = $ticket->get('TKT_row');
1078 1078
                 // we only want unique tickets in our final display!!
1079
-                if (! in_array($TKT_ID, $existing_ticket_ids, true)) {
1079
+                if ( ! in_array($TKT_ID, $existing_ticket_ids, true)) {
1080 1080
                     $existing_ticket_ids[] = $TKT_ID;
1081 1081
                     $all_tickets[] = $ticket;
1082 1082
                 }
1083 1083
                 // temporary cache of this ticket info for this datetime for later processing of datetime rows.
1084
-                $datetime_tickets[ $DTT_ID ][] = $ticket_row;
1084
+                $datetime_tickets[$DTT_ID][] = $ticket_row;
1085 1085
                 // temporary cache of this datetime info for this ticket for later processing of ticket rows.
1086 1086
                 if (
1087
-                    ! isset($ticket_datetimes[ $TKT_ID ])
1088
-                    || ! in_array($datetime_row, $ticket_datetimes[ $TKT_ID ], true)
1087
+                    ! isset($ticket_datetimes[$TKT_ID])
1088
+                    || ! in_array($datetime_row, $ticket_datetimes[$TKT_ID], true)
1089 1089
                 ) {
1090
-                    $ticket_datetimes[ $TKT_ID ][] = $datetime_row;
1090
+                    $ticket_datetimes[$TKT_ID][] = $datetime_row;
1091 1091
                 }
1092 1092
             }
1093 1093
             $datetime_row++;
@@ -1098,7 +1098,7 @@  discard block
 block discarded – undo
1098 1098
         // sort $all_tickets by order
1099 1099
         usort(
1100 1100
             $all_tickets,
1101
-            function (EE_Ticket $a, EE_Ticket $b) {
1101
+            function(EE_Ticket $a, EE_Ticket $b) {
1102 1102
                 $a_order = (int) $a->get('TKT_order');
1103 1103
                 $b_order = (int) $b->get('TKT_order');
1104 1104
                 if ($a_order === $b_order) {
@@ -1139,16 +1139,16 @@  discard block
 block discarded – undo
1139 1139
         $status_change_notice = EventEspresso\core\services\loaders\LoaderFactory::getLoader()->getShared(
1140 1140
             'EventEspresso\core\admin\StatusChangeNotice'
1141 1141
         );
1142
-        if (! $status_change_notice->isDismissed()) {
1142
+        if ( ! $status_change_notice->isDismissed()) {
1143 1143
             $main_template_args['status_change_notice'] = EEH_Template::display_template(
1144
-                EE_ADMIN_TEMPLATE . 'status_change_notice.template.php',
1144
+                EE_ADMIN_TEMPLATE.'status_change_notice.template.php',
1145 1145
                 ['context' => '__event-editor', 'page_slug' => 'espresso-events'],
1146 1146
                 true
1147 1147
             );
1148 1148
         }
1149 1149
 
1150 1150
         EEH_Template::display_template(
1151
-            PRICING_TEMPLATE_PATH . 'event_tickets_metabox_main.template.php',
1151
+            PRICING_TEMPLATE_PATH.'event_tickets_metabox_main.template.php',
1152 1152
             $main_template_args
1153 1153
         );
1154 1154
     }
@@ -1190,7 +1190,7 @@  discard block
 block discarded – undo
1190 1190
             'dtt_row'                  => $default ? 'DTTNUM' : $datetime_row,
1191 1191
         );
1192 1192
         return EEH_Template::display_template(
1193
-            PRICING_TEMPLATE_PATH . 'event_tickets_datetime_row_wrapper.template.php',
1193
+            PRICING_TEMPLATE_PATH.'event_tickets_datetime_row_wrapper.template.php',
1194 1194
             $dtt_display_template_args,
1195 1195
             true
1196 1196
         );
@@ -1259,7 +1259,7 @@  discard block
 block discarded – undo
1259 1259
             $this->_is_creating_event
1260 1260
         );
1261 1261
         return EEH_Template::display_template(
1262
-            PRICING_TEMPLATE_PATH . 'event_tickets_datetime_edit_row.template.php',
1262
+            PRICING_TEMPLATE_PATH.'event_tickets_datetime_edit_row.template.php',
1263 1263
             $template_args,
1264 1264
             true
1265 1265
         );
@@ -1300,7 +1300,7 @@  discard block
 block discarded – undo
1300 1300
             'DTT_ID'                            => $default ? '' : $datetime->ID(),
1301 1301
         );
1302 1302
         // need to setup the list items (but only if this isn't a default skeleton setup)
1303
-        if (! $default) {
1303
+        if ( ! $default) {
1304 1304
             $ticket_row = 1;
1305 1305
             foreach ($all_tickets as $ticket) {
1306 1306
                 $template_args['datetime_tickets_list'] .= $this->_get_datetime_tickets_list_item(
@@ -1326,7 +1326,7 @@  discard block
 block discarded – undo
1326 1326
             $this->_is_creating_event
1327 1327
         );
1328 1328
         return EEH_Template::display_template(
1329
-            PRICING_TEMPLATE_PATH . 'event_tickets_datetime_attached_tickets_row.template.php',
1329
+            PRICING_TEMPLATE_PATH.'event_tickets_datetime_attached_tickets_row.template.php',
1330 1330
             $template_args,
1331 1331
             true
1332 1332
         );
@@ -1352,8 +1352,8 @@  discard block
 block discarded – undo
1352 1352
         $datetime_tickets = array(),
1353 1353
         $default
1354 1354
     ) {
1355
-        $dtt_tkts = $datetime instanceof EE_Datetime && isset($datetime_tickets[ $datetime->ID() ])
1356
-            ? $datetime_tickets[ $datetime->ID() ]
1355
+        $dtt_tkts = $datetime instanceof EE_Datetime && isset($datetime_tickets[$datetime->ID()])
1356
+            ? $datetime_tickets[$datetime->ID()]
1357 1357
             : array();
1358 1358
         $display_row = $ticket instanceof EE_Ticket ? $ticket->get('TKT_row') : 0;
1359 1359
         $no_ticket = $default && empty($ticket);
@@ -1374,8 +1374,8 @@  discard block
 block discarded – undo
1374 1374
                 ? 'TKTNAME'
1375 1375
                 : $ticket->get('TKT_name'),
1376 1376
             'tkt_status_class'        => $no_ticket || $this->_is_creating_event
1377
-                ? ' tkt-status-' . EE_Ticket::onsale
1378
-                : ' tkt-status-' . $ticket->ticket_status(),
1377
+                ? ' tkt-status-'.EE_Ticket::onsale
1378
+                : ' tkt-status-'.$ticket->ticket_status(),
1379 1379
         );
1380 1380
         // filter template args
1381 1381
         $template_args = apply_filters(
@@ -1390,7 +1390,7 @@  discard block
 block discarded – undo
1390 1390
             $this->_is_creating_event
1391 1391
         );
1392 1392
         return EEH_Template::display_template(
1393
-            PRICING_TEMPLATE_PATH . 'event_tickets_datetime_dtt_tickets_list.template.php',
1393
+            PRICING_TEMPLATE_PATH.'event_tickets_datetime_dtt_tickets_list.template.php',
1394 1394
             $template_args,
1395 1395
             true
1396 1396
         );
@@ -1446,19 +1446,19 @@  discard block
 block discarded – undo
1446 1446
         // (otherwise there won't be any new relationships created for tickets based off of the default ticket).
1447 1447
         // This will future proof in case there is ever any behaviour change between what the primary_key defaults to.
1448 1448
         $default_dtt = $default || ($ticket instanceof EE_Ticket && $ticket->is_default());
1449
-        $tkt_datetimes = $ticket instanceof EE_Ticket && isset($ticket_datetimes[ $ticket->ID() ])
1450
-            ? $ticket_datetimes[ $ticket->ID() ]
1449
+        $tkt_datetimes = $ticket instanceof EE_Ticket && isset($ticket_datetimes[$ticket->ID()])
1450
+            ? $ticket_datetimes[$ticket->ID()]
1451 1451
             : array();
1452 1452
         $ticket_subtotal = $default ? 0 : $ticket->get_ticket_subtotal();
1453 1453
         $base_price = $default ? null : $ticket->base_price();
1454 1454
         $count_price_mods = EEM_Price::instance()->get_all_default_prices(true);
1455 1455
         // breaking out complicated condition for ticket_status
1456 1456
         if ($default) {
1457
-            $ticket_status_class = ' tkt-status-' . EE_Ticket::onsale;
1457
+            $ticket_status_class = ' tkt-status-'.EE_Ticket::onsale;
1458 1458
         } else {
1459 1459
             $ticket_status_class = $ticket->is_default()
1460
-                ? ' tkt-status-' . EE_Ticket::onsale
1461
-                : ' tkt-status-' . $ticket->ticket_status();
1460
+                ? ' tkt-status-'.EE_Ticket::onsale
1461
+                : ' tkt-status-'.$ticket->ticket_status();
1462 1462
         }
1463 1463
         // breaking out complicated condition for TKT_taxable
1464 1464
         if ($default) {
@@ -1550,7 +1550,7 @@  discard block
 block discarded – undo
1550 1550
                 : ' style="display:none;"',
1551 1551
             'show_price_mod_button'         => count($prices) > 1
1552 1552
                                                || ($default && $count_price_mods > 0)
1553
-                                               || (! $default && $ticket->deleted())
1553
+                                               || ( ! $default && $ticket->deleted())
1554 1554
                 ? ' style="display:none;"'
1555 1555
                 : '',
1556 1556
             'total_price_rows'              => count($prices) > 1 ? count($prices) : 1,
@@ -1594,7 +1594,7 @@  discard block
 block discarded – undo
1594 1594
                 $this->_date_time_format,
1595 1595
                 current_time('timestamp')
1596 1596
             );
1597
-            $template_args['tkt_status_class'] = ' tkt-status-' . EE_Ticket::onsale;
1597
+            $template_args['tkt_status_class'] = ' tkt-status-'.EE_Ticket::onsale;
1598 1598
         }
1599 1599
         if (empty($template_args['TKT_end_date'])) {
1600 1600
             // get the earliest datetime (if present);
@@ -1604,7 +1604,7 @@  discard block
 block discarded – undo
1604 1604
                     array('order_by' => array('DTT_EVT_start' => 'ASC'))
1605 1605
                 )
1606 1606
                 : null;
1607
-            if (! empty($earliest_dtt)) {
1607
+            if ( ! empty($earliest_dtt)) {
1608 1608
                 $template_args['TKT_end_date'] = $earliest_dtt->get_datetime(
1609 1609
                     'DTT_EVT_start',
1610 1610
                     $this->_date_time_format
@@ -1623,10 +1623,10 @@  discard block
 block discarded – undo
1623 1623
                     )
1624 1624
                 );
1625 1625
             }
1626
-            $template_args['tkt_status_class'] = ' tkt-status-' . EE_Ticket::onsale;
1626
+            $template_args['tkt_status_class'] = ' tkt-status-'.EE_Ticket::onsale;
1627 1627
         }
1628 1628
         // generate ticket_datetime items
1629
-        if (! $default) {
1629
+        if ( ! $default) {
1630 1630
             $datetime_row = 1;
1631 1631
             foreach ($all_datetimes as $datetime) {
1632 1632
                 $template_args['ticket_datetimes_list'] .= $this->_get_ticket_datetime_list_item(
@@ -1642,7 +1642,7 @@  discard block
 block discarded – undo
1642 1642
         }
1643 1643
         $price_row = 1;
1644 1644
         foreach ($prices as $price) {
1645
-            if (! $price instanceof EE_Price) {
1645
+            if ( ! $price instanceof EE_Price) {
1646 1646
                 continue;
1647 1647
             }
1648 1648
             if ($price->is_base_price()) {
@@ -1675,7 +1675,7 @@  discard block
 block discarded – undo
1675 1675
             $this->_is_creating_event
1676 1676
         );
1677 1677
         return EEH_Template::display_template(
1678
-            PRICING_TEMPLATE_PATH . 'event_tickets_datetime_ticket_row.template.php',
1678
+            PRICING_TEMPLATE_PATH.'event_tickets_datetime_ticket_row.template.php',
1679 1679
             $template_args,
1680 1680
             true
1681 1681
         );
@@ -1715,7 +1715,7 @@  discard block
 block discarded – undo
1715 1715
                 $this->_is_creating_event
1716 1716
             );
1717 1717
             $tax_rows .= EEH_Template::display_template(
1718
-                PRICING_TEMPLATE_PATH . 'event_tickets_datetime_ticket_tax_row.template.php',
1718
+                PRICING_TEMPLATE_PATH.'event_tickets_datetime_ticket_tax_row.template.php',
1719 1719
                 $template_args,
1720 1720
                 true
1721 1721
             );
@@ -1834,7 +1834,7 @@  discard block
 block discarded – undo
1834 1834
             $this->_is_creating_event
1835 1835
         );
1836 1836
         return EEH_Template::display_template(
1837
-            PRICING_TEMPLATE_PATH . 'event_tickets_datetime_ticket_price_row.template.php',
1837
+            PRICING_TEMPLATE_PATH.'event_tickets_datetime_ticket_price_row.template.php',
1838 1838
             $template_args,
1839 1839
             true
1840 1840
         );
@@ -1904,7 +1904,7 @@  discard block
 block discarded – undo
1904 1904
             $this->_is_creating_event
1905 1905
         );
1906 1906
         return EEH_Template::display_template(
1907
-            PRICING_TEMPLATE_PATH . 'event_tickets_datetime_price_type_base.template.php',
1907
+            PRICING_TEMPLATE_PATH.'event_tickets_datetime_price_type_base.template.php',
1908 1908
             $template_args,
1909 1909
             true
1910 1910
         );
@@ -1934,7 +1934,7 @@  discard block
 block discarded – undo
1934 1934
     ) {
1935 1935
         $select_name = $default && ! $price instanceof EE_Price
1936 1936
             ? 'edit_prices[TICKETNUM][PRICENUM][PRT_ID]'
1937
-            : 'edit_prices[' . esc_attr($ticket_row) . '][' . esc_attr($price_row) . '][PRT_ID]';
1937
+            : 'edit_prices['.esc_attr($ticket_row).']['.esc_attr($price_row).'][PRT_ID]';
1938 1938
         /** @var EEM_Price_Type $price_type_model */
1939 1939
         $price_type_model = EE_Registry::instance()->load_model('Price_Type');
1940 1940
         $price_types = $price_type_model->get_all(array(
@@ -1952,10 +1952,10 @@  discard block
 block discarded – undo
1952 1952
         $price_option_spans = '';
1953 1953
         // setup price types for selector
1954 1954
         foreach ($price_types as $price_type) {
1955
-            if (! $price_type instanceof EE_Price_Type) {
1955
+            if ( ! $price_type instanceof EE_Price_Type) {
1956 1956
                 continue;
1957 1957
             }
1958
-            $all_price_types[ $price_type->ID() ] = $price_type->get('PRT_name');
1958
+            $all_price_types[$price_type->ID()] = $price_type->get('PRT_name');
1959 1959
             // while we're in the loop let's setup the option spans used by js
1960 1960
             $span_args = array(
1961 1961
                 'PRT_ID'         => $price_type->ID(),
@@ -1963,12 +1963,12 @@  discard block
 block discarded – undo
1963 1963
                 'PRT_is_percent' => $price_type->get('PRT_is_percent') ? 1 : 0,
1964 1964
             );
1965 1965
             $price_option_spans .= EEH_Template::display_template(
1966
-                PRICING_TEMPLATE_PATH . 'event_tickets_datetime_price_option_span.template.php',
1966
+                PRICING_TEMPLATE_PATH.'event_tickets_datetime_price_option_span.template.php',
1967 1967
                 $span_args,
1968 1968
                 true
1969 1969
             );
1970 1970
         }
1971
-        $select_name = $disabled ? 'archive_price[' . $ticket_row . '][' . $price_row . '][PRT_ID]'
1971
+        $select_name = $disabled ? 'archive_price['.$ticket_row.']['.$price_row.'][PRT_ID]'
1972 1972
             : $select_name;
1973 1973
         $select_input = new EE_Select_Input(
1974 1974
             $all_price_types,
@@ -2005,7 +2005,7 @@  discard block
 block discarded – undo
2005 2005
             $this->_is_creating_event
2006 2006
         );
2007 2007
         return EEH_Template::display_template(
2008
-            PRICING_TEMPLATE_PATH . 'event_tickets_datetime_price_modifier_selector.template.php',
2008
+            PRICING_TEMPLATE_PATH.'event_tickets_datetime_price_modifier_selector.template.php',
2009 2009
             $template_args,
2010 2010
             true
2011 2011
         );
@@ -2031,8 +2031,8 @@  discard block
 block discarded – undo
2031 2031
         $ticket_datetimes = array(),
2032 2032
         $default
2033 2033
     ) {
2034
-        $tkt_datetimes = $ticket instanceof EE_Ticket && isset($ticket_datetimes[ $ticket->ID() ])
2035
-            ? $ticket_datetimes[ $ticket->ID() ]
2034
+        $tkt_datetimes = $ticket instanceof EE_Ticket && isset($ticket_datetimes[$ticket->ID()])
2035
+            ? $ticket_datetimes[$ticket->ID()]
2036 2036
             : array();
2037 2037
         $template_args = array(
2038 2038
             'dtt_row'                  => $default && ! $datetime instanceof EE_Datetime
@@ -2064,7 +2064,7 @@  discard block
 block discarded – undo
2064 2064
             $this->_is_creating_event
2065 2065
         );
2066 2066
         return EEH_Template::display_template(
2067
-            PRICING_TEMPLATE_PATH . 'event_tickets_datetime_ticket_datetimes_list_item.template.php',
2067
+            PRICING_TEMPLATE_PATH.'event_tickets_datetime_ticket_datetimes_list_item.template.php',
2068 2068
             $template_args,
2069 2069
             true
2070 2070
         );
@@ -2170,7 +2170,7 @@  discard block
 block discarded – undo
2170 2170
         $default_prices = $price_model->get_all_default_prices();
2171 2171
         $price_row = 1;
2172 2172
         foreach ($default_prices as $price) {
2173
-            if (! $price instanceof EE_Price) {
2173
+            if ( ! $price instanceof EE_Price) {
2174 2174
                 continue;
2175 2175
             }
2176 2176
             if ($price->is_base_price()) {
@@ -2207,7 +2207,7 @@  discard block
 block discarded – undo
2207 2207
             $this->_is_creating_event
2208 2208
         );
2209 2209
         return EEH_Template::display_template(
2210
-            PRICING_TEMPLATE_PATH . 'event_tickets_datetime_ticket_js_structure.template.php',
2210
+            PRICING_TEMPLATE_PATH.'event_tickets_datetime_ticket_js_structure.template.php',
2211 2211
             $template_args,
2212 2212
             true
2213 2213
         );
Please login to merge, or discard this patch.
vendor/composer/installed.php 2 patches
Indentation   +410 added lines, -410 removed lines patch added patch discarded remove patch
@@ -1,412 +1,412 @@
 block discarded – undo
1 1
 <?php return array(
2
-    'root' => array(
3
-        'pretty_version' => 'dev-master',
4
-        'version' => 'dev-master',
5
-        'type' => 'wordpress-plugin',
6
-        'install_path' => __DIR__ . '/../../',
7
-        'aliases' => array(),
8
-        'reference' => '596c839778ed33cff8de6da72ac80919bd1dae9c',
9
-        'name' => 'eventespresso/event-espresso-core',
10
-        'dev' => true,
11
-    ),
12
-    'versions' => array(
13
-        'composer/installers' => array(
14
-            'pretty_version' => 'v2.1.0',
15
-            'version' => '2.1.0.0',
16
-            'type' => 'composer-plugin',
17
-            'install_path' => __DIR__ . '/./installers',
18
-            'aliases' => array(),
19
-            'reference' => '75e5ef05436c90ac565a48176cc7465991908352',
20
-            'dev_requirement' => false,
21
-        ),
22
-        'doctrine/instantiator' => array(
23
-            'pretty_version' => '1.4.1',
24
-            'version' => '1.4.1.0',
25
-            'type' => 'library',
26
-            'install_path' => __DIR__ . '/../doctrine/instantiator',
27
-            'aliases' => array(),
28
-            'reference' => '10dcfce151b967d20fde1b34ae6640712c3891bc',
29
-            'dev_requirement' => true,
30
-        ),
31
-        'eventespresso/ee-coding-standards' => array(
32
-            'pretty_version' => 'dev-master',
33
-            'version' => 'dev-master',
34
-            'type' => 'phpcodesniffer-standard',
35
-            'install_path' => __DIR__ . '/../eventespresso/ee-coding-standards',
36
-            'aliases' => array(
37
-                0 => '9999999-dev',
38
-            ),
39
-            'reference' => '4bbdbb4ed08aeb7ac719b19d8adbd0974c8b63ae',
40
-            'dev_requirement' => true,
41
-        ),
42
-        'eventespresso/event-espresso-core' => array(
43
-            'pretty_version' => 'dev-master',
44
-            'version' => 'dev-master',
45
-            'type' => 'wordpress-plugin',
46
-            'install_path' => __DIR__ . '/../../',
47
-            'aliases' => array(),
48
-            'reference' => '596c839778ed33cff8de6da72ac80919bd1dae9c',
49
-            'dev_requirement' => false,
50
-        ),
51
-        'myclabs/deep-copy' => array(
52
-            'pretty_version' => '1.11.0',
53
-            'version' => '1.11.0.0',
54
-            'type' => 'library',
55
-            'install_path' => __DIR__ . '/../myclabs/deep-copy',
56
-            'aliases' => array(),
57
-            'reference' => '14daed4296fae74d9e3201d2c4925d1acb7aa614',
58
-            'dev_requirement' => true,
59
-        ),
60
-        'nikic/php-parser' => array(
61
-            'pretty_version' => 'v4.13.2',
62
-            'version' => '4.13.2.0',
63
-            'type' => 'library',
64
-            'install_path' => __DIR__ . '/../nikic/php-parser',
65
-            'aliases' => array(),
66
-            'reference' => '210577fe3cf7badcc5814d99455df46564f3c077',
67
-            'dev_requirement' => true,
68
-        ),
69
-        'phar-io/manifest' => array(
70
-            'pretty_version' => '2.0.3',
71
-            'version' => '2.0.3.0',
72
-            'type' => 'library',
73
-            'install_path' => __DIR__ . '/../phar-io/manifest',
74
-            'aliases' => array(),
75
-            'reference' => '97803eca37d319dfa7826cc2437fc020857acb53',
76
-            'dev_requirement' => true,
77
-        ),
78
-        'phar-io/version' => array(
79
-            'pretty_version' => '3.2.1',
80
-            'version' => '3.2.1.0',
81
-            'type' => 'library',
82
-            'install_path' => __DIR__ . '/../phar-io/version',
83
-            'aliases' => array(),
84
-            'reference' => '4f7fd7836c6f332bb2933569e566a0d6c4cbed74',
85
-            'dev_requirement' => true,
86
-        ),
87
-        'phpcompatibility/php-compatibility' => array(
88
-            'pretty_version' => '9.3.5',
89
-            'version' => '9.3.5.0',
90
-            'type' => 'phpcodesniffer-standard',
91
-            'install_path' => __DIR__ . '/../phpcompatibility/php-compatibility',
92
-            'aliases' => array(),
93
-            'reference' => '9fb324479acf6f39452e0655d2429cc0d3914243',
94
-            'dev_requirement' => true,
95
-        ),
96
-        'phpcompatibility/phpcompatibility-paragonie' => array(
97
-            'pretty_version' => '1.3.1',
98
-            'version' => '1.3.1.0',
99
-            'type' => 'phpcodesniffer-standard',
100
-            'install_path' => __DIR__ . '/../phpcompatibility/phpcompatibility-paragonie',
101
-            'aliases' => array(),
102
-            'reference' => 'ddabec839cc003651f2ce695c938686d1086cf43',
103
-            'dev_requirement' => true,
104
-        ),
105
-        'phpcompatibility/phpcompatibility-wp' => array(
106
-            'pretty_version' => '2.1.3',
107
-            'version' => '2.1.3.0',
108
-            'type' => 'phpcodesniffer-standard',
109
-            'install_path' => __DIR__ . '/../phpcompatibility/phpcompatibility-wp',
110
-            'aliases' => array(),
111
-            'reference' => 'd55de55f88697b9cdb94bccf04f14eb3b11cf308',
112
-            'dev_requirement' => true,
113
-        ),
114
-        'phpdocumentor/reflection-common' => array(
115
-            'pretty_version' => '2.2.0',
116
-            'version' => '2.2.0.0',
117
-            'type' => 'library',
118
-            'install_path' => __DIR__ . '/../phpdocumentor/reflection-common',
119
-            'aliases' => array(),
120
-            'reference' => '1d01c49d4ed62f25aa84a747ad35d5a16924662b',
121
-            'dev_requirement' => true,
122
-        ),
123
-        'phpdocumentor/reflection-docblock' => array(
124
-            'pretty_version' => '5.3.0',
125
-            'version' => '5.3.0.0',
126
-            'type' => 'library',
127
-            'install_path' => __DIR__ . '/../phpdocumentor/reflection-docblock',
128
-            'aliases' => array(),
129
-            'reference' => '622548b623e81ca6d78b721c5e029f4ce664f170',
130
-            'dev_requirement' => true,
131
-        ),
132
-        'phpdocumentor/type-resolver' => array(
133
-            'pretty_version' => '1.6.0',
134
-            'version' => '1.6.0.0',
135
-            'type' => 'library',
136
-            'install_path' => __DIR__ . '/../phpdocumentor/type-resolver',
137
-            'aliases' => array(),
138
-            'reference' => '93ebd0014cab80c4ea9f5e297ea48672f1b87706',
139
-            'dev_requirement' => true,
140
-        ),
141
-        'phpspec/prophecy' => array(
142
-            'pretty_version' => 'v1.15.0',
143
-            'version' => '1.15.0.0',
144
-            'type' => 'library',
145
-            'install_path' => __DIR__ . '/../phpspec/prophecy',
146
-            'aliases' => array(),
147
-            'reference' => 'bbcd7380b0ebf3961ee21409db7b38bc31d69a13',
148
-            'dev_requirement' => true,
149
-        ),
150
-        'phpunit/php-code-coverage' => array(
151
-            'pretty_version' => '9.2.15',
152
-            'version' => '9.2.15.0',
153
-            'type' => 'library',
154
-            'install_path' => __DIR__ . '/../phpunit/php-code-coverage',
155
-            'aliases' => array(),
156
-            'reference' => '2e9da11878c4202f97915c1cb4bb1ca318a63f5f',
157
-            'dev_requirement' => true,
158
-        ),
159
-        'phpunit/php-file-iterator' => array(
160
-            'pretty_version' => '3.0.6',
161
-            'version' => '3.0.6.0',
162
-            'type' => 'library',
163
-            'install_path' => __DIR__ . '/../phpunit/php-file-iterator',
164
-            'aliases' => array(),
165
-            'reference' => 'cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf',
166
-            'dev_requirement' => true,
167
-        ),
168
-        'phpunit/php-invoker' => array(
169
-            'pretty_version' => '3.1.1',
170
-            'version' => '3.1.1.0',
171
-            'type' => 'library',
172
-            'install_path' => __DIR__ . '/../phpunit/php-invoker',
173
-            'aliases' => array(),
174
-            'reference' => '5a10147d0aaf65b58940a0b72f71c9ac0423cc67',
175
-            'dev_requirement' => true,
176
-        ),
177
-        'phpunit/php-text-template' => array(
178
-            'pretty_version' => '2.0.4',
179
-            'version' => '2.0.4.0',
180
-            'type' => 'library',
181
-            'install_path' => __DIR__ . '/../phpunit/php-text-template',
182
-            'aliases' => array(),
183
-            'reference' => '5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28',
184
-            'dev_requirement' => true,
185
-        ),
186
-        'phpunit/php-timer' => array(
187
-            'pretty_version' => '5.0.3',
188
-            'version' => '5.0.3.0',
189
-            'type' => 'library',
190
-            'install_path' => __DIR__ . '/../phpunit/php-timer',
191
-            'aliases' => array(),
192
-            'reference' => '5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2',
193
-            'dev_requirement' => true,
194
-        ),
195
-        'phpunit/phpunit' => array(
196
-            'pretty_version' => '9.5.19',
197
-            'version' => '9.5.19.0',
198
-            'type' => 'library',
199
-            'install_path' => __DIR__ . '/../phpunit/phpunit',
200
-            'aliases' => array(),
201
-            'reference' => '35ea4b7f3acabb26f4bb640f8c30866c401da807',
202
-            'dev_requirement' => true,
203
-        ),
204
-        'roave/security-advisories' => array(
205
-            'pretty_version' => 'dev-master',
206
-            'version' => 'dev-master',
207
-            'type' => 'metapackage',
208
-            'install_path' => NULL,
209
-            'aliases' => array(),
210
-            'reference' => 'a1696aadf99f7ff55d44c56e7ebf54eace85310c',
211
-            'dev_requirement' => true,
212
-        ),
213
-        'sebastian/cli-parser' => array(
214
-            'pretty_version' => '1.0.1',
215
-            'version' => '1.0.1.0',
216
-            'type' => 'library',
217
-            'install_path' => __DIR__ . '/../sebastian/cli-parser',
218
-            'aliases' => array(),
219
-            'reference' => '442e7c7e687e42adc03470c7b668bc4b2402c0b2',
220
-            'dev_requirement' => true,
221
-        ),
222
-        'sebastian/code-unit' => array(
223
-            'pretty_version' => '1.0.8',
224
-            'version' => '1.0.8.0',
225
-            'type' => 'library',
226
-            'install_path' => __DIR__ . '/../sebastian/code-unit',
227
-            'aliases' => array(),
228
-            'reference' => '1fc9f64c0927627ef78ba436c9b17d967e68e120',
229
-            'dev_requirement' => true,
230
-        ),
231
-        'sebastian/code-unit-reverse-lookup' => array(
232
-            'pretty_version' => '2.0.3',
233
-            'version' => '2.0.3.0',
234
-            'type' => 'library',
235
-            'install_path' => __DIR__ . '/../sebastian/code-unit-reverse-lookup',
236
-            'aliases' => array(),
237
-            'reference' => 'ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5',
238
-            'dev_requirement' => true,
239
-        ),
240
-        'sebastian/comparator' => array(
241
-            'pretty_version' => '4.0.6',
242
-            'version' => '4.0.6.0',
243
-            'type' => 'library',
244
-            'install_path' => __DIR__ . '/../sebastian/comparator',
245
-            'aliases' => array(),
246
-            'reference' => '55f4261989e546dc112258c7a75935a81a7ce382',
247
-            'dev_requirement' => true,
248
-        ),
249
-        'sebastian/complexity' => array(
250
-            'pretty_version' => '2.0.2',
251
-            'version' => '2.0.2.0',
252
-            'type' => 'library',
253
-            'install_path' => __DIR__ . '/../sebastian/complexity',
254
-            'aliases' => array(),
255
-            'reference' => '739b35e53379900cc9ac327b2147867b8b6efd88',
256
-            'dev_requirement' => true,
257
-        ),
258
-        'sebastian/diff' => array(
259
-            'pretty_version' => '4.0.4',
260
-            'version' => '4.0.4.0',
261
-            'type' => 'library',
262
-            'install_path' => __DIR__ . '/../sebastian/diff',
263
-            'aliases' => array(),
264
-            'reference' => '3461e3fccc7cfdfc2720be910d3bd73c69be590d',
265
-            'dev_requirement' => true,
266
-        ),
267
-        'sebastian/environment' => array(
268
-            'pretty_version' => '5.1.3',
269
-            'version' => '5.1.3.0',
270
-            'type' => 'library',
271
-            'install_path' => __DIR__ . '/../sebastian/environment',
272
-            'aliases' => array(),
273
-            'reference' => '388b6ced16caa751030f6a69e588299fa09200ac',
274
-            'dev_requirement' => true,
275
-        ),
276
-        'sebastian/exporter' => array(
277
-            'pretty_version' => '4.0.4',
278
-            'version' => '4.0.4.0',
279
-            'type' => 'library',
280
-            'install_path' => __DIR__ . '/../sebastian/exporter',
281
-            'aliases' => array(),
282
-            'reference' => '65e8b7db476c5dd267e65eea9cab77584d3cfff9',
283
-            'dev_requirement' => true,
284
-        ),
285
-        'sebastian/global-state' => array(
286
-            'pretty_version' => '5.0.5',
287
-            'version' => '5.0.5.0',
288
-            'type' => 'library',
289
-            'install_path' => __DIR__ . '/../sebastian/global-state',
290
-            'aliases' => array(),
291
-            'reference' => '0ca8db5a5fc9c8646244e629625ac486fa286bf2',
292
-            'dev_requirement' => true,
293
-        ),
294
-        'sebastian/lines-of-code' => array(
295
-            'pretty_version' => '1.0.3',
296
-            'version' => '1.0.3.0',
297
-            'type' => 'library',
298
-            'install_path' => __DIR__ . '/../sebastian/lines-of-code',
299
-            'aliases' => array(),
300
-            'reference' => 'c1c2e997aa3146983ed888ad08b15470a2e22ecc',
301
-            'dev_requirement' => true,
302
-        ),
303
-        'sebastian/object-enumerator' => array(
304
-            'pretty_version' => '4.0.4',
305
-            'version' => '4.0.4.0',
306
-            'type' => 'library',
307
-            'install_path' => __DIR__ . '/../sebastian/object-enumerator',
308
-            'aliases' => array(),
309
-            'reference' => '5c9eeac41b290a3712d88851518825ad78f45c71',
310
-            'dev_requirement' => true,
311
-        ),
312
-        'sebastian/object-reflector' => array(
313
-            'pretty_version' => '2.0.4',
314
-            'version' => '2.0.4.0',
315
-            'type' => 'library',
316
-            'install_path' => __DIR__ . '/../sebastian/object-reflector',
317
-            'aliases' => array(),
318
-            'reference' => 'b4f479ebdbf63ac605d183ece17d8d7fe49c15c7',
319
-            'dev_requirement' => true,
320
-        ),
321
-        'sebastian/recursion-context' => array(
322
-            'pretty_version' => '4.0.4',
323
-            'version' => '4.0.4.0',
324
-            'type' => 'library',
325
-            'install_path' => __DIR__ . '/../sebastian/recursion-context',
326
-            'aliases' => array(),
327
-            'reference' => 'cd9d8cf3c5804de4341c283ed787f099f5506172',
328
-            'dev_requirement' => true,
329
-        ),
330
-        'sebastian/resource-operations' => array(
331
-            'pretty_version' => '3.0.3',
332
-            'version' => '3.0.3.0',
333
-            'type' => 'library',
334
-            'install_path' => __DIR__ . '/../sebastian/resource-operations',
335
-            'aliases' => array(),
336
-            'reference' => '0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8',
337
-            'dev_requirement' => true,
338
-        ),
339
-        'sebastian/type' => array(
340
-            'pretty_version' => '3.0.0',
341
-            'version' => '3.0.0.0',
342
-            'type' => 'library',
343
-            'install_path' => __DIR__ . '/../sebastian/type',
344
-            'aliases' => array(),
345
-            'reference' => 'b233b84bc4465aff7b57cf1c4bc75c86d00d6dad',
346
-            'dev_requirement' => true,
347
-        ),
348
-        'sebastian/version' => array(
349
-            'pretty_version' => '3.0.2',
350
-            'version' => '3.0.2.0',
351
-            'type' => 'library',
352
-            'install_path' => __DIR__ . '/../sebastian/version',
353
-            'aliases' => array(),
354
-            'reference' => 'c6c1022351a901512170118436c764e473f6de8c',
355
-            'dev_requirement' => true,
356
-        ),
357
-        'squizlabs/php_codesniffer' => array(
358
-            'pretty_version' => '3.6.2',
359
-            'version' => '3.6.2.0',
360
-            'type' => 'library',
361
-            'install_path' => __DIR__ . '/../squizlabs/php_codesniffer',
362
-            'aliases' => array(),
363
-            'reference' => '5e4e71592f69da17871dba6e80dd51bce74a351a',
364
-            'dev_requirement' => true,
365
-        ),
366
-        'symfony/polyfill-ctype' => array(
367
-            'pretty_version' => 'v1.25.0',
368
-            'version' => '1.25.0.0',
369
-            'type' => 'library',
370
-            'install_path' => __DIR__ . '/../symfony/polyfill-ctype',
371
-            'aliases' => array(),
372
-            'reference' => '30885182c981ab175d4d034db0f6f469898070ab',
373
-            'dev_requirement' => true,
374
-        ),
375
-        'theseer/tokenizer' => array(
376
-            'pretty_version' => '1.2.1',
377
-            'version' => '1.2.1.0',
378
-            'type' => 'library',
379
-            'install_path' => __DIR__ . '/../theseer/tokenizer',
380
-            'aliases' => array(),
381
-            'reference' => '34a41e998c2183e22995f158c581e7b5e755ab9e',
382
-            'dev_requirement' => true,
383
-        ),
384
-        'webmozart/assert' => array(
385
-            'pretty_version' => '1.10.0',
386
-            'version' => '1.10.0.0',
387
-            'type' => 'library',
388
-            'install_path' => __DIR__ . '/../webmozart/assert',
389
-            'aliases' => array(),
390
-            'reference' => '6964c76c7804814a842473e0c8fd15bab0f18e25',
391
-            'dev_requirement' => true,
392
-        ),
393
-        'wp-coding-standards/wpcs' => array(
394
-            'pretty_version' => '2.3.0',
395
-            'version' => '2.3.0.0',
396
-            'type' => 'phpcodesniffer-standard',
397
-            'install_path' => __DIR__ . '/../wp-coding-standards/wpcs',
398
-            'aliases' => array(),
399
-            'reference' => '7da1894633f168fe244afc6de00d141f27517b62',
400
-            'dev_requirement' => true,
401
-        ),
402
-        'yoast/phpunit-polyfills' => array(
403
-            'pretty_version' => '1.0.3',
404
-            'version' => '1.0.3.0',
405
-            'type' => 'library',
406
-            'install_path' => __DIR__ . '/../yoast/phpunit-polyfills',
407
-            'aliases' => array(),
408
-            'reference' => '5ea3536428944955f969bc764bbe09738e151ada',
409
-            'dev_requirement' => true,
410
-        ),
411
-    ),
2
+	'root' => array(
3
+		'pretty_version' => 'dev-master',
4
+		'version' => 'dev-master',
5
+		'type' => 'wordpress-plugin',
6
+		'install_path' => __DIR__ . '/../../',
7
+		'aliases' => array(),
8
+		'reference' => '596c839778ed33cff8de6da72ac80919bd1dae9c',
9
+		'name' => 'eventespresso/event-espresso-core',
10
+		'dev' => true,
11
+	),
12
+	'versions' => array(
13
+		'composer/installers' => array(
14
+			'pretty_version' => 'v2.1.0',
15
+			'version' => '2.1.0.0',
16
+			'type' => 'composer-plugin',
17
+			'install_path' => __DIR__ . '/./installers',
18
+			'aliases' => array(),
19
+			'reference' => '75e5ef05436c90ac565a48176cc7465991908352',
20
+			'dev_requirement' => false,
21
+		),
22
+		'doctrine/instantiator' => array(
23
+			'pretty_version' => '1.4.1',
24
+			'version' => '1.4.1.0',
25
+			'type' => 'library',
26
+			'install_path' => __DIR__ . '/../doctrine/instantiator',
27
+			'aliases' => array(),
28
+			'reference' => '10dcfce151b967d20fde1b34ae6640712c3891bc',
29
+			'dev_requirement' => true,
30
+		),
31
+		'eventespresso/ee-coding-standards' => array(
32
+			'pretty_version' => 'dev-master',
33
+			'version' => 'dev-master',
34
+			'type' => 'phpcodesniffer-standard',
35
+			'install_path' => __DIR__ . '/../eventespresso/ee-coding-standards',
36
+			'aliases' => array(
37
+				0 => '9999999-dev',
38
+			),
39
+			'reference' => '4bbdbb4ed08aeb7ac719b19d8adbd0974c8b63ae',
40
+			'dev_requirement' => true,
41
+		),
42
+		'eventespresso/event-espresso-core' => array(
43
+			'pretty_version' => 'dev-master',
44
+			'version' => 'dev-master',
45
+			'type' => 'wordpress-plugin',
46
+			'install_path' => __DIR__ . '/../../',
47
+			'aliases' => array(),
48
+			'reference' => '596c839778ed33cff8de6da72ac80919bd1dae9c',
49
+			'dev_requirement' => false,
50
+		),
51
+		'myclabs/deep-copy' => array(
52
+			'pretty_version' => '1.11.0',
53
+			'version' => '1.11.0.0',
54
+			'type' => 'library',
55
+			'install_path' => __DIR__ . '/../myclabs/deep-copy',
56
+			'aliases' => array(),
57
+			'reference' => '14daed4296fae74d9e3201d2c4925d1acb7aa614',
58
+			'dev_requirement' => true,
59
+		),
60
+		'nikic/php-parser' => array(
61
+			'pretty_version' => 'v4.13.2',
62
+			'version' => '4.13.2.0',
63
+			'type' => 'library',
64
+			'install_path' => __DIR__ . '/../nikic/php-parser',
65
+			'aliases' => array(),
66
+			'reference' => '210577fe3cf7badcc5814d99455df46564f3c077',
67
+			'dev_requirement' => true,
68
+		),
69
+		'phar-io/manifest' => array(
70
+			'pretty_version' => '2.0.3',
71
+			'version' => '2.0.3.0',
72
+			'type' => 'library',
73
+			'install_path' => __DIR__ . '/../phar-io/manifest',
74
+			'aliases' => array(),
75
+			'reference' => '97803eca37d319dfa7826cc2437fc020857acb53',
76
+			'dev_requirement' => true,
77
+		),
78
+		'phar-io/version' => array(
79
+			'pretty_version' => '3.2.1',
80
+			'version' => '3.2.1.0',
81
+			'type' => 'library',
82
+			'install_path' => __DIR__ . '/../phar-io/version',
83
+			'aliases' => array(),
84
+			'reference' => '4f7fd7836c6f332bb2933569e566a0d6c4cbed74',
85
+			'dev_requirement' => true,
86
+		),
87
+		'phpcompatibility/php-compatibility' => array(
88
+			'pretty_version' => '9.3.5',
89
+			'version' => '9.3.5.0',
90
+			'type' => 'phpcodesniffer-standard',
91
+			'install_path' => __DIR__ . '/../phpcompatibility/php-compatibility',
92
+			'aliases' => array(),
93
+			'reference' => '9fb324479acf6f39452e0655d2429cc0d3914243',
94
+			'dev_requirement' => true,
95
+		),
96
+		'phpcompatibility/phpcompatibility-paragonie' => array(
97
+			'pretty_version' => '1.3.1',
98
+			'version' => '1.3.1.0',
99
+			'type' => 'phpcodesniffer-standard',
100
+			'install_path' => __DIR__ . '/../phpcompatibility/phpcompatibility-paragonie',
101
+			'aliases' => array(),
102
+			'reference' => 'ddabec839cc003651f2ce695c938686d1086cf43',
103
+			'dev_requirement' => true,
104
+		),
105
+		'phpcompatibility/phpcompatibility-wp' => array(
106
+			'pretty_version' => '2.1.3',
107
+			'version' => '2.1.3.0',
108
+			'type' => 'phpcodesniffer-standard',
109
+			'install_path' => __DIR__ . '/../phpcompatibility/phpcompatibility-wp',
110
+			'aliases' => array(),
111
+			'reference' => 'd55de55f88697b9cdb94bccf04f14eb3b11cf308',
112
+			'dev_requirement' => true,
113
+		),
114
+		'phpdocumentor/reflection-common' => array(
115
+			'pretty_version' => '2.2.0',
116
+			'version' => '2.2.0.0',
117
+			'type' => 'library',
118
+			'install_path' => __DIR__ . '/../phpdocumentor/reflection-common',
119
+			'aliases' => array(),
120
+			'reference' => '1d01c49d4ed62f25aa84a747ad35d5a16924662b',
121
+			'dev_requirement' => true,
122
+		),
123
+		'phpdocumentor/reflection-docblock' => array(
124
+			'pretty_version' => '5.3.0',
125
+			'version' => '5.3.0.0',
126
+			'type' => 'library',
127
+			'install_path' => __DIR__ . '/../phpdocumentor/reflection-docblock',
128
+			'aliases' => array(),
129
+			'reference' => '622548b623e81ca6d78b721c5e029f4ce664f170',
130
+			'dev_requirement' => true,
131
+		),
132
+		'phpdocumentor/type-resolver' => array(
133
+			'pretty_version' => '1.6.0',
134
+			'version' => '1.6.0.0',
135
+			'type' => 'library',
136
+			'install_path' => __DIR__ . '/../phpdocumentor/type-resolver',
137
+			'aliases' => array(),
138
+			'reference' => '93ebd0014cab80c4ea9f5e297ea48672f1b87706',
139
+			'dev_requirement' => true,
140
+		),
141
+		'phpspec/prophecy' => array(
142
+			'pretty_version' => 'v1.15.0',
143
+			'version' => '1.15.0.0',
144
+			'type' => 'library',
145
+			'install_path' => __DIR__ . '/../phpspec/prophecy',
146
+			'aliases' => array(),
147
+			'reference' => 'bbcd7380b0ebf3961ee21409db7b38bc31d69a13',
148
+			'dev_requirement' => true,
149
+		),
150
+		'phpunit/php-code-coverage' => array(
151
+			'pretty_version' => '9.2.15',
152
+			'version' => '9.2.15.0',
153
+			'type' => 'library',
154
+			'install_path' => __DIR__ . '/../phpunit/php-code-coverage',
155
+			'aliases' => array(),
156
+			'reference' => '2e9da11878c4202f97915c1cb4bb1ca318a63f5f',
157
+			'dev_requirement' => true,
158
+		),
159
+		'phpunit/php-file-iterator' => array(
160
+			'pretty_version' => '3.0.6',
161
+			'version' => '3.0.6.0',
162
+			'type' => 'library',
163
+			'install_path' => __DIR__ . '/../phpunit/php-file-iterator',
164
+			'aliases' => array(),
165
+			'reference' => 'cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf',
166
+			'dev_requirement' => true,
167
+		),
168
+		'phpunit/php-invoker' => array(
169
+			'pretty_version' => '3.1.1',
170
+			'version' => '3.1.1.0',
171
+			'type' => 'library',
172
+			'install_path' => __DIR__ . '/../phpunit/php-invoker',
173
+			'aliases' => array(),
174
+			'reference' => '5a10147d0aaf65b58940a0b72f71c9ac0423cc67',
175
+			'dev_requirement' => true,
176
+		),
177
+		'phpunit/php-text-template' => array(
178
+			'pretty_version' => '2.0.4',
179
+			'version' => '2.0.4.0',
180
+			'type' => 'library',
181
+			'install_path' => __DIR__ . '/../phpunit/php-text-template',
182
+			'aliases' => array(),
183
+			'reference' => '5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28',
184
+			'dev_requirement' => true,
185
+		),
186
+		'phpunit/php-timer' => array(
187
+			'pretty_version' => '5.0.3',
188
+			'version' => '5.0.3.0',
189
+			'type' => 'library',
190
+			'install_path' => __DIR__ . '/../phpunit/php-timer',
191
+			'aliases' => array(),
192
+			'reference' => '5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2',
193
+			'dev_requirement' => true,
194
+		),
195
+		'phpunit/phpunit' => array(
196
+			'pretty_version' => '9.5.19',
197
+			'version' => '9.5.19.0',
198
+			'type' => 'library',
199
+			'install_path' => __DIR__ . '/../phpunit/phpunit',
200
+			'aliases' => array(),
201
+			'reference' => '35ea4b7f3acabb26f4bb640f8c30866c401da807',
202
+			'dev_requirement' => true,
203
+		),
204
+		'roave/security-advisories' => array(
205
+			'pretty_version' => 'dev-master',
206
+			'version' => 'dev-master',
207
+			'type' => 'metapackage',
208
+			'install_path' => NULL,
209
+			'aliases' => array(),
210
+			'reference' => 'a1696aadf99f7ff55d44c56e7ebf54eace85310c',
211
+			'dev_requirement' => true,
212
+		),
213
+		'sebastian/cli-parser' => array(
214
+			'pretty_version' => '1.0.1',
215
+			'version' => '1.0.1.0',
216
+			'type' => 'library',
217
+			'install_path' => __DIR__ . '/../sebastian/cli-parser',
218
+			'aliases' => array(),
219
+			'reference' => '442e7c7e687e42adc03470c7b668bc4b2402c0b2',
220
+			'dev_requirement' => true,
221
+		),
222
+		'sebastian/code-unit' => array(
223
+			'pretty_version' => '1.0.8',
224
+			'version' => '1.0.8.0',
225
+			'type' => 'library',
226
+			'install_path' => __DIR__ . '/../sebastian/code-unit',
227
+			'aliases' => array(),
228
+			'reference' => '1fc9f64c0927627ef78ba436c9b17d967e68e120',
229
+			'dev_requirement' => true,
230
+		),
231
+		'sebastian/code-unit-reverse-lookup' => array(
232
+			'pretty_version' => '2.0.3',
233
+			'version' => '2.0.3.0',
234
+			'type' => 'library',
235
+			'install_path' => __DIR__ . '/../sebastian/code-unit-reverse-lookup',
236
+			'aliases' => array(),
237
+			'reference' => 'ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5',
238
+			'dev_requirement' => true,
239
+		),
240
+		'sebastian/comparator' => array(
241
+			'pretty_version' => '4.0.6',
242
+			'version' => '4.0.6.0',
243
+			'type' => 'library',
244
+			'install_path' => __DIR__ . '/../sebastian/comparator',
245
+			'aliases' => array(),
246
+			'reference' => '55f4261989e546dc112258c7a75935a81a7ce382',
247
+			'dev_requirement' => true,
248
+		),
249
+		'sebastian/complexity' => array(
250
+			'pretty_version' => '2.0.2',
251
+			'version' => '2.0.2.0',
252
+			'type' => 'library',
253
+			'install_path' => __DIR__ . '/../sebastian/complexity',
254
+			'aliases' => array(),
255
+			'reference' => '739b35e53379900cc9ac327b2147867b8b6efd88',
256
+			'dev_requirement' => true,
257
+		),
258
+		'sebastian/diff' => array(
259
+			'pretty_version' => '4.0.4',
260
+			'version' => '4.0.4.0',
261
+			'type' => 'library',
262
+			'install_path' => __DIR__ . '/../sebastian/diff',
263
+			'aliases' => array(),
264
+			'reference' => '3461e3fccc7cfdfc2720be910d3bd73c69be590d',
265
+			'dev_requirement' => true,
266
+		),
267
+		'sebastian/environment' => array(
268
+			'pretty_version' => '5.1.3',
269
+			'version' => '5.1.3.0',
270
+			'type' => 'library',
271
+			'install_path' => __DIR__ . '/../sebastian/environment',
272
+			'aliases' => array(),
273
+			'reference' => '388b6ced16caa751030f6a69e588299fa09200ac',
274
+			'dev_requirement' => true,
275
+		),
276
+		'sebastian/exporter' => array(
277
+			'pretty_version' => '4.0.4',
278
+			'version' => '4.0.4.0',
279
+			'type' => 'library',
280
+			'install_path' => __DIR__ . '/../sebastian/exporter',
281
+			'aliases' => array(),
282
+			'reference' => '65e8b7db476c5dd267e65eea9cab77584d3cfff9',
283
+			'dev_requirement' => true,
284
+		),
285
+		'sebastian/global-state' => array(
286
+			'pretty_version' => '5.0.5',
287
+			'version' => '5.0.5.0',
288
+			'type' => 'library',
289
+			'install_path' => __DIR__ . '/../sebastian/global-state',
290
+			'aliases' => array(),
291
+			'reference' => '0ca8db5a5fc9c8646244e629625ac486fa286bf2',
292
+			'dev_requirement' => true,
293
+		),
294
+		'sebastian/lines-of-code' => array(
295
+			'pretty_version' => '1.0.3',
296
+			'version' => '1.0.3.0',
297
+			'type' => 'library',
298
+			'install_path' => __DIR__ . '/../sebastian/lines-of-code',
299
+			'aliases' => array(),
300
+			'reference' => 'c1c2e997aa3146983ed888ad08b15470a2e22ecc',
301
+			'dev_requirement' => true,
302
+		),
303
+		'sebastian/object-enumerator' => array(
304
+			'pretty_version' => '4.0.4',
305
+			'version' => '4.0.4.0',
306
+			'type' => 'library',
307
+			'install_path' => __DIR__ . '/../sebastian/object-enumerator',
308
+			'aliases' => array(),
309
+			'reference' => '5c9eeac41b290a3712d88851518825ad78f45c71',
310
+			'dev_requirement' => true,
311
+		),
312
+		'sebastian/object-reflector' => array(
313
+			'pretty_version' => '2.0.4',
314
+			'version' => '2.0.4.0',
315
+			'type' => 'library',
316
+			'install_path' => __DIR__ . '/../sebastian/object-reflector',
317
+			'aliases' => array(),
318
+			'reference' => 'b4f479ebdbf63ac605d183ece17d8d7fe49c15c7',
319
+			'dev_requirement' => true,
320
+		),
321
+		'sebastian/recursion-context' => array(
322
+			'pretty_version' => '4.0.4',
323
+			'version' => '4.0.4.0',
324
+			'type' => 'library',
325
+			'install_path' => __DIR__ . '/../sebastian/recursion-context',
326
+			'aliases' => array(),
327
+			'reference' => 'cd9d8cf3c5804de4341c283ed787f099f5506172',
328
+			'dev_requirement' => true,
329
+		),
330
+		'sebastian/resource-operations' => array(
331
+			'pretty_version' => '3.0.3',
332
+			'version' => '3.0.3.0',
333
+			'type' => 'library',
334
+			'install_path' => __DIR__ . '/../sebastian/resource-operations',
335
+			'aliases' => array(),
336
+			'reference' => '0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8',
337
+			'dev_requirement' => true,
338
+		),
339
+		'sebastian/type' => array(
340
+			'pretty_version' => '3.0.0',
341
+			'version' => '3.0.0.0',
342
+			'type' => 'library',
343
+			'install_path' => __DIR__ . '/../sebastian/type',
344
+			'aliases' => array(),
345
+			'reference' => 'b233b84bc4465aff7b57cf1c4bc75c86d00d6dad',
346
+			'dev_requirement' => true,
347
+		),
348
+		'sebastian/version' => array(
349
+			'pretty_version' => '3.0.2',
350
+			'version' => '3.0.2.0',
351
+			'type' => 'library',
352
+			'install_path' => __DIR__ . '/../sebastian/version',
353
+			'aliases' => array(),
354
+			'reference' => 'c6c1022351a901512170118436c764e473f6de8c',
355
+			'dev_requirement' => true,
356
+		),
357
+		'squizlabs/php_codesniffer' => array(
358
+			'pretty_version' => '3.6.2',
359
+			'version' => '3.6.2.0',
360
+			'type' => 'library',
361
+			'install_path' => __DIR__ . '/../squizlabs/php_codesniffer',
362
+			'aliases' => array(),
363
+			'reference' => '5e4e71592f69da17871dba6e80dd51bce74a351a',
364
+			'dev_requirement' => true,
365
+		),
366
+		'symfony/polyfill-ctype' => array(
367
+			'pretty_version' => 'v1.25.0',
368
+			'version' => '1.25.0.0',
369
+			'type' => 'library',
370
+			'install_path' => __DIR__ . '/../symfony/polyfill-ctype',
371
+			'aliases' => array(),
372
+			'reference' => '30885182c981ab175d4d034db0f6f469898070ab',
373
+			'dev_requirement' => true,
374
+		),
375
+		'theseer/tokenizer' => array(
376
+			'pretty_version' => '1.2.1',
377
+			'version' => '1.2.1.0',
378
+			'type' => 'library',
379
+			'install_path' => __DIR__ . '/../theseer/tokenizer',
380
+			'aliases' => array(),
381
+			'reference' => '34a41e998c2183e22995f158c581e7b5e755ab9e',
382
+			'dev_requirement' => true,
383
+		),
384
+		'webmozart/assert' => array(
385
+			'pretty_version' => '1.10.0',
386
+			'version' => '1.10.0.0',
387
+			'type' => 'library',
388
+			'install_path' => __DIR__ . '/../webmozart/assert',
389
+			'aliases' => array(),
390
+			'reference' => '6964c76c7804814a842473e0c8fd15bab0f18e25',
391
+			'dev_requirement' => true,
392
+		),
393
+		'wp-coding-standards/wpcs' => array(
394
+			'pretty_version' => '2.3.0',
395
+			'version' => '2.3.0.0',
396
+			'type' => 'phpcodesniffer-standard',
397
+			'install_path' => __DIR__ . '/../wp-coding-standards/wpcs',
398
+			'aliases' => array(),
399
+			'reference' => '7da1894633f168fe244afc6de00d141f27517b62',
400
+			'dev_requirement' => true,
401
+		),
402
+		'yoast/phpunit-polyfills' => array(
403
+			'pretty_version' => '1.0.3',
404
+			'version' => '1.0.3.0',
405
+			'type' => 'library',
406
+			'install_path' => __DIR__ . '/../yoast/phpunit-polyfills',
407
+			'aliases' => array(),
408
+			'reference' => '5ea3536428944955f969bc764bbe09738e151ada',
409
+			'dev_requirement' => true,
410
+		),
411
+	),
412 412
 );
Please login to merge, or discard this patch.
Spacing   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  discard block
 block discarded – undo
3 3
         'pretty_version' => 'dev-master',
4 4
         'version' => 'dev-master',
5 5
         'type' => 'wordpress-plugin',
6
-        'install_path' => __DIR__ . '/../../',
6
+        'install_path' => __DIR__.'/../../',
7 7
         'aliases' => array(),
8 8
         'reference' => '596c839778ed33cff8de6da72ac80919bd1dae9c',
9 9
         'name' => 'eventespresso/event-espresso-core',
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
             'pretty_version' => 'v2.1.0',
15 15
             'version' => '2.1.0.0',
16 16
             'type' => 'composer-plugin',
17
-            'install_path' => __DIR__ . '/./installers',
17
+            'install_path' => __DIR__.'/./installers',
18 18
             'aliases' => array(),
19 19
             'reference' => '75e5ef05436c90ac565a48176cc7465991908352',
20 20
             'dev_requirement' => false,
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
             'pretty_version' => '1.4.1',
24 24
             'version' => '1.4.1.0',
25 25
             'type' => 'library',
26
-            'install_path' => __DIR__ . '/../doctrine/instantiator',
26
+            'install_path' => __DIR__.'/../doctrine/instantiator',
27 27
             'aliases' => array(),
28 28
             'reference' => '10dcfce151b967d20fde1b34ae6640712c3891bc',
29 29
             'dev_requirement' => true,
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
             'pretty_version' => 'dev-master',
33 33
             'version' => 'dev-master',
34 34
             'type' => 'phpcodesniffer-standard',
35
-            'install_path' => __DIR__ . '/../eventespresso/ee-coding-standards',
35
+            'install_path' => __DIR__.'/../eventespresso/ee-coding-standards',
36 36
             'aliases' => array(
37 37
                 0 => '9999999-dev',
38 38
             ),
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
             'pretty_version' => 'dev-master',
44 44
             'version' => 'dev-master',
45 45
             'type' => 'wordpress-plugin',
46
-            'install_path' => __DIR__ . '/../../',
46
+            'install_path' => __DIR__.'/../../',
47 47
             'aliases' => array(),
48 48
             'reference' => '596c839778ed33cff8de6da72ac80919bd1dae9c',
49 49
             'dev_requirement' => false,
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
             'pretty_version' => '1.11.0',
53 53
             'version' => '1.11.0.0',
54 54
             'type' => 'library',
55
-            'install_path' => __DIR__ . '/../myclabs/deep-copy',
55
+            'install_path' => __DIR__.'/../myclabs/deep-copy',
56 56
             'aliases' => array(),
57 57
             'reference' => '14daed4296fae74d9e3201d2c4925d1acb7aa614',
58 58
             'dev_requirement' => true,
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
             'pretty_version' => 'v4.13.2',
62 62
             'version' => '4.13.2.0',
63 63
             'type' => 'library',
64
-            'install_path' => __DIR__ . '/../nikic/php-parser',
64
+            'install_path' => __DIR__.'/../nikic/php-parser',
65 65
             'aliases' => array(),
66 66
             'reference' => '210577fe3cf7badcc5814d99455df46564f3c077',
67 67
             'dev_requirement' => true,
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
             'pretty_version' => '2.0.3',
71 71
             'version' => '2.0.3.0',
72 72
             'type' => 'library',
73
-            'install_path' => __DIR__ . '/../phar-io/manifest',
73
+            'install_path' => __DIR__.'/../phar-io/manifest',
74 74
             'aliases' => array(),
75 75
             'reference' => '97803eca37d319dfa7826cc2437fc020857acb53',
76 76
             'dev_requirement' => true,
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
             'pretty_version' => '3.2.1',
80 80
             'version' => '3.2.1.0',
81 81
             'type' => 'library',
82
-            'install_path' => __DIR__ . '/../phar-io/version',
82
+            'install_path' => __DIR__.'/../phar-io/version',
83 83
             'aliases' => array(),
84 84
             'reference' => '4f7fd7836c6f332bb2933569e566a0d6c4cbed74',
85 85
             'dev_requirement' => true,
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
             'pretty_version' => '9.3.5',
89 89
             'version' => '9.3.5.0',
90 90
             'type' => 'phpcodesniffer-standard',
91
-            'install_path' => __DIR__ . '/../phpcompatibility/php-compatibility',
91
+            'install_path' => __DIR__.'/../phpcompatibility/php-compatibility',
92 92
             'aliases' => array(),
93 93
             'reference' => '9fb324479acf6f39452e0655d2429cc0d3914243',
94 94
             'dev_requirement' => true,
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
             'pretty_version' => '1.3.1',
98 98
             'version' => '1.3.1.0',
99 99
             'type' => 'phpcodesniffer-standard',
100
-            'install_path' => __DIR__ . '/../phpcompatibility/phpcompatibility-paragonie',
100
+            'install_path' => __DIR__.'/../phpcompatibility/phpcompatibility-paragonie',
101 101
             'aliases' => array(),
102 102
             'reference' => 'ddabec839cc003651f2ce695c938686d1086cf43',
103 103
             'dev_requirement' => true,
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
             'pretty_version' => '2.1.3',
107 107
             'version' => '2.1.3.0',
108 108
             'type' => 'phpcodesniffer-standard',
109
-            'install_path' => __DIR__ . '/../phpcompatibility/phpcompatibility-wp',
109
+            'install_path' => __DIR__.'/../phpcompatibility/phpcompatibility-wp',
110 110
             'aliases' => array(),
111 111
             'reference' => 'd55de55f88697b9cdb94bccf04f14eb3b11cf308',
112 112
             'dev_requirement' => true,
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
             'pretty_version' => '2.2.0',
116 116
             'version' => '2.2.0.0',
117 117
             'type' => 'library',
118
-            'install_path' => __DIR__ . '/../phpdocumentor/reflection-common',
118
+            'install_path' => __DIR__.'/../phpdocumentor/reflection-common',
119 119
             'aliases' => array(),
120 120
             'reference' => '1d01c49d4ed62f25aa84a747ad35d5a16924662b',
121 121
             'dev_requirement' => true,
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
             'pretty_version' => '5.3.0',
125 125
             'version' => '5.3.0.0',
126 126
             'type' => 'library',
127
-            'install_path' => __DIR__ . '/../phpdocumentor/reflection-docblock',
127
+            'install_path' => __DIR__.'/../phpdocumentor/reflection-docblock',
128 128
             'aliases' => array(),
129 129
             'reference' => '622548b623e81ca6d78b721c5e029f4ce664f170',
130 130
             'dev_requirement' => true,
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
             'pretty_version' => '1.6.0',
134 134
             'version' => '1.6.0.0',
135 135
             'type' => 'library',
136
-            'install_path' => __DIR__ . '/../phpdocumentor/type-resolver',
136
+            'install_path' => __DIR__.'/../phpdocumentor/type-resolver',
137 137
             'aliases' => array(),
138 138
             'reference' => '93ebd0014cab80c4ea9f5e297ea48672f1b87706',
139 139
             'dev_requirement' => true,
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
             'pretty_version' => 'v1.15.0',
143 143
             'version' => '1.15.0.0',
144 144
             'type' => 'library',
145
-            'install_path' => __DIR__ . '/../phpspec/prophecy',
145
+            'install_path' => __DIR__.'/../phpspec/prophecy',
146 146
             'aliases' => array(),
147 147
             'reference' => 'bbcd7380b0ebf3961ee21409db7b38bc31d69a13',
148 148
             'dev_requirement' => true,
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
             'pretty_version' => '9.2.15',
152 152
             'version' => '9.2.15.0',
153 153
             'type' => 'library',
154
-            'install_path' => __DIR__ . '/../phpunit/php-code-coverage',
154
+            'install_path' => __DIR__.'/../phpunit/php-code-coverage',
155 155
             'aliases' => array(),
156 156
             'reference' => '2e9da11878c4202f97915c1cb4bb1ca318a63f5f',
157 157
             'dev_requirement' => true,
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
             'pretty_version' => '3.0.6',
161 161
             'version' => '3.0.6.0',
162 162
             'type' => 'library',
163
-            'install_path' => __DIR__ . '/../phpunit/php-file-iterator',
163
+            'install_path' => __DIR__.'/../phpunit/php-file-iterator',
164 164
             'aliases' => array(),
165 165
             'reference' => 'cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf',
166 166
             'dev_requirement' => true,
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
             'pretty_version' => '3.1.1',
170 170
             'version' => '3.1.1.0',
171 171
             'type' => 'library',
172
-            'install_path' => __DIR__ . '/../phpunit/php-invoker',
172
+            'install_path' => __DIR__.'/../phpunit/php-invoker',
173 173
             'aliases' => array(),
174 174
             'reference' => '5a10147d0aaf65b58940a0b72f71c9ac0423cc67',
175 175
             'dev_requirement' => true,
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
             'pretty_version' => '2.0.4',
179 179
             'version' => '2.0.4.0',
180 180
             'type' => 'library',
181
-            'install_path' => __DIR__ . '/../phpunit/php-text-template',
181
+            'install_path' => __DIR__.'/../phpunit/php-text-template',
182 182
             'aliases' => array(),
183 183
             'reference' => '5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28',
184 184
             'dev_requirement' => true,
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
             'pretty_version' => '5.0.3',
188 188
             'version' => '5.0.3.0',
189 189
             'type' => 'library',
190
-            'install_path' => __DIR__ . '/../phpunit/php-timer',
190
+            'install_path' => __DIR__.'/../phpunit/php-timer',
191 191
             'aliases' => array(),
192 192
             'reference' => '5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2',
193 193
             'dev_requirement' => true,
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
             'pretty_version' => '9.5.19',
197 197
             'version' => '9.5.19.0',
198 198
             'type' => 'library',
199
-            'install_path' => __DIR__ . '/../phpunit/phpunit',
199
+            'install_path' => __DIR__.'/../phpunit/phpunit',
200 200
             'aliases' => array(),
201 201
             'reference' => '35ea4b7f3acabb26f4bb640f8c30866c401da807',
202 202
             'dev_requirement' => true,
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
             'pretty_version' => '1.0.1',
215 215
             'version' => '1.0.1.0',
216 216
             'type' => 'library',
217
-            'install_path' => __DIR__ . '/../sebastian/cli-parser',
217
+            'install_path' => __DIR__.'/../sebastian/cli-parser',
218 218
             'aliases' => array(),
219 219
             'reference' => '442e7c7e687e42adc03470c7b668bc4b2402c0b2',
220 220
             'dev_requirement' => true,
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
             'pretty_version' => '1.0.8',
224 224
             'version' => '1.0.8.0',
225 225
             'type' => 'library',
226
-            'install_path' => __DIR__ . '/../sebastian/code-unit',
226
+            'install_path' => __DIR__.'/../sebastian/code-unit',
227 227
             'aliases' => array(),
228 228
             'reference' => '1fc9f64c0927627ef78ba436c9b17d967e68e120',
229 229
             'dev_requirement' => true,
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
             'pretty_version' => '2.0.3',
233 233
             'version' => '2.0.3.0',
234 234
             'type' => 'library',
235
-            'install_path' => __DIR__ . '/../sebastian/code-unit-reverse-lookup',
235
+            'install_path' => __DIR__.'/../sebastian/code-unit-reverse-lookup',
236 236
             'aliases' => array(),
237 237
             'reference' => 'ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5',
238 238
             'dev_requirement' => true,
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
             'pretty_version' => '4.0.6',
242 242
             'version' => '4.0.6.0',
243 243
             'type' => 'library',
244
-            'install_path' => __DIR__ . '/../sebastian/comparator',
244
+            'install_path' => __DIR__.'/../sebastian/comparator',
245 245
             'aliases' => array(),
246 246
             'reference' => '55f4261989e546dc112258c7a75935a81a7ce382',
247 247
             'dev_requirement' => true,
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
             'pretty_version' => '2.0.2',
251 251
             'version' => '2.0.2.0',
252 252
             'type' => 'library',
253
-            'install_path' => __DIR__ . '/../sebastian/complexity',
253
+            'install_path' => __DIR__.'/../sebastian/complexity',
254 254
             'aliases' => array(),
255 255
             'reference' => '739b35e53379900cc9ac327b2147867b8b6efd88',
256 256
             'dev_requirement' => true,
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
             'pretty_version' => '4.0.4',
260 260
             'version' => '4.0.4.0',
261 261
             'type' => 'library',
262
-            'install_path' => __DIR__ . '/../sebastian/diff',
262
+            'install_path' => __DIR__.'/../sebastian/diff',
263 263
             'aliases' => array(),
264 264
             'reference' => '3461e3fccc7cfdfc2720be910d3bd73c69be590d',
265 265
             'dev_requirement' => true,
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
             'pretty_version' => '5.1.3',
269 269
             'version' => '5.1.3.0',
270 270
             'type' => 'library',
271
-            'install_path' => __DIR__ . '/../sebastian/environment',
271
+            'install_path' => __DIR__.'/../sebastian/environment',
272 272
             'aliases' => array(),
273 273
             'reference' => '388b6ced16caa751030f6a69e588299fa09200ac',
274 274
             'dev_requirement' => true,
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
             'pretty_version' => '4.0.4',
278 278
             'version' => '4.0.4.0',
279 279
             'type' => 'library',
280
-            'install_path' => __DIR__ . '/../sebastian/exporter',
280
+            'install_path' => __DIR__.'/../sebastian/exporter',
281 281
             'aliases' => array(),
282 282
             'reference' => '65e8b7db476c5dd267e65eea9cab77584d3cfff9',
283 283
             'dev_requirement' => true,
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
             'pretty_version' => '5.0.5',
287 287
             'version' => '5.0.5.0',
288 288
             'type' => 'library',
289
-            'install_path' => __DIR__ . '/../sebastian/global-state',
289
+            'install_path' => __DIR__.'/../sebastian/global-state',
290 290
             'aliases' => array(),
291 291
             'reference' => '0ca8db5a5fc9c8646244e629625ac486fa286bf2',
292 292
             'dev_requirement' => true,
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
             'pretty_version' => '1.0.3',
296 296
             'version' => '1.0.3.0',
297 297
             'type' => 'library',
298
-            'install_path' => __DIR__ . '/../sebastian/lines-of-code',
298
+            'install_path' => __DIR__.'/../sebastian/lines-of-code',
299 299
             'aliases' => array(),
300 300
             'reference' => 'c1c2e997aa3146983ed888ad08b15470a2e22ecc',
301 301
             'dev_requirement' => true,
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
             'pretty_version' => '4.0.4',
305 305
             'version' => '4.0.4.0',
306 306
             'type' => 'library',
307
-            'install_path' => __DIR__ . '/../sebastian/object-enumerator',
307
+            'install_path' => __DIR__.'/../sebastian/object-enumerator',
308 308
             'aliases' => array(),
309 309
             'reference' => '5c9eeac41b290a3712d88851518825ad78f45c71',
310 310
             'dev_requirement' => true,
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
             'pretty_version' => '2.0.4',
314 314
             'version' => '2.0.4.0',
315 315
             'type' => 'library',
316
-            'install_path' => __DIR__ . '/../sebastian/object-reflector',
316
+            'install_path' => __DIR__.'/../sebastian/object-reflector',
317 317
             'aliases' => array(),
318 318
             'reference' => 'b4f479ebdbf63ac605d183ece17d8d7fe49c15c7',
319 319
             'dev_requirement' => true,
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
             'pretty_version' => '4.0.4',
323 323
             'version' => '4.0.4.0',
324 324
             'type' => 'library',
325
-            'install_path' => __DIR__ . '/../sebastian/recursion-context',
325
+            'install_path' => __DIR__.'/../sebastian/recursion-context',
326 326
             'aliases' => array(),
327 327
             'reference' => 'cd9d8cf3c5804de4341c283ed787f099f5506172',
328 328
             'dev_requirement' => true,
@@ -331,7 +331,7 @@  discard block
 block discarded – undo
331 331
             'pretty_version' => '3.0.3',
332 332
             'version' => '3.0.3.0',
333 333
             'type' => 'library',
334
-            'install_path' => __DIR__ . '/../sebastian/resource-operations',
334
+            'install_path' => __DIR__.'/../sebastian/resource-operations',
335 335
             'aliases' => array(),
336 336
             'reference' => '0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8',
337 337
             'dev_requirement' => true,
@@ -340,7 +340,7 @@  discard block
 block discarded – undo
340 340
             'pretty_version' => '3.0.0',
341 341
             'version' => '3.0.0.0',
342 342
             'type' => 'library',
343
-            'install_path' => __DIR__ . '/../sebastian/type',
343
+            'install_path' => __DIR__.'/../sebastian/type',
344 344
             'aliases' => array(),
345 345
             'reference' => 'b233b84bc4465aff7b57cf1c4bc75c86d00d6dad',
346 346
             'dev_requirement' => true,
@@ -349,7 +349,7 @@  discard block
 block discarded – undo
349 349
             'pretty_version' => '3.0.2',
350 350
             'version' => '3.0.2.0',
351 351
             'type' => 'library',
352
-            'install_path' => __DIR__ . '/../sebastian/version',
352
+            'install_path' => __DIR__.'/../sebastian/version',
353 353
             'aliases' => array(),
354 354
             'reference' => 'c6c1022351a901512170118436c764e473f6de8c',
355 355
             'dev_requirement' => true,
@@ -358,7 +358,7 @@  discard block
 block discarded – undo
358 358
             'pretty_version' => '3.6.2',
359 359
             'version' => '3.6.2.0',
360 360
             'type' => 'library',
361
-            'install_path' => __DIR__ . '/../squizlabs/php_codesniffer',
361
+            'install_path' => __DIR__.'/../squizlabs/php_codesniffer',
362 362
             'aliases' => array(),
363 363
             'reference' => '5e4e71592f69da17871dba6e80dd51bce74a351a',
364 364
             'dev_requirement' => true,
@@ -367,7 +367,7 @@  discard block
 block discarded – undo
367 367
             'pretty_version' => 'v1.25.0',
368 368
             'version' => '1.25.0.0',
369 369
             'type' => 'library',
370
-            'install_path' => __DIR__ . '/../symfony/polyfill-ctype',
370
+            'install_path' => __DIR__.'/../symfony/polyfill-ctype',
371 371
             'aliases' => array(),
372 372
             'reference' => '30885182c981ab175d4d034db0f6f469898070ab',
373 373
             'dev_requirement' => true,
@@ -376,7 +376,7 @@  discard block
 block discarded – undo
376 376
             'pretty_version' => '1.2.1',
377 377
             'version' => '1.2.1.0',
378 378
             'type' => 'library',
379
-            'install_path' => __DIR__ . '/../theseer/tokenizer',
379
+            'install_path' => __DIR__.'/../theseer/tokenizer',
380 380
             'aliases' => array(),
381 381
             'reference' => '34a41e998c2183e22995f158c581e7b5e755ab9e',
382 382
             'dev_requirement' => true,
@@ -385,7 +385,7 @@  discard block
 block discarded – undo
385 385
             'pretty_version' => '1.10.0',
386 386
             'version' => '1.10.0.0',
387 387
             'type' => 'library',
388
-            'install_path' => __DIR__ . '/../webmozart/assert',
388
+            'install_path' => __DIR__.'/../webmozart/assert',
389 389
             'aliases' => array(),
390 390
             'reference' => '6964c76c7804814a842473e0c8fd15bab0f18e25',
391 391
             'dev_requirement' => true,
@@ -394,7 +394,7 @@  discard block
 block discarded – undo
394 394
             'pretty_version' => '2.3.0',
395 395
             'version' => '2.3.0.0',
396 396
             'type' => 'phpcodesniffer-standard',
397
-            'install_path' => __DIR__ . '/../wp-coding-standards/wpcs',
397
+            'install_path' => __DIR__.'/../wp-coding-standards/wpcs',
398 398
             'aliases' => array(),
399 399
             'reference' => '7da1894633f168fe244afc6de00d141f27517b62',
400 400
             'dev_requirement' => true,
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
403 403
             'pretty_version' => '1.0.3',
404 404
             'version' => '1.0.3.0',
405 405
             'type' => 'library',
406
-            'install_path' => __DIR__ . '/../yoast/phpunit-polyfills',
406
+            'install_path' => __DIR__.'/../yoast/phpunit-polyfills',
407 407
             'aliases' => array(),
408 408
             'reference' => '5ea3536428944955f969bc764bbe09738e151ada',
409 409
             'dev_requirement' => true,
Please login to merge, or discard this patch.