Skip to content

Commit

Permalink
Merge 5fc90cc into f636532
Browse files Browse the repository at this point in the history
  • Loading branch information
ob-stripe committed Feb 6, 2020
2 parents f636532 + 5fc90cc commit 379a682
Show file tree
Hide file tree
Showing 50 changed files with 207 additions and 103 deletions.
24 changes: 24 additions & 0 deletions .php_cs.dist
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,36 @@ return PhpCsFixer\Config::create()
'@PHP56Migration:risky' => true,
'@PHPUnit57Migration:risky' => true,
'@PSR2' => true,
'align_multiline_comment' => true,
'array_syntax' => ['syntax' => 'short'],
'blank_line_after_opening_tag' => true,
'class_attributes_separation' => [
'elements' => ['method'],
],
'linebreak_after_opening_tag' => true,
'native_function_invocation' => true,
'no_blank_lines_after_phpdoc' => true,
'no_empty_phpdoc' => true,
'phpdoc_add_missing_param_annotation' => true,
'phpdoc_indent' => true,
'phpdoc_inline_tag' => true,
'phpdoc_no_access' => true,
'phpdoc_no_alias_tag' => true,
'phpdoc_no_empty_return' => true,
'phpdoc_no_useless_inheritdoc' => true,
'phpdoc_order' => true,
'phpdoc_return_self_reference' => true,
'phpdoc_scalar' => true,
'phpdoc_separation' => true,
'phpdoc_single_line_var_spacing' => true,
'phpdoc_to_comment' => true,
'phpdoc_trim' => true,
'phpdoc_trim_consecutive_blank_line_separation' => true,
'phpdoc_types' => true,
'phpdoc_types_order' => [
'null_adjustment' => 'always_last',
],
'phpdoc_var_annotation_correct_order' => true,
'phpdoc_var_without_name' => true,
])
;
12 changes: 8 additions & 4 deletions lib/Account.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,16 @@ class Account extends ApiResource

/**
* Possible string representations of an account's business type.
* @link https://stripe.com/docs/api/accounts/object#account_object-business_type
*
* @see https://stripe.com/docs/api/accounts/object#account_object-business_type
*/
const BUSINESS_TYPE_COMPANY = 'company';
const BUSINESS_TYPE_INDIVIDUAL = 'individual';

/**
* Possible string representations of an account's capabilities.
* @link https://stripe.com/docs/api/accounts/object#account_object-capabilities
*
* @see https://stripe.com/docs/api/accounts/object#account_object-capabilities
*/
const CAPABILITY_CARD_PAYMENTS = 'card_payments';
const CAPABILITY_LEGACY_PAYMENTS = 'legacy_payments';
Expand All @@ -60,15 +62,17 @@ class Account extends ApiResource

/**
* Possible string representations of an account's capability status.
* @link https://stripe.com/docs/api/accounts/object#account_object-capabilities
*
* @see https://stripe.com/docs/api/accounts/object#account_object-capabilities
*/
const CAPABILITY_STATUS_ACTIVE = 'active';
const CAPABILITY_STATUS_INACTIVE = 'inactive';
const CAPABILITY_STATUS_PENDING = 'pending';

