Skip to content

Commit

Permalink
Another batch of PHP-CS-Fixer rule updates (#872)
Browse files Browse the repository at this point in the history
* Enable dir_constant rule

* Enable include rule

* Enable binary_operator_spaces rule

* Enable blank_line_before_statement rule

* Enable phpdoc_no_package rule

* Remove custom configuration for phpdoc_types_order rule

* Enable phpdoc_annotation_without_dot rule

* Enable phpdoc_summary rule

* Enable single_quote rule

* Enable php_unit_strict rule
  • Loading branch information
ob-stripe authored Feb 12, 2020
1 parent 1e97224 commit b2aac10
Show file tree
Hide file tree
Showing 196 changed files with 2,257 additions and 2,303 deletions.
12 changes: 0 additions & 12 deletions .php_cs.dist
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,15 @@ return PhpCsFixer\Config::create()
'@PHPUnit57Migration:risky' => true,

// Diffs from @PhpCsFixer / @PhpCsFixer:risky
'binary_operator_spaces' => false,
'blank_line_before_statement' => false,
'concat_space' => [
'spacing' => 'one',
],
'dir_constant' => false,
'include' => false,
'ordered_class_elements' => false,
'php_unit_internal_class' => false,
'php_unit_strict' => false,
'php_unit_test_class_requires_covers' => false,
'phpdoc_align' => false,
'phpdoc_annotation_without_dot' => false,
'phpdoc_no_package' => false,
'phpdoc_summary' => false,
'phpdoc_types_order' => [
'null_adjustment' => 'always_last',
],
'protected_to_private' => false,
'self_accessor' => false,
'single_quote' => false,

// Should be included in @PhpCsFixer / @PhpCsFixer:risky according to doc, but need to be
// enabled manually for some reason.
Expand Down
2 changes: 1 addition & 1 deletion build.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env php
<?php
\chdir(\dirname(__FILE__));
\chdir(__DIR__);

$autoload = (int) $argv[1];
$returnStatus = null;
Expand Down
10 changes: 5 additions & 5 deletions examples/oauth.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

require('../init.php');
require '../init.php';

\Stripe\Stripe::setApiKey(\getenv('STRIPE_SECRET_KEY'));
\Stripe\Stripe::setClientId(\getenv('STRIPE_CLIENT_ID'));
Expand All @@ -15,7 +15,7 @@
'code' => $code,
]);
} catch (\Stripe\Exception\OAuth\OAuthErrorException $e) {
exit("Error: " . $e->getMessage());
exit('Error: ' . $e->getMessage());
}

$accountId = $resp->stripe_user_id;
Expand All @@ -27,7 +27,7 @@
$error = $_GET['error'];
$error_description = $_GET['error_description'];

echo "<p>Error: code=" . \htmlspecialchars($error, \ENT_QUOTES) . ", description=" . \htmlspecialchars($error_description, \ENT_QUOTES) . "</p>\n";
echo '<p>Error: code=' . \htmlspecialchars($error, \ENT_QUOTES) . ', description=' . \htmlspecialchars($error_description, \ENT_QUOTES) . "</p>\n";
echo "<p>Click <a href=\"?\">here</a> to restart the OAuth flow.</p>\n";
} elseif (isset($_GET['deauth'])) {
// Deauthorization request
Expand All @@ -38,10 +38,10 @@
'stripe_user_id' => $accountId,
]);
} catch (\Stripe\Exception\OAuth\OAuthErrorException $e) {
exit("Error: " . $e->getMessage());
exit('Error: ' . $e->getMessage());
}

