Skip to content

Commit

Permalink
Fix pre-commit script
Browse files Browse the repository at this point in the history
commit stage is deprecated
  • Loading branch information
webaaz committed Nov 26, 2024
1 parent 559bafd commit ab383bc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ repos:
name: PHP and WordPress coding standards Fixer test
language: system
entry: ./bin/coding-standard-fixer.sh
stages: [commit]
stages: [pre-commit]

- id: coding-standard
name: Check the PHP and WordPress coding standards
language: system
entry: ./bin/coding-standard.sh
stages: [commit]
stages: [pre-commit]

# - repo: https://github.com/returntocorp/semgrep
# rev: v1.75.0
Expand Down
22 changes: 11 additions & 11 deletions src/includes/AlmaSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -874,9 +874,9 @@ function ( $fee_plan ) {
if ( ! isset( $this->settings[ $enabled_key ] ) ) {
$this->settings[ $enabled_key ] = ConstantsHelper::DEFAULT_FEE_PLAN === $plan_key ? 'yes' : 'no';
}
$this->settings["deferred_months_$plan_key"] = $fee_plan->getDeferredMonths();
$this->settings["deferred_days_$plan_key"] = $fee_plan->getDeferredDays();
$this->settings["installments_count_$plan_key"] = $fee_plan->getInstallmentsCount();
$this->settings[ "deferred_months_$plan_key" ] = $fee_plan->getDeferredMonths();
$this->settings[ "deferred_days_$plan_key" ] = $fee_plan->getDeferredDays();
$this->settings[ "installments_count_$plan_key" ] = $fee_plan->getInstallmentsCount();
}
}

Expand Down Expand Up @@ -1015,12 +1015,12 @@ public function should_display_plan( $plan_key, $gateway_id ) {
case ConstantsHelper::GATEWAY_ID_PAY_NOW:
case ConstantsHelper::GATEWAY_ID_IN_PAGE_PAY_NOW:
$display_plan = $this->get_installments_count( $plan_key ) === 1
&& ( $this->get_deferred_days( $plan_key ) === 0 && $this->get_deferred_months( $plan_key ) === 0 );
&& ( $this->get_deferred_days( $plan_key ) === 0 && $this->get_deferred_months( $plan_key ) === 0 );
break;
case ConstantsHelper::GATEWAY_ID_PAY_LATER:
case ConstantsHelper::GATEWAY_ID_IN_PAGE_PAY_LATER:
$display_plan = $this->get_installments_count( $plan_key ) === 1
&& ( $this->get_deferred_days( $plan_key ) !== 0 || $this->get_deferred_months( $plan_key ) !== 0 );
&& ( $this->get_deferred_days( $plan_key ) !== 0 || $this->get_deferred_months( $plan_key ) !== 0 );
break;
case ConstantsHelper::GATEWAY_ID_IN_PAGE_MORE_THAN_FOUR:
case ConstantsHelper::GATEWAY_ID_MORE_THAN_FOUR:
Expand Down Expand Up @@ -1069,23 +1069,23 @@ public function get_display_text() {
*/
public function build_fee_plan( $plan_key ) {

if ( ! isset( $this->settings["installments_count_$plan_key"] ) ) {
if ( ! isset( $this->settings[ "installments_count_$plan_key" ] ) ) {
throw new PlansDefinitionException( "installments_count_$plan_key not set" );
}

if ( ! isset( $this->settings["deferred_days_$plan_key"] ) ) {
if ( ! isset( $this->settings[ "deferred_days_$plan_key" ] ) ) {
throw new PlansDefinitionException( "deferred_days_$plan_key not set" );
}

if ( ! isset( $this->settings["deferred_months_$plan_key"] ) ) {
if ( ! isset( $this->settings[ "deferred_months_$plan_key" ] ) ) {
throw new PlansDefinitionException( "deferred_months_$plan_key not set" );
}

return new FeePlan(
array(
'installments_count' => $this->settings["installments_count_$plan_key"],
'deferred_days' => $this->settings["deferred_days_$plan_key"],
'deferred_months' => $this->settings["deferred_months_$plan_key"],
'installments_count' => $this->settings[ "installments_count_$plan_key" ],
'deferred_days' => $this->settings[ "deferred_days_$plan_key" ],
'deferred_months' => $this->settings[ "deferred_months_$plan_key" ],
)
);
}
Expand Down

0 comments on commit ab383bc

Please sign in to comment.