Skip to content

Commit

Permalink
PHPCS
Browse files Browse the repository at this point in the history
  • Loading branch information
joedolson committed Nov 23, 2023
1 parent d1e05f7 commit cf014dc
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/includes/date-utilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ function mt_current_time() {
$timestamp = $timestamp + $offset;

return $timestamp;
}
}
7 changes: 4 additions & 3 deletions src/mt-add-to-cart.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ function mt_has_tickets( $pricing ) {
/**
* Check add to cart form exit conditions. Returns the event registration array if all conditions pass.
*
* @param int $event_id Event post ID.
* @param int $event_id Event post ID.
* @param bool $override Is the add to cart form output being overridden.
*
* @return bool|array
*/
function mt_check_early_returns( $event_id, $override) {
function mt_check_early_returns( $event_id, $override ) {
$options = array_merge( mt_default_settings(), get_option( 'mt_settings', array() ) );
$purchase_page = $options['mt_purchase_page'];
$receipt_page = $options['mt_receipt_page'];
Expand Down Expand Up @@ -175,7 +175,7 @@ function mt_registration_form( $content, $event = false, $view = 'calendar', $ti
$sold_out = false;
$total_order = 0;
foreach ( $pricing as $type => $settings ) {
$row = mt_ticket_row( $event_id, $registration, $settings, $type, $available, $tickets_remaining );
$row = mt_ticket_row( $event_id, $registration, $settings, $type, $available, $tickets_remaining );
if ( $row ) {
$form .= $row['form'];
$handling_notice = $row['handling'];
Expand Down Expand Up @@ -288,6 +288,7 @@ function mt_registration_form( $content, $event = false, $view = 'calendar', $ti
* @param array $settings Settings for this row.
* @param string $type Type of ticket.
* @param int|string $available Number of tickets available or 'inherit'.
* @param int $tickets_remaining Number of ticket left for purchase.
*
* @return array|bool 'false' if ticket is not purchaseable.
*/
Expand Down
16 changes: 8 additions & 8 deletions src/mt-payment-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,14 +187,14 @@ function mt_payment_settings() {
<label for="mt_expiration"><?php _e( 'Cart Expiration Window', 'my-tickets' ); ?></label>
<select name="mt_expiration" id="mt_expiration" aria-describedby="mt_expiration_info">
<option value=""><?php _e( 'Default (1 week)', 'my-tickets' ); ?></option>
<option value="600"<?php selected( 600, $options['mt_expiration'] ); ?>><?php _e( '10 minutes', 'my-tickets' ); ?></option>
<option value="3600"<?php selected( 3600, $options['mt_expiration'] ); ?>><?php _e( '1 hour', 'my-tickets' ); ?></option>
<option value="<?php echo ( 3 * HOUR_IN_SECONDS ); ?>"<?php selected( ( 3 * HOUR_IN_SECONDS ), $options['mt_expiration'] ); ?>><?php _e( '3 hours', 'my-tickets' ); ?></option>
<option value="<?php echo ( 12 * HOUR_IN_SECONDS ); ?>"<?php selected( ( 12 * HOUR_IN_SECONDS ), $options['mt_expiration'] ); ?>><?php _e( '12 hours', 'my-tickets' ); ?></option>
<option value="<?php echo ( DAY_IN_SECONDS ); ?>"<?php selected( ( DAY_IN_SECONDS ), $options['mt_expiration'] ); ?>><?php _e( '1 day', 'my-tickets' ); ?></option>
<option value="<?php echo ( 3 * DAY_IN_SECONDS ); ?>"<?php selected( ( 3 * DAY_IN_SECONDS ), $options['mt_expiration'] ); ?>><?php _e( '3 days', 'my-tickets' ); ?></option>
<option value="<?php echo ( 14 * DAY_IN_SECONDS ); ?>"<?php selected( ( 14 * DAY_IN_SECONDS ), $options['mt_expiration'] ); ?>><?php _e( '2 weeks', 'my-tickets' ); ?></option>
<option value="<?php echo ( 30 * DAY_IN_SECONDS ); ?>"<?php selected( ( 30 * DAY_IN_SECONDS ), $options['mt_expiration'] ); ?>><?php _e( '1 month', 'my-tickets' ); ?></option>
<option value="600"<?php selected( 600, $options['mt_expiration'] ); ?>><?php _e( '10 minutes', 'my-tickets' ); ?></option>
<option value="3600"<?php selected( 3600, $options['mt_expiration'] ); ?>><?php _e( '1 hour', 'my-tickets' ); ?></option>
<option value="<?php echo ( 3 * HOUR_IN_SECONDS ); ?>"<?php selected( ( 3 * HOUR_IN_SECONDS ), $options['mt_expiration'] ); ?>><?php _e( '3 hours', 'my-tickets' ); ?></option>
<option value="<?php echo ( 12 * HOUR_IN_SECONDS ); ?>"<?php selected( ( 12 * HOUR_IN_SECONDS ), $options['mt_expiration'] ); ?>><?php _e( '12 hours', 'my-tickets' ); ?></option>
<option value="<?php echo ( DAY_IN_SECONDS ); ?>"<?php selected( ( DAY_IN_SECONDS ), $options['mt_expiration'] ); ?>><?php _e( '1 day', 'my-tickets' ); ?></option>
<option value="<?php echo ( 3 * DAY_IN_SECONDS ); ?>"<?php selected( ( 3 * DAY_IN_SECONDS ), $options['mt_expiration'] ); ?>><?php _e( '3 days', 'my-tickets' ); ?></option>
<option value="<?php echo ( 14 * DAY_IN_SECONDS ); ?>"<?php selected( ( 14 * DAY_IN_SECONDS ), $options['mt_expiration'] ); ?>><?php _e( '2 weeks', 'my-tickets' ); ?></option>
<option value="<?php echo ( 30 * DAY_IN_SECONDS ); ?>"<?php selected( ( 30 * DAY_IN_SECONDS ), $options['mt_expiration'] ); ?>><?php _e( '1 month', 'my-tickets' ); ?></option>
</select><br />
<span class="aria-description" id="mt_expiration_info"><?php _e( 'How long tickets will remain in a shopping cart.', 'my-tickets' ); ?></span>
</li>
Expand Down

0 comments on commit cf014dc

Please sign in to comment.