Skip to content

Commit

Permalink
More specific PHPDoc type for RequestOptions arrays on services (#1646)
Browse files Browse the repository at this point in the history
  • Loading branch information
richardm-stripe authored Feb 13, 2024
1 parent 7571f60 commit f5c5a4d
Show file tree
Hide file tree
Showing 103 changed files with 1,055 additions and 439 deletions.
8 changes: 7 additions & 1 deletion lib/Service/AccountLinkService.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@

namespace Stripe\Service;

/**
* @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions
*/
/**
* @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions
*/
class AccountLinkService extends \Stripe\Service\AbstractService
{
/**
Expand All @@ -12,7 +18,7 @@ class AccountLinkService extends \Stripe\Service\AbstractService
* Onboarding flow.
*
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
Expand Down
44 changes: 25 additions & 19 deletions lib/Service/AccountService.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,20 @@

namespace Stripe\Service;

/**
* @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions
*/
/**
* @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions
*/
class AccountService extends \Stripe\Service\AbstractService
{
/**
* Returns a list of accounts connected to your platform via <a
* href="/docs/connect">Connect</a>. If you’re not a platform, the list is empty.
*
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
Expand All @@ -29,7 +35,7 @@ public function all($params = null, $opts = null)
*
* @param string $parentId
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
Expand All @@ -45,7 +51,7 @@ public function allCapabilities($parentId, $params = null, $opts = null)
*
* @param string $parentId
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
Expand All @@ -63,7 +69,7 @@ public function allExternalAccounts($parentId, $params = null, $opts = null)
*
* @param string $parentId
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
Expand All @@ -87,7 +93,7 @@ public function allPersons($parentId, $params = null, $opts = null)
* account.
*
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
Expand All @@ -103,7 +109,7 @@ public function create($params = null, $opts = null)
*
* @param string $parentId
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
Expand All @@ -124,7 +130,7 @@ public function createExternalAccount($parentId, $params = null, $opts = null)
*
* @param string $parentId
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
Expand All @@ -140,7 +146,7 @@ public function createLoginLink($parentId, $params = null, $opts = null)
*
* @param string $parentId
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
Expand All @@ -165,7 +171,7 @@ public function createPerson($parentId, $params = null, $opts = null)
*
* @param string $id
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
Expand All @@ -182,7 +188,7 @@ public function delete($id, $params = null, $opts = null)
* @param string $parentId
* @param string $id
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
Expand All @@ -203,7 +209,7 @@ public function deleteExternalAccount($parentId, $id, $params = null, $opts = nu
* @param string $parentId
* @param string $id
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
Expand All @@ -222,7 +228,7 @@ public function deletePerson($parentId, $id, $params = null, $opts = null)
*
* @param string $id
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
Expand All @@ -239,7 +245,7 @@ public function reject($id, $params = null, $opts = null)
* @param string $parentId
* @param string $id
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
Expand All @@ -256,7 +262,7 @@ public function retrieveCapability($parentId, $id, $params = null, $opts = null)
* @param string $parentId
* @param string $id
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
Expand All @@ -273,7 +279,7 @@ public function retrieveExternalAccount($parentId, $id, $params = null, $opts =
* @param string $parentId
* @param string $id
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
Expand Down Expand Up @@ -302,7 +308,7 @@ public function retrievePerson($parentId, $id, $params = null, $opts = null)
*
* @param string $id
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
Expand All @@ -320,7 +326,7 @@ public function update($id, $params = null, $opts = null)
* @param string $parentId
* @param string $id
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
Expand All @@ -343,7 +349,7 @@ public function updateCapability($parentId, $id, $params = null, $opts = null)
* @param string $parentId
* @param string $id
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
Expand All @@ -360,7 +366,7 @@ public function updateExternalAccount($parentId, $id, $params = null, $opts = nu
* @param string $parentId
* @param string $id
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
Expand Down
8 changes: 7 additions & 1 deletion lib/Service/AccountSessionService.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,20 @@

namespace Stripe\Service;

/**
* @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions
*/
/**
* @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions
*/
class AccountSessionService extends \Stripe\Service\AbstractService
{
/**
* Creates a AccountSession object that includes a single-use token that the
* platform can use on their front-end to grant client-side API access.
*
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
Expand Down
14 changes: 10 additions & 4 deletions lib/Service/ApplePayDomainService.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,19 @@

namespace Stripe\Service;

/**
* @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions
*/
/**
* @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions
*/
class ApplePayDomainService extends \Stripe\Service\AbstractService
{
/**
* List apple pay domains.
*
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
Expand All @@ -25,7 +31,7 @@ public function all($params = null, $opts = null)
* Create an apple pay domain.
*
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
Expand All @@ -41,7 +47,7 @@ public function create($params = null, $opts = null)
*
* @param string $id
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
Expand All @@ -57,7 +63,7 @@ public function delete($id, $params = null, $opts = null)
*
* @param string $id
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
Expand Down
18 changes: 12 additions & 6 deletions lib/Service/ApplicationFeeService.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,20 @@

namespace Stripe\Service;

/**
* @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions
*/
/**
* @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions
*/
class ApplicationFeeService extends \Stripe\Service\AbstractService
{
/**
* Returns a list of application fees you’ve previously collected. The application
* fees are returned in sorted order, with the most recent fees appearing first.
*
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
Expand All @@ -31,7 +37,7 @@ public function all($params = null, $opts = null)
*
* @param string $parentId
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
Expand All @@ -56,7 +62,7 @@ public function allRefunds($parentId, $params = null, $opts = null)
*
* @param string $parentId
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
Expand All @@ -73,7 +79,7 @@ public function createRefund($parentId, $params = null, $opts = null)
*
* @param string $id
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
Expand All @@ -92,7 +98,7 @@ public function retrieve($id, $params = null, $opts = null)
* @param string $parentId
* @param string $id
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
Expand All @@ -112,7 +118,7 @@ public function retrieveRefund($parentId, $id, $params = null, $opts = null)
* @param string $parentId
* @param string $id
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
Expand Down
14 changes: 10 additions & 4 deletions lib/Service/Apps/SecretService.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,19 @@

namespace Stripe\Service\Apps;

/**
* @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions
*/
/**
* @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions
*/
class SecretService extends \Stripe\Service\AbstractService
{
/**
* List all secrets stored on the given scope.
*
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
Expand All @@ -25,7 +31,7 @@ public function all($params = null, $opts = null)
* Create or replace a secret in the secret store.
*
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
Expand All @@ -40,7 +46,7 @@ public function create($params = null, $opts = null)
* Deletes a secret from the secret store by name and scope.
*
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
Expand All @@ -55,7 +61,7 @@ public function deleteWhere($params = null, $opts = null)
* Finds a secret in the secret store by name and scope.
*
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
Expand Down
Loading

0 comments on commit f5c5a4d

Please sign in to comment.