Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
millerf committed Nov 13, 2024
1 parent 870114a commit 317696b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion src/inc/wc-settings-tab.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ function build_events_settings_events_array( array $events): array {
$event_id = $event_settings['id'] ?? $event_key;
$event_id = str_replace( '-', '_', $event_id );
// Allow to disable from sidecar plugin
$disabled = apply_filters( FILTER_EVENT_ENABLE_PREFIX . $event_id, $event_settings['disabled'] ?? false );
$disabled = apply_filters( FILTER_EVENT_ENABLE_PREFIX . $event_id, $event_settings['disabled'] ?? false ); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.DynamicHooknameFound

$description = '';
if( isset( $event_settings['desc'] ) ) {
Expand Down
36 changes: 18 additions & 18 deletions src/inc/woocommerce-actions.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public static function hooks() {
* @return void
*/
public static function logout( string $user_id ) {
if ( ! apply_filters( FILTER_EVENT_ENABLE_PREFIX . 'logout', true ) ) {
if ( ! apply_filters( FILTER_EVENT_ENABLE_PREFIX . 'logout', true ) ) { // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.DynamicHooknameFound
return;
}

Expand All @@ -102,7 +102,7 @@ public static function logout( string $user_id ) {
*/
public static function add_promotion( \WC_Coupon $coupon, \WC_Order $order ): void {

if ( ! apply_filters( FILTER_EVENT_ENABLE_PREFIX . 'add_promotion', true ) ) {
if ( ! apply_filters( FILTER_EVENT_ENABLE_PREFIX . 'add_promotion', true ) ) { // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.DynamicHooknameFound
return;
}

Expand Down Expand Up @@ -138,7 +138,7 @@ public static function add_promotion( \WC_Coupon $coupon, \WC_Order $order ): vo
*/
public static function login_success( string $username, object $user ) {

if ( ! apply_filters( FILTER_EVENT_ENABLE_PREFIX . 'login', true ) ) {
if ( ! apply_filters( FILTER_EVENT_ENABLE_PREFIX . 'login', true ) ) { // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.DynamicHooknameFound
return;
}

Expand Down Expand Up @@ -176,7 +176,7 @@ public static function login_success( string $username, object $user ) {
*/
public static function login_failure( string $username, \WP_Error $error ) {

if ( ! apply_filters( FILTER_EVENT_ENABLE_PREFIX . 'login', true ) ) {
if ( ! apply_filters( FILTER_EVENT_ENABLE_PREFIX . 'login', true ) ) { // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.DynamicHooknameFound
return;
}

Expand Down Expand Up @@ -232,7 +232,7 @@ public static function login_failure( string $username, \WP_Error $error ) {
*/
public static function create_account( string $user_id ) {

if ( ! apply_filters( FILTER_EVENT_ENABLE_PREFIX . 'create_account', true ) ) {
if ( ! apply_filters( FILTER_EVENT_ENABLE_PREFIX . 'create_account', true ) ) { // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.DynamicHooknameFound
return;
}

Expand Down Expand Up @@ -282,7 +282,7 @@ public static function create_account( string $user_id ) {
*/
public static function update_account( string $user_id, ?\WP_User $old_user_data = null, ?array $new_user_data = null ) {

if ( ! apply_filters( FILTER_EVENT_ENABLE_PREFIX . 'update_account', true ) ) {
if ( ! apply_filters( FILTER_EVENT_ENABLE_PREFIX . 'update_account', true ) ) { // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.DynamicHooknameFound
return;
}

Expand Down Expand Up @@ -333,7 +333,7 @@ public static function update_account( string $user_id, ?\WP_User $old_user_data
*/
public static function update_password( string $new_password, string $user_id ) {

if ( ! apply_filters( FILTER_EVENT_ENABLE_PREFIX . 'update_password', true ) ) {
if ( ! apply_filters( FILTER_EVENT_ENABLE_PREFIX . 'update_password', true ) ) { // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.DynamicHooknameFound
return;
}

Expand Down Expand Up @@ -375,7 +375,7 @@ public static function update_password( string $new_password, string $user_id )
*/
public static function link_session_to_user( string $session_id, string $user_id ) {

if ( ! apply_filters( FILTER_EVENT_ENABLE_PREFIX . 'link_session_to_user', true ) ) {
if ( ! apply_filters( FILTER_EVENT_ENABLE_PREFIX . 'link_session_to_user', true ) ) { // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.DynamicHooknameFound
return;
}

Expand Down Expand Up @@ -407,7 +407,7 @@ public static function link_session_to_user( string $session_id, string $user_id
*/
public static function add_to_cart( string $cart_item_key ) {

if ( ! apply_filters( FILTER_EVENT_ENABLE_PREFIX . 'add_item_to_cart', true ) ) {
if ( ! apply_filters( FILTER_EVENT_ENABLE_PREFIX . 'add_item_to_cart', true ) ) { // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.DynamicHooknameFound
return;
}

Expand Down Expand Up @@ -472,7 +472,7 @@ public static function add_to_cart( string $cart_item_key ) {
*/
public static function remove_from_cart( string $cart_item_key, \WC_Cart $cart ) {

if ( ! apply_filters( FILTER_EVENT_ENABLE_PREFIX . 'remove_item_from_cart', true ) ) {
if ( ! apply_filters( FILTER_EVENT_ENABLE_PREFIX . 'remove_item_from_cart', true ) ) { // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.DynamicHooknameFound
return;
}

Expand Down Expand Up @@ -517,14 +517,14 @@ public static function remove_from_cart( string $cart_item_key, \WC_Cart $cart )
*
* @link https://developers.sift.com/docs/curl/events-api/reserved-events/create-order
*
* @param string $order_id
* @param \WC_Order $order
* @param string $order_id Order id.
* @param \WC_Order $order The Order object.
*
* @return void
*/
public static function create_order( string $order_id, \WC_Order $order ) {

if ( ! apply_filters( FILTER_EVENT_ENABLE_PREFIX . 'create_order', true ) ) {
if ( ! apply_filters( FILTER_EVENT_ENABLE_PREFIX . 'create_order', true ) ) { // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.DynamicHooknameFound
return;
}

Expand All @@ -542,7 +542,7 @@ public static function create_order( string $order_id, \WC_Order $order ) {
*
* @param string $order_id Order id.
* @param \WC_Order $order The Order object.
* @param bool $create_order True if this is called as part of the order creation.
* @param boolean $create_order True if this is called as part of the order creation.
*
* @return void
*/
Expand All @@ -552,7 +552,7 @@ public static function update_or_create_order( string $order_id, \WC_Order $orde
return;
}

if ( !$create_order && ! apply_filters( FILTER_EVENT_ENABLE_PREFIX . 'update_order', true ) ) {
if ( ! $create_order && ! apply_filters( FILTER_EVENT_ENABLE_PREFIX . 'update_order', true ) ) { // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.DynamicHooknameFound
return;
}

Expand Down Expand Up @@ -631,7 +631,7 @@ public static function update_or_create_order( string $order_id, \WC_Order $orde
}

self::add(
$create_order ? '$create_order': '$update_order',
$create_order ? '$create_order' : '$update_order',
$properties
);
}
Expand Down Expand Up @@ -671,7 +671,7 @@ public static function maybe_log_change_order_status( string $order_id, string $
*/
public static function transaction( \WC_Order $order, string $status, string $transaction_type ) {

if ( ! apply_filters( FILTER_EVENT_ENABLE_PREFIX . 'transaction', true ) ) {
if ( ! apply_filters( FILTER_EVENT_ENABLE_PREFIX . 'transaction', true ) ) { // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.DynamicHooknameFound
return;
}

Expand Down Expand Up @@ -711,7 +711,7 @@ public static function transaction( \WC_Order $order, string $status, string $tr
*/
public static function change_order_status( string $order_id, \WC_Order $order, array $status_transition ) {

if ( ! apply_filters( FILTER_EVENT_ENABLE_PREFIX . 'order_status', true ) ) {
if ( ! apply_filters( FILTER_EVENT_ENABLE_PREFIX . 'order_status', true ) ) { // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.DynamicHooknameFound
return;
}

Expand Down

0 comments on commit 317696b

Please sign in to comment.