echo "<p>Success! Account <code>" . \htmlspecialchars($accountId, \ENT_QUOTES) . "</code> is disconnected.</p>\n";
echo '<p>Success! Account <code>' . \htmlspecialchars($accountId, \ENT_QUOTES) . "</code> is disconnected.</p>\n";
echo "<p>Click <a href=\"?\">here</a> to restart the OAuth flow.</p>\n";
} else {
$url = \Stripe\OAuth::authorizeUrl([
Expand Down
260 changes: 130 additions & 130 deletions init.php
Original file line number Diff line number Diff line change
@@ -1,151 +1,151 @@
<?php

// Stripe singleton
require(\dirname(__FILE__) . '/lib/Stripe.php');
require __DIR__ . '/lib/Stripe.php';

// Utilities
require(\dirname(__FILE__) . '/lib/Util/CaseInsensitiveArray.php');
require(\dirname(__FILE__) . '/lib/Util/LoggerInterface.php');
require(\dirname(__FILE__) . '/lib/Util/DefaultLogger.php');
require(\dirname(__FILE__) . '/lib/Util/RandomGenerator.php');
require(\dirname(__FILE__) . '/lib/Util/RequestOptions.php');
require(\dirname(__FILE__) . '/lib/Util/Set.php');
require(\dirname(__FILE__) . '/lib/Util/Util.php');
require __DIR__ . '/lib/Util/CaseInsensitiveArray.php';
require __DIR__ . '/lib/Util/LoggerInterface.php';
require __DIR__ . '/lib/Util/DefaultLogger.php';
require __DIR__ . '/lib/Util/RandomGenerator.php';
require __DIR__ . '/lib/Util/RequestOptions.php';
require __DIR__ . '/lib/Util/Set.php';
require __DIR__ . '/lib/Util/Util.php';

// HttpClient
require(\dirname(__FILE__) . '/lib/HttpClient/ClientInterface.php');
require(\dirname(__FILE__) . '/lib/HttpClient/CurlClient.php');
require __DIR__ . '/lib/HttpClient/ClientInterface.php';
require __DIR__ . '/lib/HttpClient/CurlClient.php';

// Exceptions
require(\dirname(__FILE__) . '/lib/Exception/ExceptionInterface.php');
require(\dirname(__FILE__) . '/lib/Exception/ApiErrorException.php');
require(\dirname(__FILE__) . '/lib/Exception/ApiConnectionException.php');
require(\dirname(__FILE__) . '/lib/Exception/AuthenticationException.php');
require(\dirname(__FILE__) . '/lib/Exception/BadMethodCallException.php');
require(\dirname(__FILE__) . '/lib/Exception/CardException.php');
require(\dirname(__FILE__) . '/lib/Exception/IdempotencyException.php');
require(\dirname(__FILE__) . '/lib/Exception/InvalidArgumentException.php');
require(\dirname(__FILE__) . '/lib/Exception/InvalidRequestException.php');
require(\dirname(__FILE__) . '/lib/Exception/PermissionException.php');
require(\dirname(__FILE__) . '/lib/Exception/RateLimitException.php');
require(\dirname(__FILE__) . '/lib/Exception/SignatureVerificationException.php');
require(\dirname(__FILE__) . '/lib/Exception/UnexpectedValueException.php');
require(\dirname(__FILE__) . '/lib/Exception/UnknownApiErrorException.php');
require __DIR__ . '/lib/Exception/ExceptionInterface.php';
require __DIR__ . '/lib/Exception/ApiErrorException.php';
require __DIR__ . '/lib/Exception/ApiConnectionException.php';
require __DIR__ . '/lib/Exception/AuthenticationException.php';
require __DIR__ . '/lib/Exception/BadMethodCallException.php';
require __DIR__ . '/lib/Exception/CardException.php';
require __DIR__ . '/lib/Exception/IdempotencyException.php';
require __DIR__ . '/lib/Exception/InvalidArgumentException.php';
require __DIR__ . '/lib/Exception/InvalidRequestException.php';
require __DIR__ . '/lib/Exception/PermissionException.php';
require __DIR__ . '/lib/Exception/RateLimitException.php';
require __DIR__ . '/lib/Exception/SignatureVerificationException.php';
require __DIR__ . '/lib/Exception/UnexpectedValueException.php';
require __DIR__ . '/lib/Exception/UnknownApiErrorException.php';

// OAuth exceptions
require(\dirname(__FILE__) . '/lib/Exception/OAuth/ExceptionInterface.php');
require(\dirname(__FILE__) . '/lib/Exception/OAuth/OAuthErrorException.php');
require(\dirname(__FILE__) . '/lib/Exception/OAuth/InvalidClientException.php');
require(\dirname(__FILE__) . '/lib/Exception/OAuth/InvalidGrantException.php');
require(\dirname(__FILE__) . '/lib/Exception/OAuth/InvalidRequestException.php');
require(\dirname(__FILE__) . '/lib/Exception/OAuth/InvalidScopeException.php');
require(\dirname(__FILE__) . '/lib/Exception/OAuth/UnknownOAuthErrorException.php');
require(\dirname(__FILE__) . '/lib/Exception/OAuth/UnsupportedGrantTypeException.php');
require(\dirname(__FILE__) . '/lib/Exception/OAuth/UnsupportedResponseTypeException.php');
require __DIR__ . '/lib/Exception/OAuth/ExceptionInterface.php';
require __DIR__ . '/lib/Exception/OAuth/OAuthErrorException.php';
require __DIR__ . '/lib/Exception/OAuth/InvalidClientException.php';
require __DIR__ . '/lib/Exception/OAuth/InvalidGrantException.php';
require __DIR__ . '/lib/Exception/OAuth/InvalidRequestException.php';
require __DIR__ . '/lib/Exception/OAuth/InvalidScopeException.php';
require __DIR__ . '/lib/Exception/OAuth/UnknownOAuthErrorException.php';
require __DIR__ . '/lib/Exception/OAuth/UnsupportedGrantTypeException.php';
require __DIR__ . '/lib/Exception/OAuth/UnsupportedResponseTypeException.php';

// API operations
require(\dirname(__FILE__) . '/lib/ApiOperations/All.php');
require(\dirname(__FILE__) . '/lib/ApiOperations/Create.php');
require(\dirname(__FILE__) . '/lib/ApiOperations/Delete.php');
require(\dirname(__FILE__) . '/lib/ApiOperations/NestedResource.php');
require(\dirname(__FILE__) . '/lib/ApiOperations/Request.php');
require(\dirname(__FILE__) . '/lib/ApiOperations/Retrieve.php');
require(\dirname(__FILE__) . '/lib/ApiOperations/Update.php');
require __DIR__ . '/lib/ApiOperations/All.php';
require __DIR__ . '/lib/ApiOperations/Create.php';
require __DIR__ . '/lib/ApiOperations/Delete.php';
require __DIR__ . '/lib/ApiOperations/NestedResource.php';
require __DIR__ . '/lib/ApiOperations/Request.php';
require __DIR__ . '/lib/ApiOperations/Retrieve.php';
require __DIR__ . '/lib/ApiOperations/Update.php';

// Plumbing
require(\dirname(__FILE__) . '/lib/ApiResponse.php');
require(\dirname(__FILE__) . '/lib/RequestTelemetry.php');
require(\dirname(__FILE__) . '/lib/StripeObject.php');
require(\dirname(__FILE__) . '/lib/ApiRequestor.php');
require(\dirname(__FILE__) . '/lib/ApiResource.php');
require(\dirname(__FILE__) . '/lib/SingletonApiResource.php');
require __DIR__ . '/lib/ApiResponse.php';
require __DIR__ . '/lib/RequestTelemetry.php';
require __DIR__ . '/lib/StripeObject.php';
require __DIR__ . '/lib/ApiRequestor.php';
require __DIR__ . '/lib/ApiResource.php';
require __DIR__ . '/lib/SingletonApiResource.php';

// Stripe API Resources
require(\dirname(__FILE__) . '/lib/Account.php');
require(\dirname(__FILE__) . '/lib/AccountLink.php');
require(\dirname(__FILE__) . '/lib/AlipayAccount.php');
require(\dirname(__FILE__) . '/lib/ApplePayDomain.php');
require(\dirname(__FILE__) . '/lib/ApplicationFee.php');
require(\dirname(__FILE__) . '/lib/ApplicationFeeRefund.php');
require(\dirname(__FILE__) . '/lib/Balance.php');
require(\dirname(__FILE__) . '/lib/BalanceTransaction.php');
require(\dirname(__FILE__) . '/lib/BankAccount.php');
require(\dirname(__FILE__) . '/lib/BitcoinReceiver.php');
require(\dirname(__FILE__) . '/lib/BitcoinTransaction.php');
require(\dirname(__FILE__) . '/lib/Capability.php');
require(\dirname(__FILE__) . '/lib/Card.php');
require(\dirname(__FILE__) . '/lib/Charge.php');
require(\dirname(__FILE__) . '/lib/Checkout/Session.php');
require(\dirname(__FILE__) . '/lib/Collection.php');
require(\dirname(__FILE__) . '/lib/CountrySpec.php');
require(\dirname(__FILE__) . '/lib/Coupon.php');
require(\dirname(__FILE__) . '/lib/CreditNote.php');
require(\dirname(__FILE__) . '/lib/CreditNoteLineItem.php');
require(\dirname(__FILE__) . '/lib/Customer.php');
require(\dirname(__FILE__) . '/lib/CustomerBalanceTransaction.php');
require(\dirname(__FILE__) . '/lib/Discount.php');
require(\dirname(__FILE__) . '/lib/Dispute.php');
require(\dirname(__FILE__) . '/lib/EphemeralKey.php');
require(\dirname(__FILE__) . '/lib/ErrorObject.php');
require(\dirname(__FILE__) . '/lib/Event.php');
require(\dirname(__FILE__) . '/lib/ExchangeRate.php');
require(\dirname(__FILE__) . '/lib/File.php');
require(\dirname(__FILE__) . '/lib/FileLink.php');
require(\dirname(__FILE__) . '/lib/Invoice.php');
require(\dirname(__FILE__) . '/lib/InvoiceItem.php');
require(\dirname(__FILE__) . '/lib/InvoiceLineItem.php');
require(\dirname(__FILE__) . '/lib/Issuing/Authorization.php');
require(\dirname(__FILE__) . '/lib/Issuing/Card.php');
require(\dirname(__FILE__) . '/lib/Issuing/CardDetails.php');
require(\dirname(__FILE__) . '/lib/Issuing/Cardholder.php');
require(\dirname(__FILE__) . '/lib/Issuing/Dispute.php');
require(\dirname(__FILE__) . '/lib/Issuing/Transaction.php');
require(\dirname(__FILE__) . '/lib/LoginLink.php');
require(\dirname(__FILE__) . '/lib/Mandate.php');
require(\dirname(__FILE__) . '/lib/Order.php');
require(\dirname(__FILE__) . '/lib/OrderItem.php');
require(\dirname(__FILE__) . '/lib/OrderReturn.php');
require(\dirname(__FILE__) . '/lib/PaymentIntent.php');
require(\dirname(__FILE__) . '/lib/PaymentMethod.php');
require(\dirname(__FILE__) . '/lib/Payout.php');
require(\dirname(__FILE__) . '/lib/Person.php');
require(\dirname(__FILE__) . '/lib/Plan.php');
require(\dirname(__FILE__) . '/lib/Product.php');
require(\dirname(__FILE__) . '/lib/Radar/EarlyFraudWarning.php');
require(\dirname(__FILE__) . '/lib/Radar/ValueList.php');
require(\dirname(__FILE__) . '/lib/Radar/ValueListItem.php');
require(\dirname(__FILE__) . '/lib/Recipient.php');
require(\dirname(__FILE__) . '/lib/RecipientTransfer.php');
require(\dirname(__FILE__) . '/lib/Refund.php');
require(\dirname(__FILE__) . '/lib/Reporting/ReportRun.php');
require(\dirname(__FILE__) . '/lib/Reporting/ReportType.php');
require(\dirname(__FILE__) . '/lib/Review.php');
require(\dirname(__FILE__) . '/lib/SetupIntent.php');
require(\dirname(__FILE__) . '/lib/Sigma/ScheduledQueryRun.php');
require(\dirname(__FILE__) . '/lib/SKU.php');
require(\dirname(__FILE__) . '/lib/Source.php');
require(\dirname(__FILE__) . '/lib/SourceTransaction.php');
require(\dirname(__FILE__) . '/lib/Subscription.php');
require(\dirname(__FILE__) . '/lib/SubscriptionItem.php');
require(\dirname(__FILE__) . '/lib/SubscriptionSchedule.php');
require(\dirname(__FILE__) . '/lib/TaxId.php');
require(\dirname(__FILE__) . '/lib/TaxRate.php');
require(\dirname(__FILE__) . '/lib/Terminal/ConnectionToken.php');
require(\dirname(__FILE__) . '/lib/Terminal/Location.php');
require(\dirname(__FILE__) . '/lib/Terminal/Reader.php');
require(\dirname(__FILE__) . '/lib/ThreeDSecure.php');
require(\dirname(__FILE__) . '/lib/Token.php');
require(\dirname(__FILE__) . '/lib/Topup.php');
require(\dirname(__FILE__) . '/lib/Transfer.php');
require(\dirname(__FILE__) . '/lib/TransferReversal.php');
require(\dirname(__FILE__) . '/lib/UsageRecord.php');
require(\dirname(__FILE__) . '/lib/UsageRecordSummary.php');
require(\dirname(__FILE__) . '/lib/WebhookEndpoint.php');
require __DIR__ . '/lib/Account.php';
require __DIR__ . '/lib/AccountLink.php';
require __DIR__ . '/lib/AlipayAccount.php';
require __DIR__ . '/lib/ApplePayDomain.php';
require __DIR__ . '/lib/ApplicationFee.php';
require __DIR__ . '/lib/ApplicationFeeRefund.php';
require __DIR__ . '/lib/Balance.php';
require __DIR__ . '/lib/BalanceTransaction.php';
require __DIR__ . '/lib/BankAccount.php';
require __DIR__ . '/lib/BitcoinReceiver.php';
require __DIR__ . '/lib/BitcoinTransaction.php';
require __DIR__ . '/lib/Capability.php';
require __DIR__ . '/lib/Card.php';
require __DIR__ . '/lib/Charge.php';
require __DIR__ . '/lib/Checkout/Session.php';
require __DIR__ . '/lib/Collection.php';
require __DIR__ . '/lib/CountrySpec.php';
require __DIR__ . '/lib/Coupon.php';
require __DIR__ . '/lib/CreditNote.php';
require __DIR__ . '/lib/CreditNoteLineItem.php';
require __DIR__ . '/lib/Customer.php';
require __DIR__ . '/lib/CustomerBalanceTransaction.php';
require __DIR__ . '/lib/Discount.php';
require __DIR__ . '/lib/Dispute.php';
require __DIR__ . '/lib/EphemeralKey.php';
require __DIR__ . '/lib/ErrorObject.php';
require __DIR__ . '/lib/Event.php';
require __DIR__ . '/lib/ExchangeRate.php';
require __DIR__ . '/lib/File.php';
require __DIR__ . '/lib/FileLink.php';
require __DIR__ . '/lib/Invoice.php';
require __DIR__ . '/lib/InvoiceItem.php';
require __DIR__ . '/lib/InvoiceLineItem.php';
require __DIR__ . '/lib/Issuing/Authorization.php';
require __DIR__ . '/lib/Issuing/Card.php';
require __DIR__ . '/lib/Issuing/CardDetails.php';
require __DIR__ . '/lib/Issuing/Cardholder.php';
require __DIR__ . '/lib/Issuing/Dispute.php';
require __DIR__ . '/lib/Issuing/Transaction.php';
require __DIR__ . '/lib/LoginLink.php';
require __DIR__ . '/lib/Mandate.php';
require __DIR__ . '/lib/Order.php';
require __DIR__ . '/lib/OrderItem.php';
require __DIR__ . '/lib/OrderReturn.php';
require __DIR__ . '/lib/PaymentIntent.php';
require __DIR__ . '/lib/PaymentMethod.php';
require __DIR__ . '/lib/Payout.php';
require __DIR__ . '/lib/Person.php';
require __DIR__ . '/lib/Plan.php';
require __DIR__ . '/lib/Product.php';
require __DIR__ . '/lib/Radar/EarlyFraudWarning.php';
require __DIR__ . '/lib/Radar/ValueList.php';
require __DIR__ . '/lib/Radar/ValueListItem.php';
require __DIR__ . '/lib/Recipient.php';
require __DIR__ . '/lib/RecipientTransfer.php';
require __DIR__ . '/lib/Refund.php';
require __DIR__ . '/lib/Reporting/ReportRun.php';
require __DIR__ . '/lib/Reporting/ReportType.php';
require __DIR__ . '/lib/Review.php';
require __DIR__ . '/lib/SetupIntent.php';
require __DIR__ . '/lib/Sigma/ScheduledQueryRun.php';
require __DIR__ . '/lib/SKU.php';
require __DIR__ . '/lib/Source.php';
require __DIR__ . '/lib/SourceTransaction.php';
require __DIR__ . '/lib/Subscription.php';
require __DIR__ . '/lib/SubscriptionItem.php';
require __DIR__ . '/lib/SubscriptionSchedule.php';
require __DIR__ . '/lib/TaxId.php';
require __DIR__ . '/lib/TaxRate.php';
require __DIR__ . '/lib/Terminal/ConnectionToken.php';
require __DIR__ . '/lib/Terminal/Location.php';
require __DIR__ . '/lib/Terminal/Reader.php';
require __DIR__ . '/lib/ThreeDSecure.php';
require __DIR__ . '/lib/Token.php';
require __DIR__ . '/lib/Topup.php';
require __DIR__ . '/lib/Transfer.php';
require __DIR__ . '/lib/TransferReversal.php';
require __DIR__ . '/lib/UsageRecord.php';
require __DIR__ . '/lib/UsageRecordSummary.php';
require __DIR__ . '/lib/WebhookEndpoint.php';

// OAuth
require(\dirname(__FILE__) . '/lib/OAuth.php');
require(\dirname(__FILE__) . '/lib/OAuthErrorObject.php');
require __DIR__ . '/lib/OAuth.php';
require __DIR__ . '/lib/OAuthErrorObject.php';

// Webhooks
require(\dirname(__FILE__) . '/lib/Webhook.php');
require(\dirname(__FILE__) . '/lib/WebhookSignature.php');
require __DIR__ . '/lib/Webhook.php';
require __DIR__ . '/lib/WebhookSignature.php';
Loading

0 comments on commit b2aac10

Please sign in to comment.