Skip to content

Commit

Permalink
PhpStan lvl4 related changes
Browse files Browse the repository at this point in the history
- Removing unused dependencies from constructors.
- Removing other unused or write-only variables and
methods.
- Removing unnecessary checks and conditions at places
where they're not necessary.
- Fixing type-related issues.
  • Loading branch information
rootpd committed Nov 12, 2024
1 parent d0d82a8 commit 5641a5a
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/Gateways/GooglePlayBilling.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ class GooglePlayBilling extends GatewayAbstract implements RecurrentPaymentInter

private bool $successful = false;

private $googlePlayValidator;

private $purchaseToken;

public function __construct(
Expand Down Expand Up @@ -90,7 +88,7 @@ public function getSubscriptionExpiration(string $cid = null): \DateTime
throw new \Exception("Missing developer notification with purchase token: [{$cid}].");
}

$googlePlayValidator = $this->googlePlayValidator ?: $this->googlePlayValidatorFactory->create();
$googlePlayValidator = $this->googlePlayValidatorFactory->create();

try {
$gSubscription = $googlePlayValidator
Expand All @@ -115,7 +113,7 @@ public function charge($payment, $token): string
}

$this->purchaseToken = $developerNotification->purchase_token;
$googlePlayValidator = $this->googlePlayValidator ?: $this->googlePlayValidatorFactory->create();
$googlePlayValidator = $this->googlePlayValidatorFactory->create();

try {
$gSubscription = $googlePlayValidator
Expand Down Expand Up @@ -213,7 +211,7 @@ public function charge($payment, $token): string

public function checkValid($token)
{
$googlePlayValidator = $this->googlePlayValidator ?: $this->googlePlayValidatorFactory->create();
$googlePlayValidator = $this->googlePlayValidatorFactory->create();
$developerNotification = $this->developerNotificationsRepository->findBy('purchase_token', $token);
$this->purchaseToken = $developerNotification->purchase_token;

Expand Down

0 comments on commit 5641a5a

Please sign in to comment.