Skip to content

Commit

Permalink
Merge pull request #3106 from briannesbitt/analysis-a6M1Am
Browse files Browse the repository at this point in the history
Apply fixes from StyleCI
  • Loading branch information
kylekatarnls authored Nov 15, 2024
2 parents 07022bf + e5273af commit b976755
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tools/generate.php
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,8 @@ function getAllBackers(): array
}

$isYearly = str_contains(strtolower($member['tier'] ?? ''), 'yearly');
$monthlyContribution = (float) ($isYearly && $lastTransactionAt > CarbonImmutable::parse('-1 year')
$monthlyContribution = (float) (
$isYearly && $lastTransactionAt > CarbonImmutable::parse('-1 year')
? ($member['lastTransactionAmount'] / 11.2) // 11.2 instead of 12 to include the discount for yearly subscription
: ($member['totalAmountDonated'] / ceil($createdAt->floatDiffInMonths()))
);
Expand All @@ -333,7 +334,8 @@ function getAllBackers(): array
}
}

$yearlyContribution = (float) ($isYearly
$yearlyContribution = (float) (
$isYearly
? (12 * $monthlyContribution)
: ($member['totalAmountDonated'] / max(1, $createdAt->floatDiffInYears()))
);
Expand Down

0 comments on commit b976755

Please sign in to comment.