Skip to content
This repository has been archived by the owner on Nov 9, 2021. It is now read-only.

Commit

Permalink
Renamed variables
Browse files Browse the repository at this point in the history
  • Loading branch information
rennokki committed May 11, 2021
1 parent 7fd3f28 commit deeb4f6
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/BillingPortal.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ class BillingPortal
*
* @var Closure|null
*/
protected static $syncQuotasCallback;
protected static $syncQuotasResolver;

/**
* The closure that will be called to retrieve
* the billable model on a specific request.
*
* @var null|Closure
*/
protected static $billableOnRequest;
protected static $billable;

/**
* The closure that will be called to get
Expand All @@ -38,7 +38,7 @@ class BillingPortal
*
* @var null|Closure
*/
protected static $stripeCheckoutInterceptor;
protected static $stripeCheckoutResolver;

/**
* Register a method that will run when the
Expand All @@ -49,7 +49,7 @@ class BillingPortal
*/
public static function resolveQuotasSync(Closure $callback)
{
static::$syncQuotasCallback = $callback;
static::$syncQuotasResolver = $callback;
}

/**
Expand All @@ -61,8 +61,8 @@ public static function resolveQuotasSync(Closure $callback)
*/
public static function syncQuotas(Model $user, Model $subscription)
{
if (static::$syncQuotasCallback) {
$callback = static::$syncQuotasCallback;
if (static::$syncQuotasResolver) {
$callback = static::$syncQuotasResolver;

$callback($user, $subscription);
}
Expand All @@ -77,7 +77,7 @@ public static function syncQuotas(Model $user, Model $subscription)
*/
public static function resolveBillable(Closure $callback)
{
static::$billableOnRequest = $callback;
static::$billable = $callback;
}

/**
Expand All @@ -88,7 +88,7 @@ public static function resolveBillable(Closure $callback)
*/
public static function getBillable(Request $request)
{
$closure = static::$billableOnRequest;
$closure = static::$billable;

return $closure
? $closure($request)
Expand Down Expand Up @@ -133,7 +133,7 @@ public static function getStripeCheckoutOptions(Request $request, $billable, Pla
*/
public static function resolveStripeCheckout(Closure $callback)
{
static::$stripeCheckoutInterceptor = $callback;
static::$stripeCheckoutResolver = $callback;
}

/**
Expand All @@ -149,7 +149,7 @@ public static function resolveStripeCheckout(Closure $callback)
*/
public static function mutateCheckout($checkout, Request $request, $billable, Plan $plan, string $subscription)
{
$closure = static::$stripeCheckoutInterceptor;
$closure = static::$stripeCheckoutResolver;

return $closure
? $closure($checkout, $request, $billable, $plan, $subscription)
Expand Down

0 comments on commit deeb4f6

Please sign in to comment.