diff --git a/examples/oauth.php b/examples/oauth.php index abde15696..3a6291129 100644 --- a/examples/oauth.php +++ b/examples/oauth.php @@ -23,7 +23,6 @@ echo "

Success! Account $accountId is connected.

\n"; echo "

Click here to disconnect the account.

\n"; - } elseif (isset($_GET['error'])) { // The user was redirect back from the OAuth form with an error. $error = $_GET['error']; @@ -31,7 +30,6 @@ echo "

Error: code=" . htmlspecialchars($error, ENT_QUOTES) . ", description=" . htmlspecialchars($error_description, ENT_QUOTES) . "

\n"; echo "

Click here to restart the OAuth flow.

\n"; - } elseif (isset($_GET['deauth'])) { // Deauthorization request $accountId = $_GET['deauth']; @@ -46,7 +44,6 @@ echo "

Success! Account " . htmlspecialchars($accountId, ENT_QUOTES) . " is disconnected.

\n"; echo "

Click here to restart the OAuth flow.

\n"; - } else { $url = \Stripe\OAuth::authorizeUrl([ 'scope' => 'read_only', diff --git a/lib/Account.php b/lib/Account.php index 1adc6b79d..4993ca354 100644 --- a/lib/Account.php +++ b/lib/Account.php @@ -30,7 +30,6 @@ */ class Account extends ApiResource { - const OBJECT_NAME = "account"; use ApiOperations\All; diff --git a/lib/AccountLink.php b/lib/AccountLink.php index f2975ae38..692447dbf 100644 --- a/lib/AccountLink.php +++ b/lib/AccountLink.php @@ -14,7 +14,6 @@ */ class AccountLink extends ApiResource { - const OBJECT_NAME = "account_link"; use ApiOperations\Create; diff --git a/lib/AlipayAccount.php b/lib/AlipayAccount.php index 70a281bd7..a79705fa4 100644 --- a/lib/AlipayAccount.php +++ b/lib/AlipayAccount.php @@ -12,7 +12,6 @@ */ class AlipayAccount extends ApiResource { - const OBJECT_NAME = "alipay_account"; use ApiOperations\Delete; diff --git a/lib/ApiRequestor.php b/lib/ApiRequestor.php index 7cf851877..1f75a007b 100644 --- a/lib/ApiRequestor.php +++ b/lib/ApiRequestor.php @@ -205,7 +205,7 @@ private static function _specificAPIError($rbody, $rcode, $rheaders, $resp, $err return new Error\Idempotency($msg, $rcode, $rbody, $resp, $rheaders); } - // intentional fall-through + // no break case 404: return new Error\InvalidRequest($msg, $param, $rcode, $rbody, $resp, $rheaders); case 401: diff --git a/lib/ApplePayDomain.php b/lib/ApplePayDomain.php index ea84220a7..57687c4f2 100644 --- a/lib/ApplePayDomain.php +++ b/lib/ApplePayDomain.php @@ -9,7 +9,6 @@ */ class ApplePayDomain extends ApiResource { - const OBJECT_NAME = "apple_pay_domain"; use ApiOperations\All; diff --git a/lib/ApplicationFee.php b/lib/ApplicationFee.php index 0d9fde4c5..4b83071ad 100644 --- a/lib/ApplicationFee.php +++ b/lib/ApplicationFee.php @@ -24,7 +24,6 @@ */ class ApplicationFee extends ApiResource { - const OBJECT_NAME = "application_fee"; use ApiOperations\All; diff --git a/lib/ApplicationFeeRefund.php b/lib/ApplicationFeeRefund.php index 91d7e9d2b..b242f2024 100644 --- a/lib/ApplicationFeeRefund.php +++ b/lib/ApplicationFeeRefund.php @@ -18,7 +18,6 @@ */ class ApplicationFeeRefund extends ApiResource { - const OBJECT_NAME = "fee_refund"; use ApiOperations\Update { diff --git a/lib/Balance.php b/lib/Balance.php index 25f88ae74..b99871adb 100644 --- a/lib/Balance.php +++ b/lib/Balance.php @@ -15,7 +15,6 @@ */ class Balance extends SingletonApiResource { - const OBJECT_NAME = "balance"; /** diff --git a/lib/BalanceTransaction.php b/lib/BalanceTransaction.php index 403c4aa17..78805d4d4 100644 --- a/lib/BalanceTransaction.php +++ b/lib/BalanceTransaction.php @@ -24,7 +24,6 @@ */ class BalanceTransaction extends ApiResource { - const OBJECT_NAME = "balance_transaction"; use ApiOperations\All; diff --git a/lib/BankAccount.php b/lib/BankAccount.php index 3fdc9188c..a77f3054b 100644 --- a/lib/BankAccount.php +++ b/lib/BankAccount.php @@ -25,7 +25,6 @@ */ class BankAccount extends ApiResource { - const OBJECT_NAME = "bank_account"; use ApiOperations\Delete; @@ -93,12 +92,12 @@ public static function update($_id, $_params = null, $_options = null) throw new Error\InvalidRequest($msg, null); } - /** - * @param array|null $params - * @param array|string|null $options - * - * @return BankAccount The verified bank account. - */ + /** + * @param array|null $params + * @param array|string|null $options + * + * @return BankAccount The verified bank account. + */ public function verify($params = null, $options = null) { $url = $this->instanceUrl() . '/verify'; diff --git a/lib/BitcoinReceiver.php b/lib/BitcoinReceiver.php index b4cc5291b..a9272dfa2 100644 --- a/lib/BitcoinReceiver.php +++ b/lib/BitcoinReceiver.php @@ -12,7 +12,6 @@ */ class BitcoinReceiver extends ApiResource { - const OBJECT_NAME = "bitcoin_receiver"; use ApiOperations\All; diff --git a/lib/BitcoinTransaction.php b/lib/BitcoinTransaction.php index 8269fd216..122be4231 100644 --- a/lib/BitcoinTransaction.php +++ b/lib/BitcoinTransaction.php @@ -9,6 +9,5 @@ */ class BitcoinTransaction extends ApiResource { - const OBJECT_NAME = "bitcoin_transaction"; } diff --git a/lib/Capability.php b/lib/Capability.php index 78cb03936..aabf54b1f 100644 --- a/lib/Capability.php +++ b/lib/Capability.php @@ -17,7 +17,6 @@ */ class Capability extends ApiResource { - const OBJECT_NAME = "capability"; use ApiOperations\Update; diff --git a/lib/Card.php b/lib/Card.php index 40de733e7..51eb5add1 100644 --- a/lib/Card.php +++ b/lib/Card.php @@ -38,7 +38,6 @@ */ class Card extends ApiResource { - const OBJECT_NAME = "card"; use ApiOperations\Delete; diff --git a/lib/Charge.php b/lib/Charge.php index 43274c555..0c3853c96 100644 --- a/lib/Charge.php +++ b/lib/Charge.php @@ -53,7 +53,6 @@ */ class Charge extends ApiResource { - const OBJECT_NAME = "charge"; use ApiOperations\All; diff --git a/lib/Checkout/Session.php b/lib/Checkout/Session.php index 33fc6a08a..227dd7b68 100644 --- a/lib/Checkout/Session.php +++ b/lib/Checkout/Session.php @@ -23,7 +23,6 @@ */ class Session extends \Stripe\ApiResource { - const OBJECT_NAME = "checkout.session"; use \Stripe\ApiOperations\Create; diff --git a/lib/Collection.php b/lib/Collection.php index 986cd3309..38d3835ff 100644 --- a/lib/Collection.php +++ b/lib/Collection.php @@ -14,7 +14,6 @@ */ class Collection extends StripeObject implements \IteratorAggregate { - const OBJECT_NAME = "list"; use ApiOperations\Request; diff --git a/lib/CountrySpec.php b/lib/CountrySpec.php index 668bfe62e..ef02c340b 100644 --- a/lib/CountrySpec.php +++ b/lib/CountrySpec.php @@ -18,7 +18,6 @@ */ class CountrySpec extends ApiResource { - const OBJECT_NAME = "country_spec"; use ApiOperations\All; diff --git a/lib/Coupon.php b/lib/Coupon.php index 51d4fd865..76d549ad9 100644 --- a/lib/Coupon.php +++ b/lib/Coupon.php @@ -25,7 +25,6 @@ */ class Coupon extends ApiResource { - const OBJECT_NAME = "coupon"; use ApiOperations\All; diff --git a/lib/CreditNote.php b/lib/CreditNote.php index 66351ffb8..c81d86ee6 100644 --- a/lib/CreditNote.php +++ b/lib/CreditNote.php @@ -27,7 +27,6 @@ */ class CreditNote extends ApiResource { - const OBJECT_NAME = "credit_note"; use ApiOperations\All; diff --git a/lib/Customer.php b/lib/Customer.php index 6e78f981e..a3f7f6311 100644 --- a/lib/Customer.php +++ b/lib/Customer.php @@ -33,7 +33,6 @@ */ class Customer extends ApiResource { - const OBJECT_NAME = "customer"; use ApiOperations\All; diff --git a/lib/Discount.php b/lib/Discount.php index a72d12bc6..68bfc0fd7 100644 --- a/lib/Discount.php +++ b/lib/Discount.php @@ -16,6 +16,5 @@ */ class Discount extends StripeObject { - const OBJECT_NAME = "discount"; } diff --git a/lib/Dispute.php b/lib/Dispute.php index 2d58daa38..8ffc2d4cc 100644 --- a/lib/Dispute.php +++ b/lib/Dispute.php @@ -24,7 +24,6 @@ */ class Dispute extends ApiResource { - const OBJECT_NAME = "dispute"; use ApiOperations\All; diff --git a/lib/EphemeralKey.php b/lib/EphemeralKey.php index 5ed4646b4..ea4cc756c 100644 --- a/lib/EphemeralKey.php +++ b/lib/EphemeralKey.php @@ -17,7 +17,6 @@ */ class EphemeralKey extends ApiResource { - const OBJECT_NAME = "ephemeral_key"; use ApiOperations\Create { diff --git a/lib/Event.php b/lib/Event.php index a986c35df..f9a004aa6 100644 --- a/lib/Event.php +++ b/lib/Event.php @@ -20,7 +20,6 @@ */ class Event extends ApiResource { - const OBJECT_NAME = "event"; /** diff --git a/lib/ExchangeRate.php b/lib/ExchangeRate.php index 803a5f877..6a7e7a36a 100644 --- a/lib/ExchangeRate.php +++ b/lib/ExchangeRate.php @@ -9,7 +9,6 @@ */ class ExchangeRate extends ApiResource { - const OBJECT_NAME = "exchange_rate"; use ApiOperations\All; diff --git a/lib/FileLink.php b/lib/FileLink.php index 2a012b361..385971f7d 100644 --- a/lib/FileLink.php +++ b/lib/FileLink.php @@ -19,7 +19,6 @@ */ class FileLink extends ApiResource { - const OBJECT_NAME = "file_link"; use ApiOperations\All; diff --git a/lib/Invoice.php b/lib/Invoice.php index 31a845854..a309dd9e4 100644 --- a/lib/Invoice.php +++ b/lib/Invoice.php @@ -70,7 +70,6 @@ */ class Invoice extends ApiResource { - const OBJECT_NAME = "invoice"; use ApiOperations\All; diff --git a/lib/InvoiceItem.php b/lib/InvoiceItem.php index 02ca0f2d7..2f74dabec 100644 --- a/lib/InvoiceItem.php +++ b/lib/InvoiceItem.php @@ -29,7 +29,6 @@ */ class InvoiceItem extends ApiResource { - const OBJECT_NAME = "invoiceitem"; use ApiOperations\All; diff --git a/lib/IssuerFraudRecord.php b/lib/IssuerFraudRecord.php index 8db4b31b0..805dc5028 100644 --- a/lib/IssuerFraudRecord.php +++ b/lib/IssuerFraudRecord.php @@ -17,7 +17,6 @@ */ class IssuerFraudRecord extends ApiResource { - const OBJECT_NAME = "issuer_fraud_record"; use ApiOperations\All; diff --git a/lib/LoginLink.php b/lib/LoginLink.php index 3a443bf16..9f677364b 100644 --- a/lib/LoginLink.php +++ b/lib/LoginLink.php @@ -13,6 +13,5 @@ */ class LoginLink extends ApiResource { - const OBJECT_NAME = "login_link"; } diff --git a/lib/Order.php b/lib/Order.php index 0688c6ef9..1f2ce2563 100644 --- a/lib/Order.php +++ b/lib/Order.php @@ -33,7 +33,6 @@ */ class Order extends ApiResource { - const OBJECT_NAME = "order"; use ApiOperations\All; diff --git a/lib/OrderItem.php b/lib/OrderItem.php index 26d49b4e7..6ef1242fc 100644 --- a/lib/OrderItem.php +++ b/lib/OrderItem.php @@ -17,6 +17,5 @@ */ class OrderItem extends StripeObject { - const OBJECT_NAME = "order_item"; } diff --git a/lib/OrderReturn.php b/lib/OrderReturn.php index f3705e861..3b1ca8efa 100644 --- a/lib/OrderReturn.php +++ b/lib/OrderReturn.php @@ -19,7 +19,6 @@ */ class OrderReturn extends ApiResource { - const OBJECT_NAME = "order_return"; use ApiOperations\All; diff --git a/lib/PaymentIntent.php b/lib/PaymentIntent.php index 47cbf8fc6..b70b15778 100644 --- a/lib/PaymentIntent.php +++ b/lib/PaymentIntent.php @@ -42,7 +42,6 @@ */ class PaymentIntent extends ApiResource { - const OBJECT_NAME = "payment_intent"; use ApiOperations\All; diff --git a/lib/PaymentMethod.php b/lib/PaymentMethod.php index 1a0bc371d..c0557e8c3 100644 --- a/lib/PaymentMethod.php +++ b/lib/PaymentMethod.php @@ -22,7 +22,6 @@ */ class PaymentMethod extends ApiResource { - const OBJECT_NAME = "payment_method"; use ApiOperations\All; diff --git a/lib/Payout.php b/lib/Payout.php index 365d7e47e..131bd4ae0 100644 --- a/lib/Payout.php +++ b/lib/Payout.php @@ -30,7 +30,6 @@ */ class Payout extends ApiResource { - const OBJECT_NAME = "payout"; use ApiOperations\All; diff --git a/lib/Person.php b/lib/Person.php index f79b80da0..5540f7c5f 100644 --- a/lib/Person.php +++ b/lib/Person.php @@ -35,7 +35,6 @@ */ class Person extends ApiResource { - const OBJECT_NAME = "person"; use ApiOperations\Delete; diff --git a/lib/Plan.php b/lib/Plan.php index 54a2b58eb..1a7ae87dd 100644 --- a/lib/Plan.php +++ b/lib/Plan.php @@ -29,7 +29,6 @@ */ class Plan extends ApiResource { - const OBJECT_NAME = "plan"; use ApiOperations\All; diff --git a/lib/Product.php b/lib/Product.php index cb27ef42d..6c60d20c4 100644 --- a/lib/Product.php +++ b/lib/Product.php @@ -29,7 +29,6 @@ */ class Product extends ApiResource { - const OBJECT_NAME = "product"; use ApiOperations\All; diff --git a/lib/Recipient.php b/lib/Recipient.php index 2d5eda5cf..35a695f50 100644 --- a/lib/Recipient.php +++ b/lib/Recipient.php @@ -24,7 +24,6 @@ */ class Recipient extends ApiResource { - const OBJECT_NAME = "recipient"; use ApiOperations\All; diff --git a/lib/RecipientTransfer.php b/lib/RecipientTransfer.php index 17de5a52e..7a2ec1f3f 100644 --- a/lib/RecipientTransfer.php +++ b/lib/RecipientTransfer.php @@ -34,6 +34,5 @@ */ class RecipientTransfer extends ApiResource { - const OBJECT_NAME = "recipient_transfer"; } diff --git a/lib/Refund.php b/lib/Refund.php index 6f3fdfaf4..f8b4529b7 100644 --- a/lib/Refund.php +++ b/lib/Refund.php @@ -26,7 +26,6 @@ */ class Refund extends ApiResource { - const OBJECT_NAME = "refund"; use ApiOperations\All; diff --git a/lib/SKU.php b/lib/SKU.php index 5b50df8a8..cb3aa6f73 100644 --- a/lib/SKU.php +++ b/lib/SKU.php @@ -24,7 +24,6 @@ */ class SKU extends ApiResource { - const OBJECT_NAME = "sku"; use ApiOperations\All; diff --git a/lib/SetupIntent.php b/lib/SetupIntent.php index f476fb35f..176a411b6 100644 --- a/lib/SetupIntent.php +++ b/lib/SetupIntent.php @@ -25,7 +25,6 @@ */ class SetupIntent extends ApiResource { - const OBJECT_NAME = "setup_intent"; use ApiOperations\All; diff --git a/lib/Source.php b/lib/Source.php index 1e2c8c735..ec5cc4212 100644 --- a/lib/Source.php +++ b/lib/Source.php @@ -43,7 +43,6 @@ */ class Source extends ApiResource { - const OBJECT_NAME = "source"; use ApiOperations\Create; diff --git a/lib/SourceTransaction.php b/lib/SourceTransaction.php index 018a89624..d004032c5 100644 --- a/lib/SourceTransaction.php +++ b/lib/SourceTransaction.php @@ -18,6 +18,5 @@ */ class SourceTransaction extends ApiResource { - const OBJECT_NAME = "source_transaction"; } diff --git a/lib/StripeObject.php b/lib/StripeObject.php index 432e95b7f..62e02c0e0 100644 --- a/lib/StripeObject.php +++ b/lib/StripeObject.php @@ -153,7 +153,7 @@ public function &__get($k) $nullval = null; if (!empty($this->_values) && array_key_exists($k, $this->_values)) { return $this->_values[$k]; - } else if (!empty($this->_transientValues) && $this->_transientValues->includes($k)) { + } elseif (!empty($this->_transientValues) && $this->_transientValues->includes($k)) { $class = get_class($this); $attrs = join(', ', array_keys($this->_values)); $message = "Stripe Notice: Undefined property of $class instance: $k. " diff --git a/lib/Subscription.php b/lib/Subscription.php index f5a46171d..262dd5d07 100644 --- a/lib/Subscription.php +++ b/lib/Subscription.php @@ -42,7 +42,6 @@ */ class Subscription extends ApiResource { - const OBJECT_NAME = "subscription"; use ApiOperations\All; diff --git a/lib/SubscriptionItem.php b/lib/SubscriptionItem.php index 5baa540fe..f78f8fea0 100644 --- a/lib/SubscriptionItem.php +++ b/lib/SubscriptionItem.php @@ -19,7 +19,6 @@ */ class SubscriptionItem extends ApiResource { - const OBJECT_NAME = "subscription_item"; use ApiOperations\All; diff --git a/lib/SubscriptionSchedule.php b/lib/SubscriptionSchedule.php index ac3686f1d..a1c663201 100644 --- a/lib/SubscriptionSchedule.php +++ b/lib/SubscriptionSchedule.php @@ -30,7 +30,6 @@ */ class SubscriptionSchedule extends ApiResource { - const OBJECT_NAME = "subscription_schedule"; use ApiOperations\All; diff --git a/lib/SubscriptionScheduleRevision.php b/lib/SubscriptionScheduleRevision.php index 121772365..2818b1e1f 100644 --- a/lib/SubscriptionScheduleRevision.php +++ b/lib/SubscriptionScheduleRevision.php @@ -20,7 +20,6 @@ */ class SubscriptionScheduleRevision extends ApiResource { - const OBJECT_NAME = "subscription_schedule_revision"; use ApiOperations\All; diff --git a/lib/TaxId.php b/lib/TaxId.php index 0f72a2ac9..8d607132e 100644 --- a/lib/TaxId.php +++ b/lib/TaxId.php @@ -19,7 +19,6 @@ */ class TaxId extends ApiResource { - const OBJECT_NAME = "tax_id"; use ApiOperations\Delete; diff --git a/lib/TaxRate.php b/lib/TaxRate.php index 25884dd84..9f416507c 100644 --- a/lib/TaxRate.php +++ b/lib/TaxRate.php @@ -21,7 +21,6 @@ */ class TaxRate extends ApiResource { - const OBJECT_NAME = "tax_rate"; use ApiOperations\All; diff --git a/lib/ThreeDSecure.php b/lib/ThreeDSecure.php index 5e67e351b..3869eba85 100644 --- a/lib/ThreeDSecure.php +++ b/lib/ThreeDSecure.php @@ -4,7 +4,6 @@ class ThreeDSecure extends ApiResource { - const OBJECT_NAME = "three_d_secure"; use ApiOperations\Create; diff --git a/lib/Token.php b/lib/Token.php index 989219fc7..629d51f68 100644 --- a/lib/Token.php +++ b/lib/Token.php @@ -19,7 +19,6 @@ */ class Token extends ApiResource { - const OBJECT_NAME = "token"; use ApiOperations\Create; diff --git a/lib/Topup.php b/lib/Topup.php index 9ad96670a..37625a329 100644 --- a/lib/Topup.php +++ b/lib/Topup.php @@ -26,7 +26,6 @@ */ class Topup extends ApiResource { - const OBJECT_NAME = "topup"; use ApiOperations\All; diff --git a/lib/Transfer.php b/lib/Transfer.php index dff2faa33..bf9fa25ce 100644 --- a/lib/Transfer.php +++ b/lib/Transfer.php @@ -27,7 +27,6 @@ */ class Transfer extends ApiResource { - const OBJECT_NAME = "transfer"; use ApiOperations\All; diff --git a/lib/TransferReversal.php b/lib/TransferReversal.php index c945e5a93..a4f94f2fb 100644 --- a/lib/TransferReversal.php +++ b/lib/TransferReversal.php @@ -20,7 +20,6 @@ */ class TransferReversal extends ApiResource { - const OBJECT_NAME = "transfer_reversal"; use ApiOperations\Update { diff --git a/lib/UsageRecord.php b/lib/UsageRecord.php index a9e3a25e3..1239222d4 100644 --- a/lib/UsageRecord.php +++ b/lib/UsageRecord.php @@ -16,7 +16,6 @@ */ class UsageRecord extends ApiResource { - const OBJECT_NAME = "usage_record"; /** diff --git a/lib/UsageRecordSummary.php b/lib/UsageRecordSummary.php index b8f4aebe9..9d3e7a396 100644 --- a/lib/UsageRecordSummary.php +++ b/lib/UsageRecordSummary.php @@ -17,6 +17,5 @@ */ class UsageRecordSummary extends ApiResource { - const OBJECT_NAME = "usage_record_summary"; } diff --git a/lib/WebhookEndpoint.php b/lib/WebhookEndpoint.php index 27ecacf69..636c7e192 100644 --- a/lib/WebhookEndpoint.php +++ b/lib/WebhookEndpoint.php @@ -18,7 +18,6 @@ */ class WebhookEndpoint extends ApiResource { - const OBJECT_NAME = "webhook_endpoint"; use ApiOperations\All;