Skip to content

Commit

Permalink
More strict comparison things
Browse files Browse the repository at this point in the history
  • Loading branch information
joedolson committed Aug 11, 2019
1 parent b5f48f7 commit a843d48
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion src/class-mt-short-cart-widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function widget( $args, $instance ) {

$the_title = apply_filters( 'widget_title', $instance['title'] );
$widget_title = empty( $the_title ) ? '' : $the_title;
$widget_title = ( '' != $widget_title ) ? $before_title . $widget_title . $after_title : '';
$widget_title = ( '' !== $widget_title ) ? $before_title . $widget_title . $after_title : '';
$cart = my_tickets_short_cart();
echo $before_widget;
echo $widget_title;
Expand Down
6 changes: 3 additions & 3 deletions src/mt-ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function mt_ajax_cart() {
echo 0;
die;
}
if ( 'mt_ajax_cart' == $_REQUEST['action'] ) {
if ( 'mt_ajax_cart' === $_REQUEST['action'] ) {
$post = $_REQUEST['data'];
$post = array(
$post['mt_event_id'] => array(
Expand Down Expand Up @@ -81,7 +81,7 @@ function mt_ajax_handler() {
)
);
}
if ( 'add_to_cart' == $_REQUEST['function'] ) {
if ( 'add_to_cart' === $_REQUEST['function'] ) {
$post = $_REQUEST['data'];
// reformat request data to multidimensional array.
$data = explode( '&', $post );
Expand Down Expand Up @@ -131,7 +131,7 @@ function mt_ajax_handler() {
);
wp_send_json( $return );
}
if ( 'save_address' == $_REQUEST['function'] ) {
if ( 'save_address' === $_REQUEST['function'] ) {
$post = $_REQUEST['data'];
$current_user = wp_get_current_user();
$saved = update_user_meta( $current_user->ID, '_mt_shipping_address', $post );
Expand Down
4 changes: 2 additions & 2 deletions src/mt-common.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ function mt_check_license( $key = false, $product, $store ) {
$response = wp_remote_post(
$store,
array(
'timeout' => 15,
'body' => $api_params,
'timeout' => 15,
'body' => $api_params,
)
);
// make sure the response came back okay.
Expand Down
4 changes: 2 additions & 2 deletions src/mt-help.php
Original file line number Diff line number Diff line change
Expand Up @@ -224,12 +224,12 @@ function mt_get_support_form() {
die( 'Security check failed' );
}
$request = ( ! empty( $_POST['support_request'] ) ) ? stripslashes( $_POST['support_request'] ) : false;
$has_read_faq = ( 'on' == $_POST['has_read_faq'] ) ? 'Read FAQ' : false;
$has_read_faq = ( 'on' === $_POST['has_read_faq'] ) ? 'Read FAQ' : false;
$subject = 'My Tickets support request.';
$message = $request . "\n\n" . $data;
// Get the site domain and get rid of www. from pluggable.php.
$sitename = strtolower( $_SERVER['SERVER_NAME'] );
if ( substr( $sitename, 0, 4 ) == 'www.' ) {
if ( substr( $sitename, 0, 4 ) === 'www.' ) {
$sitename = substr( $sitename, 4 );
}
$from_email = 'wordpress@' . $sitename;
Expand Down
2 changes: 1 addition & 1 deletion src/mt-receipt.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
function mt_receipt() {
$options = array_merge( mt_default_settings(), get_option( 'mt_settings' ) );
$id = ( '' != $options['mt_receipt_page'] ) ? $options['mt_receipt_page'] : false;
$id = ( '' !== $options['mt_receipt_page'] && is_numeric( $options['mt_receipt_page'] ) ) ? absint( $options['mt_receipt_page'] ) : false;
if ( $id && ( is_single( $id ) || is_page( $id ) ) ) {
if ( isset( $_GET['receipt_id'] ) ) {
$template = locate_template( 'receipt.php' );
Expand Down
10 changes: 5 additions & 5 deletions src/templates/bulk-tickets.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<div class='panel ticket <?php mt_ticket_method( $ticket_id ); ?>'>
<div class='inside'>
<?php
if ( 'eticket' != mt_get_ticket_method( $ticket_id ) ) {
if ( 'eticket' !== mt_get_ticket_method( $ticket_id ) ) {
?>
<div class='post-thumbnail'>
<?php mt_logo( array(), get_the_ID() ); ?>
Expand Down Expand Up @@ -63,7 +63,7 @@ class='time'><?php mt_event_time( $ticket_id ); ?></span>
<?php mt_ticket_venue( $ticket_id ); ?>
</div>
<?php
if ( 'eticket' != mt_get_ticket_method( $ticket_id ) ) {
if ( 'eticket' !== mt_get_ticket_method( $ticket_id ) ) {
?>
<div class='ticket-qrcode'>
<img src="<?php mt_ticket_qrcode( $ticket_id ); ?>" alt="QR Code Verification Link"/>
Expand All @@ -74,15 +74,15 @@ class='time'><?php mt_event_time( $ticket_id ); ?></span>
<div class='post-content'>
<?php
$content = get_the_content();
if ( '' == trim( strip_tags( $content ) ) ) {
if ( '' === trim( strip_tags( $content ) ) ) {
$content = ( current_user_can( 'edit_pages' ) ) ? __( 'Add your custom text into the post content.', 'my-tickets' ) : '';
}
echo $content;
?>
<?php edit_post_link(); ?>
</div>
<?php
if ( 'eticket' == mt_get_ticket_method( $ticket_id ) ) {
if ( 'eticket' === mt_get_ticket_method( $ticket_id ) ) {
?>
<div class='post-thumbnail'>
<?php
Expand All @@ -107,7 +107,7 @@ class='time'><?php mt_event_time( $ticket_id ); ?></span>
<?php
}

if ( 'printable' == mt_get_ticket_method( $ticket_id ) ) {
if ( 'printable' === mt_get_ticket_method( $ticket_id ) ) {
?>
<a href="javascript:window.print()" class="print">Print</a>
<?php
Expand Down
2 changes: 1 addition & 1 deletion src/templates/receipt.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<div class='post-content'>
<?php
$content = get_the_content();
if ( trim( strip_tags( $content ) ) == '' ) {
if ( trim( strip_tags( $content ) ) === '' ) {
$content = ( current_user_can( 'edit_pages' ) ) ? wpautop( __( 'Add your business name and address to the post content.', 'my-tickets' ) ) : '';
}
echo wpautop( $content );
Expand Down
10 changes: 5 additions & 5 deletions src/templates/tickets.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
if ( have_posts() ) {
while ( have_posts() ) {
the_post();
if ( 'eticket' != mt_get_ticket_method() ) {
if ( 'eticket' !== mt_get_ticket_method() ) {
?>
<div class='post-thumbnail'>
<?php mt_logo( array(), get_the_ID() ); ?>
Expand Down Expand Up @@ -57,7 +57,7 @@
<?php mt_ticket_venue(); ?>
</div>
<?php
if ( mt_get_ticket_method() != 'eticket' ) {
if ( mt_get_ticket_method() !== 'eticket' ) {
?>
<div class='ticket-qrcode'>
<img src="<?php mt_ticket_qrcode(); ?>" alt="QR Code Verification Link"/>
Expand All @@ -68,15 +68,15 @@
<div class='post-content'>
<?php
$content = get_the_content();
if ( '' == trim( strip_tags( $content ) ) ) {
if ( '' === trim( strip_tags( $content ) ) ) {
$content = ( current_user_can( 'edit_pages' ) ) ? __( 'Add your custom text into the post content.', 'my-tickets' ) : '';
}
echo $content;
?>
<?php edit_post_link(); ?>
</div>
<?php
if ( 'eticket' == mt_get_ticket_method() ) {
if ( 'eticket' === mt_get_ticket_method() ) {
?>
<div class='post-thumbnail'>
<?php
Expand All @@ -103,7 +103,7 @@
</div>
</div>
<?php
if ( 'printable' == mt_get_ticket_method() ) {
if ( 'printable' === mt_get_ticket_method() ) {
?>
<a href="javascript:window.print()" class="print">Print</a>
<?php
Expand Down

0 comments on commit a843d48

Please sign in to comment.