Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[13.x] Add array types #1152

Merged
merged 1 commit into from
May 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/Subscription.php
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ public function reportUsageFor($plan, $quantity = 1, $timestamp = null)
* @param string|null $plan
* @return \Illuminate\Support\Collection
*/
public function usageRecords($options = [], $plan = null)
public function usageRecords(array $options = [], $plan = null)
{
if (! $plan) {
$this->guardAgainstMultiplePlans();
Expand All @@ -543,7 +543,7 @@ public function usageRecords($options = [], $plan = null)
* @param array $options
* @return \Illuminate\Support\Collection
*/
public function usageRecordsFor($plan, $options = [])
public function usageRecordsFor($plan, array $options = [])
{
return $this->usageRecords($options, $plan);
}
Expand Down Expand Up @@ -635,7 +635,7 @@ public function extendTrial(CarbonInterface $date)
*
* @throws \Laravel\Cashier\Exceptions\SubscriptionUpdateFailure
*/
public function swap($plans, $options = [])
public function swap($plans, array $options = [])
{
if (empty($plans = (array) $plans)) {
throw new InvalidArgumentException('Please provide at least one plan when swapping.');
Expand Down Expand Up @@ -695,7 +695,7 @@ public function swap($plans, $options = [])
* @throws \Laravel\Cashier\Exceptions\IncompletePayment
* @throws \Laravel\Cashier\Exceptions\SubscriptionUpdateFailure
*/
public function swapAndInvoice($plans, $options = [])
public function swapAndInvoice($plans, array $options = [])
{
$this->alwaysInvoice();

Expand Down Expand Up @@ -794,7 +794,7 @@ protected function getSwapOptions(Collection $items, $options)
*
* @throws \Laravel\Cashier\Exceptions\SubscriptionUpdateFailure
*/
public function addPlan($plan, $quantity = 1, $options = [])
public function addPlan($plan, $quantity = 1, array $options = [])
{
$this->guardAgainstIncomplete();

Expand Down Expand Up @@ -841,7 +841,7 @@ public function addPlan($plan, $quantity = 1, $options = [])
* @throws \Laravel\Cashier\Exceptions\IncompletePayment
* @throws \Laravel\Cashier\Exceptions\SubscriptionUpdateFailure
*/
public function addPlanAndInvoice($plan, $quantity = 1, $options = [])
public function addPlanAndInvoice($plan, $quantity = 1, array $options = [])
{
$this->alwaysInvoice();

Expand Down
4 changes: 2 additions & 2 deletions src/SubscriptionItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public function updateQuantity($quantity)
*
* @throws \Laravel\Cashier\Exceptions\SubscriptionUpdateFailure
*/
public function swap($plan, $options = [])
public function swap($plan, array $options = [])
{
$this->subscription->guardAgainstIncomplete();

Expand Down Expand Up @@ -181,7 +181,7 @@ public function swap($plan, $options = [])
* @throws \Laravel\Cashier\Exceptions\IncompletePayment
* @throws \Laravel\Cashier\Exceptions\SubscriptionUpdateFailure
*/
public function swapAndInvoice($plan, $options = [])
public function swapAndInvoice($plan, array $options = [])
{
$this->alwaysInvoice();

Expand Down
2 changes: 1 addition & 1 deletion tests/Feature/FeatureTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ protected static function deleteStripeResource(ApiResource $resource)
}
}

protected function createCustomer($description = 'taylor', $options = []): User
protected function createCustomer($description = 'taylor', array $options = []): User
{
return User::create(array_merge([
'email' => "{$description}@cashier-test.com",
Expand Down