/**
* Possible string representations of an account's type.
* @link https://stripe.com/docs/api/accounts/object#account_object-type
*
* @see https://stripe.com/docs/api/accounts/object#account_object-type
*/
const TYPE_CUSTOM = 'custom';
const TYPE_EXPRESS = 'express';
Expand Down
6 changes: 3 additions & 3 deletions lib/AlipayAccount.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* @package Stripe
*
* @deprecated Alipay accounts are deprecated. Please use the sources API instead.
* @link https://stripe.com/docs/sources/alipay
* @see https://stripe.com/docs/sources/alipay
*/
class AlipayAccount extends ApiResource
{
Expand Down Expand Up @@ -43,7 +43,7 @@ public function instanceUrl()
* @throws \Stripe\Exception\BadMethodCallException
*
* @deprecated Alipay accounts are deprecated. Please use the sources API instead.
* @link https://stripe.com/docs/sources/alipay
* @see https://stripe.com/docs/sources/alipay
*/
public static function retrieve($_id, $_opts = null)
{
Expand All @@ -61,7 +61,7 @@ public static function retrieve($_id, $_opts = null)
* @throws \Stripe\Exception\BadMethodCallException
*
* @deprecated Alipay accounts are deprecated. Please use the sources API instead.
* @link https://stripe.com/docs/sources/alipay
* @see https://stripe.com/docs/sources/alipay
*/
public static function update($_id, $_params = null, $_options = null)
{
Expand Down
2 changes: 1 addition & 1 deletion lib/ApiOperations/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
trait Request
{
/**
* @param array|null|mixed $params The list of parameters to validate
* @param array|mixed|null $params The list of parameters to validate
*
* @throws \Stripe\Exception\InvalidArgumentException if $params exists and is not an array
*/
Expand Down
28 changes: 15 additions & 13 deletions lib/ApiRequestor.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,11 @@ public function __construct($apiKey = null, $apiBase = null)

/**
* Creates a telemetry json blob for use in 'X-Stripe-Client-Telemetry' headers
*
* @static
*
* @param RequestTelemetry $requestTelemetry
*
* @return string
*/
private static function _telemetryJson($requestTelemetry)
Expand All @@ -71,9 +73,9 @@ private static function _telemetryJson($requestTelemetry)
/**
* @static
*
* @param ApiResource|bool|array|mixed $d
* @param ApiResource|array|bool|mixed $d
*
* @return ApiResource|array|string|mixed
* @return ApiResource|array|mixed|string
*/
private static function _encodeObjects($d)
{
Expand All @@ -100,9 +102,9 @@ private static function _encodeObjects($d)
* @param array|null $params
* @param array|null $headers
*
* @return array tuple containing (ApiReponse, API key)
*
* @throws Exception\ApiErrorException
*
* @return array tuple containing (ApiReponse, API key)
*/
public function request($method, $url, $params = null, $headers = null)
{
Expand Down Expand Up @@ -194,7 +196,7 @@ private static function _specificAPIError($rbody, $rcode, $rheaders, $resp, $err
/**
* @static
*
* @param string|bool $rbody
* @param bool|string $rbody
* @param int $rcode
* @param array $rheaders
* @param array $resp
Expand Down Expand Up @@ -227,9 +229,9 @@ private static function _specificOAuthError($rbody, $rcode, $rheaders, $resp, $e
/**
* @static
*
* @param null|array $appInfo
* @param array|null $appInfo
*
* @return null|string
* @return string|null
*/
private static function _formatAppInfo($appInfo)
{
Expand Down Expand Up @@ -293,10 +295,10 @@ private static function _defaultHeaders($apiKey, $clientInfo = null)
* @param array $params
* @param array $headers
*
* @return array
*
* @throws Exception\AuthenticationException
* @throws Exception\ApiConnectionException
*
* @return array
*/
private function _requestRaw($method, $url, $params, $headers)
{
Expand Down Expand Up @@ -382,9 +384,9 @@ private function _requestRaw($method, $url, $params, $headers)
/**
* @param resource $resource
*
* @return \CURLFile|string
*
* @throws Exception\InvalidArgumentException
*
* @return \CURLFile|string
*/
private function _processResourceParam($resource)
{
Expand All @@ -410,10 +412,10 @@ private function _processResourceParam($resource)
* @param int $rcode
* @param array $rheaders
*
* @return array
*
* @throws Exception\UnexpectedValueException
* @throws Exception\ApiErrorException
*
* @return array
*/
private function _interpretResponse($rbody, $rcode, $rheaders)
{
Expand Down
10 changes: 7 additions & 3 deletions lib/ApiResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public static function getSavedNestedResources()
}

/**
* @var boolean A flag that can be set a behavior that will cause this
* @var bool A flag that can be set a behavior that will cause this
* resource to be encoded and sent up along with an update of its parent
* resource. This is usually not desirable because resources are updated
* individually on their own endpoints, but there are certain cases,
Expand All @@ -48,9 +48,9 @@ public function __set($k, $v)
}

/**
* @return ApiResource The refreshed resource.
*
* @throws Exception\ApiErrorException
*
* @return ApiResource The refreshed resource.
*/
public function refresh()
{
Expand Down Expand Up @@ -88,6 +88,10 @@ public static function classUrl()
}

/**
* @param string|null $id the ID of the resource
*
* @throws Exception\UnexpectedValueException if $id is null
*
* @return string The instance endpoint URL for the given class.
*/
public static function resourceUrl($id)
Expand Down
2 changes: 1 addition & 1 deletion lib/ApiResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class ApiResponse

/**
* @param string $body
* @param integer $code
* @param int $code
* @param array|CaseInsensitiveArray|null $headers
* @param array|null $json
*/
Expand Down
3 changes: 2 additions & 1 deletion lib/BalanceTransaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ class BalanceTransaction extends ApiResource

/**
* Possible string representations of the type of balance transaction.
* @link https://stripe.com/docs/api/balance/balance_transaction#balance_transaction_object-type
*
* @see https://stripe.com/docs/api/balance/balance_transaction#balance_transaction_object-type
*/
const TYPE_ADJUSTMENT = 'adjustment';
const TYPE_ADVANCE = 'advance';
Expand Down
3 changes: 2 additions & 1 deletion lib/BankAccount.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ class BankAccount extends ApiResource

/**
* Possible string representations of the bank verification status.
* @link https://stripe.com/docs/api/external_account_bank_accounts/object#account_bank_account_object-status
*
* @see https://stripe.com/docs/api/external_account_bank_accounts/object#account_bank_account_object-status
*/
const STATUS_NEW = 'new';
const STATUS_VALIDATED = 'validated';
Expand Down
2 changes: 1 addition & 1 deletion lib/BitcoinReceiver.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Class BitcoinReceiver
*
* @deprecated Bitcoin receivers are deprecated. Please use the sources API instead.
* @link https://stripe.com/docs/sources/bitcoin
* @see https://stripe.com/docs/sources/bitcoin
*
* @property string $id
* @property string $object
Expand Down
3 changes: 2 additions & 1 deletion lib/Capability.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ class Capability extends ApiResource

/**
* Possible string representations of a capability's status.
* @link https://stripe.com/docs/api/capabilities/object#capability_object-status
*
* @see https://stripe.com/docs/api/capabilities/object#capability_object-status
*/
const STATUS_ACTIVE = 'active';
const STATUS_INACTIVE = 'inactive';
Expand Down
9 changes: 6 additions & 3 deletions lib/Card.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ class Card extends ApiResource

/**
* Possible string representations of the CVC check status.
* @link https://stripe.com/docs/api/cards/object#card_object-cvc_check
*
* @see https://stripe.com/docs/api/cards/object#card_object-cvc_check
*/
const CVC_CHECK_FAIL = 'fail';
const CVC_CHECK_PASS = 'pass';
Expand All @@ -54,7 +55,8 @@ class Card extends ApiResource

/**
* Possible string representations of the funding of the card.
* @link https://stripe.com/docs/api/cards/object#card_object-funding
*
* @see https://stripe.com/docs/api/cards/object#card_object-funding
*/
const FUNDING_CREDIT = 'credit';
const FUNDING_DEBIT = 'debit';
Expand All @@ -63,7 +65,8 @@ class Card extends ApiResource

/**
* Possible string representations of the tokenization method when using Apple Pay or Google Pay.
* @link https://stripe.com/docs/api/cards/object#card_object-tokenization_method
*
* @see https://stripe.com/docs/api/cards/object#card_object-tokenization_method
*/
const TOKENIZATION_METHOD_APPLE_PAY = 'apple_pay';
const TOKENIZATION_METHOD_GOOGLE_PAY = 'google_pay';
Expand Down
6 changes: 4 additions & 2 deletions lib/Charge.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ class Charge extends ApiResource
/**
* Possible string representations of decline codes.
* These strings are applicable to the decline_code property of the \Stripe\Exception\CardException exception.
* @link https://stripe.com/docs/declines/codes
*
* @see https://stripe.com/docs/declines/codes
*/
const DECLINED_AUTHENTICATION_REQUIRED = 'authentication_required';
const DECLINED_APPROVE_WITH_ID = 'approve_with_id';
Expand Down Expand Up @@ -116,7 +117,8 @@ class Charge extends ApiResource

/**
* Possible string representations of the status of the charge.
* @link https://stripe.com/docs/api/charges/object#charge_object-status
*
* @see https://stripe.com/docs/api/charges/object#charge_object-status
*/
const STATUS_FAILED = 'failed';
const STATUS_PENDING = 'pending';
Expand Down
3 changes: 2 additions & 1 deletion lib/Checkout/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ class Session extends \Stripe\ApiResource

/**
* Possible string representations of submit type.
* @link https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-submit_type
*
* @see https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-submit_type
*/
const SUBMIT_TYPE_AUTO = 'auto';
const SUBMIT_TYPE_BOOK = 'book';
Expand Down
5 changes: 4 additions & 1 deletion lib/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ public function autoPagingIterator()
* behavior of the API when it attempts to return a page beyond the last.
*
* @param array|string|null $opts
*
* @return Collection
*/
public static function emptyCollection($opts = null)
Expand All @@ -168,7 +169,7 @@ public static function emptyCollection($opts = null)
/**
* Returns true if the page object contains no element.
*
* @return boolean
* @return bool
*/
public function isEmpty()
{
Expand All @@ -183,6 +184,7 @@ public function isEmpty()
*
* @param array|null $params
* @param array|string|null $opts
*
* @return Collection
*/
public function nextPage($params = null, $opts = null)
Expand Down Expand Up @@ -210,6 +212,7 @@ public function nextPage($params = null, $opts = null)
*
* @param array|null $params
* @param array|string|null $opts
*
* @return Collection
*/
public function previousPage($params = null, $opts = null)
Expand Down

0 comments on commit 379a682

Please sign in to comment.