Skip to content

Commit

Permalink
Added trigger error for all deprecated methods
Browse files Browse the repository at this point in the history
  • Loading branch information
shishir-intelli committed Sep 12, 2024
1 parent 8092c99 commit b7618af
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,8 @@ public function getApps(): array
*/
public function apps(string ...$appIds): self
{
$this->apps = $appIds;

return $this;
trigger_error(__METHOD__ . ' is deprecated in 3.0.7, will be removed in 4.0.0: use setApps() instead.', E_USER_DEPRECATED);
return $this->setApps(...$appIds);
}

/**
Expand Down Expand Up @@ -161,9 +160,8 @@ public function getCurrencies(): array
*/
public function currencies(string ...$currencyIds): self
{
$this->currencies = $currencyIds;

return $this;
trigger_error(__METHOD__ . ' is deprecated in 3.0.7, will be removed in 4.0.0: use setCurrencies() instead.', E_USER_DEPRECATED);
return $this->setCurrencies(...$currencyIds);
}

/**
Expand Down Expand Up @@ -198,9 +196,8 @@ public function currencyOption(?string $currencyOption): self
{
// This tweak allows to reset the previously configured currency option
// by calling this method with an empty string or null.
$this->currencyOption = $currencyOption;

return $this;
trigger_error(__METHOD__ . ' is deprecated in 3.0.7, will be removed in 4.0.0: use setCurrencyOption() instead.', E_USER_DEPRECATED);
return $this->setCurrencyOption($currencyOption);
}

/**
Expand All @@ -227,9 +224,8 @@ public function setCurrencyOption(?string $currencyOption): self
*/
public function developers(string ...$developerIds): self
{
$this->developers = $developerIds;

return $this;
trigger_error(__METHOD__ . ' is deprecated in 3.0.7, will be removed in 4.0.0: use setDevelopers() instead.', E_USER_DEPRECATED);
return $this->setDevelopers(...$developerIds);
}

/**
Expand Down Expand Up @@ -270,9 +266,8 @@ public function getApiPackages(): array
*/
public function apiPackages(string ...$apiPackageIds): self
{
$this->apiPackages = $apiPackageIds;

return $this;
trigger_error(__METHOD__ . ' is deprecated in 3.0.7, will be removed in 4.0.0: use setApiPackages() instead.', E_USER_DEPRECATED);
return $this->setApiPackages(...$apiPackageIds);
}

/**
Expand Down Expand Up @@ -305,9 +300,8 @@ public function getApiProducts(): array
*/
public function apiProducts(string ...$apiProductIds): self
{
$this->apiProducts = $apiProductIds;

return $this;
trigger_error(__METHOD__ . ' is deprecated in 3.0.7, will be removed in 4.0.0: use setApiProducts() instead.', E_USER_DEPRECATED);
return $this->setApiProducts(...$apiProductIds);
}

/**
Expand Down Expand Up @@ -340,9 +334,8 @@ public function getPricingTypes(): array
*/
public function pricingTypes(string ...$pricingTypes): self
{
$this->pricingTypes = $pricingTypes;

return $this;
trigger_error(__METHOD__ . ' is deprecated in 3.0.7, will be removed in 4.0.0: use setPricingTypes() instead.', E_USER_DEPRECATED);
return $this->setPricingTypes(...$pricingTypes);
}

/**
Expand Down Expand Up @@ -375,9 +368,8 @@ public function getRatePlanLevels(): array
*/
public function ratePlanLevels(string ...$ratePlanLevels): self
{
$this->ratePlanLevels = $ratePlanLevels;

return $this;
trigger_error(__METHOD__ . ' is deprecated in 3.0.7, will be removed in 4.0.0: use setRatePlanLevels() instead.', E_USER_DEPRECATED);
return $this->setRatePlanLevels(...$ratePlanLevels);
}

/**
Expand Down Expand Up @@ -434,9 +426,8 @@ public function getShowTransactionType(): bool
*/
public function showRevenueSharePercentage(bool $show): self
{
$this->showRevenueSharePercentage = $show;

return $this;
trigger_error(__METHOD__ . ' is deprecated in 3.0.7, will be removed in 4.0.0: use setShowRevenueSharePercentage() instead.', E_USER_DEPRECATED);
return $this->setShowRevenueSharePercentage($show);
}

/**
Expand All @@ -461,9 +452,8 @@ public function setShowRevenueSharePercentage(bool $show): self
*/
public function showSummary(bool $show): self
{
$this->showSummary = $show;

return $this;
trigger_error(__METHOD__ . ' is deprecated in 3.0.7, will be removed in 4.0.0: use setShowSummary() instead.', E_USER_DEPRECATED);
return $this->setShowSummary($show);
}

/**
Expand All @@ -488,9 +478,8 @@ public function setShowSummary(bool $show): self
*/
public function showTransactionDetail(bool $show): self
{
$this->showTransactionDetail = $show;

return $this;
trigger_error(__METHOD__ . ' is deprecated in 3.0.7, will be removed in 4.0.0: use setShowTransactionDetail() instead.', E_USER_DEPRECATED);
return $this->setShowTransactionDetail($show);
}

/**
Expand All @@ -515,9 +504,8 @@ public function setShowTransactionDetail(bool $show): self
*/
public function showTransactionType(bool $show): self
{
$this->showTransactionType = $show;

return $this;
trigger_error(__METHOD__ . ' is deprecated in 3.0.7, will be removed in 4.0.0: use setShowTransactionType() instead.', E_USER_DEPRECATED);
return $this->setShowTransactionType($show);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,8 @@ public function getGroupBy(): array
*/
public function groupBy(string ...$groupBy): self
{
$this->groupBy = $groupBy;

return $this;
trigger_error(__METHOD__ . ' is deprecated in 3.0.7, will be removed in 4.0.0: use setGroupBy() instead.', E_USER_DEPRECATED);
return $this->setGroupBy(...$groupBy);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,8 @@ public function getTransactionTypes(): array
*/
public function transactionTypes(string ...$transactionTypes): self
{
$this->transactionTypes = $transactionTypes;

return $this;
trigger_error(__METHOD__ . ' is deprecated in 3.0.7, will be removed in 4.0.0: use setTransactionTypes() instead.', E_USER_DEPRECATED);
return $this->setTransactionTypes(...$transactionTypes);
}

/**
Expand Down

0 comments on commit b7618af

Please sign in to comment.