diff --git a/src/Contracts/HttpAdapterContract.php b/src/Contracts/HttpAdapterContract.php index 9fae6456..d8ef4b8b 100644 --- a/src/Contracts/HttpAdapterContract.php +++ b/src/Contracts/HttpAdapterContract.php @@ -2,9 +2,9 @@ namespace Mollie\Api\Contracts; -use Mollie\Api\Utils\Factories; use Mollie\Api\Http\PendingRequest; use Mollie\Api\Http\Response; +use Mollie\Api\Utils\Factories; interface HttpAdapterContract { diff --git a/src/EndpointCollection/BalanceEndpointCollection.php b/src/EndpointCollection/BalanceEndpointCollection.php index 71eea665..39030d7d 100644 --- a/src/EndpointCollection/BalanceEndpointCollection.php +++ b/src/EndpointCollection/BalanceEndpointCollection.php @@ -4,12 +4,12 @@ use Mollie\Api\Exceptions\ApiException; use Mollie\Api\Factories\GetPaginatedBalanceQueryFactory; -use Mollie\Api\Utils\Utility; use Mollie\Api\Http\Requests\GetBalanceRequest; use Mollie\Api\Http\Requests\GetPaginatedBalanceRequest; use Mollie\Api\Resources\Balance; use Mollie\Api\Resources\BalanceCollection; use Mollie\Api\Resources\LazyCollection; +use Mollie\Api\Utils\Utility; class BalanceEndpointCollection extends EndpointCollection { diff --git a/src/EndpointCollection/BalanceReportEndpointCollection.php b/src/EndpointCollection/BalanceReportEndpointCollection.php index 4985d9d4..7abe127e 100644 --- a/src/EndpointCollection/BalanceReportEndpointCollection.php +++ b/src/EndpointCollection/BalanceReportEndpointCollection.php @@ -3,11 +3,11 @@ namespace Mollie\Api\EndpointCollection; use Mollie\Api\Factories\GetBalanceReportQueryFactory; -use Mollie\Api\Utils\Utility; use Mollie\Api\Http\Data\GetBalanceReportQuery; use Mollie\Api\Http\Requests\GetBalanceReportRequest; use Mollie\Api\Resources\Balance; use Mollie\Api\Resources\BalanceReport; +use Mollie\Api\Utils\Utility; class BalanceReportEndpointCollection extends EndpointCollection { diff --git a/src/EndpointCollection/ChargebackEndpointCollection.php b/src/EndpointCollection/ChargebackEndpointCollection.php index ee68dc2e..4db3798b 100644 --- a/src/EndpointCollection/ChargebackEndpointCollection.php +++ b/src/EndpointCollection/ChargebackEndpointCollection.php @@ -4,10 +4,10 @@ use Mollie\Api\Exceptions\ApiException; use Mollie\Api\Factories\GetPaginatedChargebackQueryFactory; -use Mollie\Api\Utils\Utility; use Mollie\Api\Http\Requests\GetPaginatedChargebacksRequest; use Mollie\Api\Resources\ChargebackCollection; use Mollie\Api\Resources\LazyCollection; +use Mollie\Api\Utils\Utility; class ChargebackEndpointCollection extends EndpointCollection { diff --git a/src/EndpointCollection/CustomerEndpointCollection.php b/src/EndpointCollection/CustomerEndpointCollection.php index d97b51e7..cb6168f8 100644 --- a/src/EndpointCollection/CustomerEndpointCollection.php +++ b/src/EndpointCollection/CustomerEndpointCollection.php @@ -6,7 +6,6 @@ use Mollie\Api\Factories\CreateCustomerPayloadFactory; use Mollie\Api\Factories\PaginatedQueryFactory; use Mollie\Api\Factories\UpdateCustomerPayloadFactory; -use Mollie\Api\Utils\Utility; use Mollie\Api\Http\Data\CreateCustomerPayload; use Mollie\Api\Http\Data\UpdateCustomerPayload; use Mollie\Api\Http\Requests\CreateCustomerRequest; @@ -17,6 +16,7 @@ use Mollie\Api\Resources\Customer; use Mollie\Api\Resources\CustomerCollection; use Mollie\Api\Resources\LazyCollection; +use Mollie\Api\Utils\Utility; class CustomerEndpointCollection extends EndpointCollection { diff --git a/src/EndpointCollection/CustomerPaymentsEndpointCollection.php b/src/EndpointCollection/CustomerPaymentsEndpointCollection.php index 67038c35..a602c29e 100644 --- a/src/EndpointCollection/CustomerPaymentsEndpointCollection.php +++ b/src/EndpointCollection/CustomerPaymentsEndpointCollection.php @@ -5,8 +5,6 @@ use Mollie\Api\Exceptions\ApiException; use Mollie\Api\Factories\CreatePaymentPayloadFactory; use Mollie\Api\Factories\GetPaginatedCustomerPaymentsQueryFactory; -use Mollie\Api\Utils\Utility; -use Mollie\Api\Utils\Arr; use Mollie\Api\Http\Data\CreatePaymentPayload; use Mollie\Api\Http\Data\CreatePaymentQuery; use Mollie\Api\Http\Requests\CreateCustomerPaymentRequest; @@ -15,6 +13,8 @@ use Mollie\Api\Resources\LazyCollection; use Mollie\Api\Resources\Payment; use Mollie\Api\Resources\PaymentCollection; +use Mollie\Api\Utils\Arr; +use Mollie\Api\Utils\Utility; class CustomerPaymentsEndpointCollection extends EndpointCollection { diff --git a/src/EndpointCollection/MandateEndpointCollection.php b/src/EndpointCollection/MandateEndpointCollection.php index 8d8b8190..89572be6 100644 --- a/src/EndpointCollection/MandateEndpointCollection.php +++ b/src/EndpointCollection/MandateEndpointCollection.php @@ -5,7 +5,6 @@ use Mollie\Api\Exceptions\ApiException; use Mollie\Api\Factories\CreateMandatePayloadFactory; use Mollie\Api\Factories\PaginatedQueryFactory; -use Mollie\Api\Utils\Utility; use Mollie\Api\Http\Data\CreateMandatePayload; use Mollie\Api\Http\Requests\CreateMandateRequest; use Mollie\Api\Http\Requests\GetMandateRequest; @@ -15,6 +14,7 @@ use Mollie\Api\Resources\LazyCollection; use Mollie\Api\Resources\Mandate; use Mollie\Api\Resources\MandateCollection; +use Mollie\Api\Utils\Utility; class MandateEndpointCollection extends EndpointCollection { diff --git a/src/EndpointCollection/MethodEndpointCollection.php b/src/EndpointCollection/MethodEndpointCollection.php index d08cb965..41fb5de7 100644 --- a/src/EndpointCollection/MethodEndpointCollection.php +++ b/src/EndpointCollection/MethodEndpointCollection.php @@ -6,7 +6,6 @@ use Mollie\Api\Factories\GetAllPaymentMethodsQueryFactory; use Mollie\Api\Factories\GetEnabledPaymentMethodsQueryFactory; use Mollie\Api\Factories\GetPaymentMethodQueryFactory; -use Mollie\Api\Utils\Utility; use Mollie\Api\Http\Data\GetAllMethodsQuery as GetAllPaymentMethodsQuery; use Mollie\Api\Http\Data\GetEnabledPaymentMethodsQuery; use Mollie\Api\Http\Data\GetPaymentMethodQuery; @@ -15,6 +14,7 @@ use Mollie\Api\Http\Requests\GetPaymentMethodRequest; use Mollie\Api\Resources\Method; use Mollie\Api\Resources\MethodCollection; +use Mollie\Api\Utils\Utility; class MethodEndpointCollection extends EndpointCollection { diff --git a/src/EndpointCollection/OrganizationEndpointCollection.php b/src/EndpointCollection/OrganizationEndpointCollection.php index 961ee16f..28432b71 100644 --- a/src/EndpointCollection/OrganizationEndpointCollection.php +++ b/src/EndpointCollection/OrganizationEndpointCollection.php @@ -3,11 +3,11 @@ namespace Mollie\Api\EndpointCollection; use Mollie\Api\Exceptions\ApiException; -use Mollie\Api\Utils\Utility; use Mollie\Api\Http\Requests\GetOrganizationPartnerStatusRequest; use Mollie\Api\Http\Requests\GetOrganizationRequest; use Mollie\Api\Resources\Organization; use Mollie\Api\Resources\Partner; +use Mollie\Api\Utils\Utility; class OrganizationEndpointCollection extends EndpointCollection { diff --git a/src/EndpointCollection/PaymentCaptureEndpointCollection.php b/src/EndpointCollection/PaymentCaptureEndpointCollection.php index 1b9a5265..613e90d7 100644 --- a/src/EndpointCollection/PaymentCaptureEndpointCollection.php +++ b/src/EndpointCollection/PaymentCaptureEndpointCollection.php @@ -6,7 +6,6 @@ use Mollie\Api\Factories\CreatePaymentCapturePayloadFactory; use Mollie\Api\Factories\GetPaginatedPaymentCapturesQueryFactory; use Mollie\Api\Factories\GetPaymentCaptureQueryFactory; -use Mollie\Api\Utils\Utility; use Mollie\Api\Http\Data\CreatePaymentCapturePayload; use Mollie\Api\Http\Data\GetPaginatedPaymentCapturesQuery; use Mollie\Api\Http\Data\GetPaymentCaptureQuery; @@ -17,6 +16,7 @@ use Mollie\Api\Resources\CaptureCollection; use Mollie\Api\Resources\LazyCollection; use Mollie\Api\Resources\Payment; +use Mollie\Api\Utils\Utility; class PaymentCaptureEndpointCollection extends EndpointCollection { diff --git a/src/EndpointCollection/PaymentChargebackEndpointCollection.php b/src/EndpointCollection/PaymentChargebackEndpointCollection.php index 174df4e9..fd6bbcd9 100644 --- a/src/EndpointCollection/PaymentChargebackEndpointCollection.php +++ b/src/EndpointCollection/PaymentChargebackEndpointCollection.php @@ -5,7 +5,6 @@ use Mollie\Api\Exceptions\ApiException; use Mollie\Api\Factories\GetPaginatedPaymentChargebacksQueryFactory; use Mollie\Api\Factories\GetPaymentChargebackQueryFactory; -use Mollie\Api\Utils\Utility; use Mollie\Api\Http\Data\GetPaginatedPaymentChargebacksQuery; use Mollie\Api\Http\Data\GetPaymentChargebackQuery; use Mollie\Api\Http\Requests\GetPaginatedPaymentChargebacksRequest; @@ -14,6 +13,7 @@ use Mollie\Api\Resources\ChargebackCollection; use Mollie\Api\Resources\LazyCollection; use Mollie\Api\Resources\Payment; +use Mollie\Api\Utils\Utility; class PaymentChargebackEndpointCollection extends EndpointCollection { diff --git a/src/EndpointCollection/PaymentEndpointCollection.php b/src/EndpointCollection/PaymentEndpointCollection.php index 03a324ec..9926833b 100644 --- a/src/EndpointCollection/PaymentEndpointCollection.php +++ b/src/EndpointCollection/PaymentEndpointCollection.php @@ -8,8 +8,6 @@ use Mollie\Api\Factories\GetPaymentQueryFactory; use Mollie\Api\Factories\SortablePaginatedQueryFactory; use Mollie\Api\Factories\UpdatePaymentPayloadFactory; -use Mollie\Api\Utils\Utility; -use Mollie\Api\Utils\Arr; use Mollie\Api\Http\Data\CreatePaymentPayload; use Mollie\Api\Http\Data\CreatePaymentQuery; use Mollie\Api\Http\Data\CreateRefundPaymentPayload; @@ -25,6 +23,8 @@ use Mollie\Api\Resources\Payment; use Mollie\Api\Resources\PaymentCollection; use Mollie\Api\Resources\Refund; +use Mollie\Api\Utils\Arr; +use Mollie\Api\Utils\Utility; class PaymentEndpointCollection extends EndpointCollection { diff --git a/src/EndpointCollection/PaymentLinkEndpointCollection.php b/src/EndpointCollection/PaymentLinkEndpointCollection.php index 7674ff48..a6afb524 100644 --- a/src/EndpointCollection/PaymentLinkEndpointCollection.php +++ b/src/EndpointCollection/PaymentLinkEndpointCollection.php @@ -6,7 +6,6 @@ use Mollie\Api\Factories\CreatePaymentLinkPayloadFactory; use Mollie\Api\Factories\PaginatedQueryFactory; use Mollie\Api\Factories\UpdatePaymentLinkPayloadFactory; -use Mollie\Api\Utils\Utility; use Mollie\Api\Http\Data\CreatePaymentLinkPayload; use Mollie\Api\Http\Data\UpdatePaymentLinkPayload; use Mollie\Api\Http\Requests\CreatePaymentLinkRequest; @@ -17,6 +16,7 @@ use Mollie\Api\Resources\LazyCollection; use Mollie\Api\Resources\PaymentLink; use Mollie\Api\Resources\PaymentLinkCollection; +use Mollie\Api\Utils\Utility; class PaymentLinkEndpointCollection extends EndpointCollection { diff --git a/src/EndpointCollection/PaymentLinkPaymentEndpointCollection.php b/src/EndpointCollection/PaymentLinkPaymentEndpointCollection.php index e0b726d1..dbe1c4c7 100644 --- a/src/EndpointCollection/PaymentLinkPaymentEndpointCollection.php +++ b/src/EndpointCollection/PaymentLinkPaymentEndpointCollection.php @@ -4,12 +4,12 @@ use Mollie\Api\Exceptions\ApiException; use Mollie\Api\Factories\SortablePaginatedQueryFactory; -use Mollie\Api\Utils\Utility; use Mollie\Api\Http\Requests\GetPaginatedPaymentLinkPaymentsRequest; use Mollie\Api\Resources\LazyCollection; use Mollie\Api\Resources\Payment; use Mollie\Api\Resources\PaymentCollection; use Mollie\Api\Resources\PaymentLink; +use Mollie\Api\Utils\Utility; class PaymentLinkPaymentEndpointCollection extends EndpointCollection { diff --git a/src/EndpointCollection/PaymentRefundEndpointCollection.php b/src/EndpointCollection/PaymentRefundEndpointCollection.php index 77e956cb..75ac14e4 100644 --- a/src/EndpointCollection/PaymentRefundEndpointCollection.php +++ b/src/EndpointCollection/PaymentRefundEndpointCollection.php @@ -5,7 +5,6 @@ use Mollie\Api\Factories\CreateRefundPaymentPayloadFactory; use Mollie\Api\Factories\GetPaginatedPaymentRefundQueryFactory; use Mollie\Api\Factories\GetPaymentRefundQueryFactory; -use Mollie\Api\Utils\Utility; use Mollie\Api\Http\Data\CreateRefundPaymentPayload; use Mollie\Api\Http\Data\GetPaymentRefundQuery; use Mollie\Api\Http\Requests\CancelPaymentRefundRequest; @@ -16,6 +15,7 @@ use Mollie\Api\Resources\Payment; use Mollie\Api\Resources\Refund; use Mollie\Api\Resources\RefundCollection; +use Mollie\Api\Utils\Utility; class PaymentRefundEndpointCollection extends EndpointCollection { diff --git a/src/EndpointCollection/PermissionEndpointCollection.php b/src/EndpointCollection/PermissionEndpointCollection.php index 07e1d597..c3672ae3 100644 --- a/src/EndpointCollection/PermissionEndpointCollection.php +++ b/src/EndpointCollection/PermissionEndpointCollection.php @@ -3,11 +3,11 @@ namespace Mollie\Api\EndpointCollection; use Mollie\Api\Exceptions\ApiException; -use Mollie\Api\Utils\Utility; use Mollie\Api\Http\Requests\GetPermissionRequest; use Mollie\Api\Http\Requests\ListPermissionsRequest; use Mollie\Api\Resources\Permission; use Mollie\Api\Resources\PermissionCollection; +use Mollie\Api\Utils\Utility; class PermissionEndpointCollection extends EndpointCollection { diff --git a/src/EndpointCollection/ProfileEndpointCollection.php b/src/EndpointCollection/ProfileEndpointCollection.php index 3f110d2a..a7045676 100644 --- a/src/EndpointCollection/ProfileEndpointCollection.php +++ b/src/EndpointCollection/ProfileEndpointCollection.php @@ -6,7 +6,6 @@ use Mollie\Api\Factories\CreateProfilePayloadFactory; use Mollie\Api\Factories\PaginatedQueryFactory; use Mollie\Api\Factories\UpdateProfilePayloadFactory; -use Mollie\Api\Utils\Utility; use Mollie\Api\Http\Data\CreateProfilePayload; use Mollie\Api\Http\Data\UpdateProfilePayload; use Mollie\Api\Http\Requests\CreateProfileRequest; @@ -18,6 +17,7 @@ use Mollie\Api\Resources\LazyCollection; use Mollie\Api\Resources\Profile; use Mollie\Api\Resources\ProfileCollection; +use Mollie\Api\Utils\Utility; class ProfileEndpointCollection extends EndpointCollection { diff --git a/src/EndpointCollection/RefundEndpointCollection.php b/src/EndpointCollection/RefundEndpointCollection.php index 9e635191..2cfa43a2 100644 --- a/src/EndpointCollection/RefundEndpointCollection.php +++ b/src/EndpointCollection/RefundEndpointCollection.php @@ -4,10 +4,10 @@ use Mollie\Api\Exceptions\ApiException; use Mollie\Api\Factories\GetPaginatedRefundsQueryFactory; -use Mollie\Api\Utils\Utility; use Mollie\Api\Http\Requests\GetPaginatedRefundsRequest; use Mollie\Api\Resources\LazyCollection; use Mollie\Api\Resources\RefundCollection; +use Mollie\Api\Utils\Utility; class RefundEndpointCollection extends EndpointCollection { diff --git a/src/EndpointCollection/SettlementCaptureEndpointCollection.php b/src/EndpointCollection/SettlementCaptureEndpointCollection.php index c6fc3d3d..aea502db 100644 --- a/src/EndpointCollection/SettlementCaptureEndpointCollection.php +++ b/src/EndpointCollection/SettlementCaptureEndpointCollection.php @@ -4,12 +4,12 @@ use Mollie\Api\Exceptions\ApiException; use Mollie\Api\Factories\GetPaginatedSettlementCapturesQueryFactory; -use Mollie\Api\Utils\Utility; use Mollie\Api\Http\Data\GetPaginatedSettlementCapturesQuery; use Mollie\Api\Http\Requests\GetPaginatedSettlementCapturesRequest; use Mollie\Api\Resources\CaptureCollection; use Mollie\Api\Resources\LazyCollection; use Mollie\Api\Resources\Settlement; +use Mollie\Api\Utils\Utility; class SettlementCaptureEndpointCollection extends EndpointCollection { diff --git a/src/EndpointCollection/SettlementChargebackEndpointCollection.php b/src/EndpointCollection/SettlementChargebackEndpointCollection.php index 85e45536..78651f22 100644 --- a/src/EndpointCollection/SettlementChargebackEndpointCollection.php +++ b/src/EndpointCollection/SettlementChargebackEndpointCollection.php @@ -4,12 +4,12 @@ use Mollie\Api\Exceptions\ApiException; use Mollie\Api\Factories\GetPaginatedSettlementChargebacksQueryFactory; -use Mollie\Api\Utils\Utility; use Mollie\Api\Http\Data\GetPaginatedSettlementChargebacksQuery; use Mollie\Api\Http\Requests\GetPaginatedSettlementChargebacksRequest; use Mollie\Api\Resources\ChargebackCollection; use Mollie\Api\Resources\LazyCollection; use Mollie\Api\Resources\Settlement; +use Mollie\Api\Utils\Utility; class SettlementChargebackEndpointCollection extends EndpointCollection { diff --git a/src/EndpointCollection/SettlementPaymentEndpointCollection.php b/src/EndpointCollection/SettlementPaymentEndpointCollection.php index 8c87d48a..f5866b2f 100644 --- a/src/EndpointCollection/SettlementPaymentEndpointCollection.php +++ b/src/EndpointCollection/SettlementPaymentEndpointCollection.php @@ -4,12 +4,12 @@ use Mollie\Api\Exceptions\ApiException; use Mollie\Api\Factories\SortablePaginatedQueryFactory; -use Mollie\Api\Utils\Utility; use Mollie\Api\Http\Data\SortablePaginatedQuery; use Mollie\Api\Http\Requests\GetPaginatedSettlementPaymentsRequest; use Mollie\Api\Resources\LazyCollection; use Mollie\Api\Resources\PaymentCollection; use Mollie\Api\Resources\Settlement; +use Mollie\Api\Utils\Utility; class SettlementPaymentEndpointCollection extends EndpointCollection { diff --git a/src/EndpointCollection/SettlementRefundEndpointCollection.php b/src/EndpointCollection/SettlementRefundEndpointCollection.php index cb4974b8..26368fa8 100644 --- a/src/EndpointCollection/SettlementRefundEndpointCollection.php +++ b/src/EndpointCollection/SettlementRefundEndpointCollection.php @@ -4,12 +4,12 @@ use Mollie\Api\Exceptions\ApiException; use Mollie\Api\Factories\GetPaginatedSettlementRefundsQueryFactory; -use Mollie\Api\Utils\Utility; use Mollie\Api\Http\Data\GetPaginatedSettlementRefundsQuery; use Mollie\Api\Http\Requests\GetPaginatedSettlementRefundsRequest; use Mollie\Api\Resources\LazyCollection; use Mollie\Api\Resources\RefundCollection; use Mollie\Api\Resources\Settlement; +use Mollie\Api\Utils\Utility; class SettlementRefundEndpointCollection extends EndpointCollection { diff --git a/src/EndpointCollection/SubscriptionEndpointCollection.php b/src/EndpointCollection/SubscriptionEndpointCollection.php index 5afb7d84..c73d19a9 100644 --- a/src/EndpointCollection/SubscriptionEndpointCollection.php +++ b/src/EndpointCollection/SubscriptionEndpointCollection.php @@ -7,7 +7,6 @@ use Mollie\Api\Factories\GetAllPaginatedSubscriptionsQueryFactory; use Mollie\Api\Factories\PaginatedQueryFactory; use Mollie\Api\Factories\UpdateSubscriptionPayloadFactory; -use Mollie\Api\Utils\Utility; use Mollie\Api\Http\Data\CreateSubscriptionPayload; use Mollie\Api\Http\Data\UpdateSubscriptionPayload; use Mollie\Api\Http\Requests\CancelSubscriptionRequest; @@ -20,6 +19,7 @@ use Mollie\Api\Resources\LazyCollection; use Mollie\Api\Resources\Subscription; use Mollie\Api\Resources\SubscriptionCollection; +use Mollie\Api\Utils\Utility; class SubscriptionEndpointCollection extends EndpointCollection { diff --git a/src/EndpointCollection/SubscriptionPaymentEndpointCollection.php b/src/EndpointCollection/SubscriptionPaymentEndpointCollection.php index 377fbfcb..d6bfd1e0 100644 --- a/src/EndpointCollection/SubscriptionPaymentEndpointCollection.php +++ b/src/EndpointCollection/SubscriptionPaymentEndpointCollection.php @@ -4,11 +4,11 @@ use Mollie\Api\Exceptions\ApiException; use Mollie\Api\Factories\PaginatedQueryFactory; -use Mollie\Api\Utils\Utility; use Mollie\Api\Http\Requests\GetPaginatedSubscriptionPaymentsRequest; use Mollie\Api\Resources\LazyCollection; use Mollie\Api\Resources\PaymentCollection; use Mollie\Api\Resources\Subscription; +use Mollie\Api\Utils\Utility; class SubscriptionPaymentEndpointCollection extends EndpointCollection { diff --git a/src/EndpointCollection/TerminalEndpointCollection.php b/src/EndpointCollection/TerminalEndpointCollection.php index 964fbd3a..fd3fdad2 100644 --- a/src/EndpointCollection/TerminalEndpointCollection.php +++ b/src/EndpointCollection/TerminalEndpointCollection.php @@ -4,12 +4,12 @@ use Mollie\Api\Exceptions\ApiException; use Mollie\Api\Factories\PaginatedQueryFactory; -use Mollie\Api\Utils\Utility; use Mollie\Api\Http\Requests\GetPaginatedTerminalsRequest; use Mollie\Api\Http\Requests\GetTerminalRequest; use Mollie\Api\Resources\LazyCollection; use Mollie\Api\Resources\Terminal; use Mollie\Api\Resources\TerminalCollection; +use Mollie\Api\Utils\Utility; class TerminalEndpointCollection extends EndpointCollection { diff --git a/src/Factories/CreatePaymentPayloadFactory.php b/src/Factories/CreatePaymentPayloadFactory.php index ee368bb1..c9aeaeca 100644 --- a/src/Factories/CreatePaymentPayloadFactory.php +++ b/src/Factories/CreatePaymentPayloadFactory.php @@ -2,10 +2,10 @@ namespace Mollie\Api\Factories; -use Mollie\Api\Utils\Utility; use Mollie\Api\Http\Data\Address; use Mollie\Api\Http\Data\CreatePaymentPayload; use Mollie\Api\Http\Data\Metadata; +use Mollie\Api\Utils\Utility; class CreatePaymentPayloadFactory extends Factory { diff --git a/src/Factories/Factory.php b/src/Factories/Factory.php index e97d28d3..0ac9262d 100644 --- a/src/Factories/Factory.php +++ b/src/Factories/Factory.php @@ -4,8 +4,8 @@ use Mollie\Api\Contracts\Arrayable; use Mollie\Api\Contracts\Factory as FactoryContract; -use Mollie\Api\Utils\Utility; use Mollie\Api\Utils\Arr; +use Mollie\Api\Utils\Utility; abstract class Factory implements FactoryContract { @@ -37,7 +37,7 @@ protected function get($key, $default = null, $backupKey = 'filters.') $keys = (array) $key; if ($backupKey !== null) { - $keys[] = $backupKey . $key; + $keys[] = $backupKey.$key; } foreach ($keys as $key) { @@ -60,7 +60,7 @@ protected function has($keys): bool */ protected function includes($key, $value, $backupKey = 'filters.'): bool { - return Arr::includes($this->data, [$backupKey . $key, $key], $value); + return Arr::includes($this->data, [$backupKey.$key, $key], $value); } /** diff --git a/src/Factories/PaymentRouteCollectionFactory.php b/src/Factories/PaymentRouteCollectionFactory.php index 4d83ee46..a430ae22 100644 --- a/src/Factories/PaymentRouteCollectionFactory.php +++ b/src/Factories/PaymentRouteCollectionFactory.php @@ -3,10 +3,10 @@ namespace Mollie\Api\Factories; use DateTimeImmutable; -use Mollie\Api\Utils\Utility; -use Mollie\Api\Utils\Arr; use Mollie\Api\Http\Data\DataCollection; use Mollie\Api\Http\Data\PaymentRoute; +use Mollie\Api\Utils\Arr; +use Mollie\Api\Utils\Utility; class PaymentRouteCollectionFactory extends Factory { diff --git a/src/Factories/RefundRouteCollectionFactory.php b/src/Factories/RefundRouteCollectionFactory.php index c56f9605..788cfa64 100644 --- a/src/Factories/RefundRouteCollectionFactory.php +++ b/src/Factories/RefundRouteCollectionFactory.php @@ -2,9 +2,9 @@ namespace Mollie\Api\Factories; -use Mollie\Api\Utils\Arr; use Mollie\Api\Http\Data\DataCollection; use Mollie\Api\Http\Data\RefundRoute; +use Mollie\Api\Utils\Arr; class RefundRouteCollectionFactory extends Factory { diff --git a/src/Factories/UpdatePaymentPayloadFactory.php b/src/Factories/UpdatePaymentPayloadFactory.php index 7a289d8b..7c3b2992 100644 --- a/src/Factories/UpdatePaymentPayloadFactory.php +++ b/src/Factories/UpdatePaymentPayloadFactory.php @@ -2,9 +2,9 @@ namespace Mollie\Api\Factories; -use Mollie\Api\Utils\Utility; use Mollie\Api\Http\Data\Metadata; use Mollie\Api\Http\Data\UpdatePaymentPayload; +use Mollie\Api\Utils\Utility; class UpdatePaymentPayloadFactory extends Factory { diff --git a/src/Http/Adapter/GuzzleMollieHttpAdapter.php b/src/Http/Adapter/GuzzleMollieHttpAdapter.php index 74ab5ee3..5500bbab 100644 --- a/src/Http/Adapter/GuzzleMollieHttpAdapter.php +++ b/src/Http/Adapter/GuzzleMollieHttpAdapter.php @@ -13,10 +13,10 @@ use Mollie\Api\Contracts\HttpAdapterContract; use Mollie\Api\Contracts\SupportsDebuggingContract; use Mollie\Api\Exceptions\ApiException; -use Mollie\Api\Utils\Factories; use Mollie\Api\Http\PendingRequest; use Mollie\Api\Http\Response; use Mollie\Api\Traits\IsDebuggableAdapter; +use Mollie\Api\Utils\Factories; use Psr\Http\Message\RequestInterface; use Psr\Http\Message\ResponseInterface; use Throwable; @@ -132,6 +132,6 @@ protected function createResponse( */ public function version(): string { - return 'Guzzle/' . ClientInterface::MAJOR_VERSION; + return 'Guzzle/'.ClientInterface::MAJOR_VERSION; } } diff --git a/src/Http/Adapter/PSR18MollieHttpAdapter.php b/src/Http/Adapter/PSR18MollieHttpAdapter.php index 9d23aac5..7e2f082c 100644 --- a/src/Http/Adapter/PSR18MollieHttpAdapter.php +++ b/src/Http/Adapter/PSR18MollieHttpAdapter.php @@ -5,10 +5,10 @@ use Mollie\Api\Contracts\HttpAdapterContract; use Mollie\Api\Contracts\SupportsDebuggingContract; use Mollie\Api\Exceptions\ApiException; -use Mollie\Api\Utils\Factories; use Mollie\Api\Http\PendingRequest; use Mollie\Api\Http\Response; use Mollie\Api\Traits\IsDebuggableAdapter; +use Mollie\Api\Utils\Factories; use Psr\Http\Client\ClientExceptionInterface; use Psr\Http\Client\ClientInterface; use Psr\Http\Message\RequestFactoryInterface; @@ -78,7 +78,7 @@ public function sendRequest(PendingRequest $pendingRequest): Response } throw new ApiException( - 'Error while sending request to Mollie API: ' . $e->getMessage(), + 'Error while sending request to Mollie API: '.$e->getMessage(), 0, $e, $request, diff --git a/src/Http/Data/GetClientQuery.php b/src/Http/Data/GetClientQuery.php index 13085b7a..804d7f0b 100644 --- a/src/Http/Data/GetClientQuery.php +++ b/src/Http/Data/GetClientQuery.php @@ -2,8 +2,8 @@ namespace Mollie\Api\Http\Data; -use Mollie\Api\Utils\Arr; use Mollie\Api\Types\ClientQuery; +use Mollie\Api\Utils\Arr; class GetClientQuery extends Data { diff --git a/src/Http/Data/GetEnabledPaymentMethodsQuery.php b/src/Http/Data/GetEnabledPaymentMethodsQuery.php index d979eeca..47ab4eb5 100644 --- a/src/Http/Data/GetEnabledPaymentMethodsQuery.php +++ b/src/Http/Data/GetEnabledPaymentMethodsQuery.php @@ -2,8 +2,8 @@ namespace Mollie\Api\Http\Data; -use Mollie\Api\Utils\Arr; use Mollie\Api\Types\MethodQuery; +use Mollie\Api\Utils\Arr; class GetEnabledPaymentMethodsQuery extends Data { diff --git a/src/Http/Data/GetPaginatedClientQuery.php b/src/Http/Data/GetPaginatedClientQuery.php index 36a0143b..1acc7213 100644 --- a/src/Http/Data/GetPaginatedClientQuery.php +++ b/src/Http/Data/GetPaginatedClientQuery.php @@ -2,8 +2,8 @@ namespace Mollie\Api\Http\Data; -use Mollie\Api\Utils\Arr; use Mollie\Api\Types\ClientQuery; +use Mollie\Api\Utils\Arr; class GetPaginatedClientQuery extends Data { diff --git a/src/Http/Data/GetPaginatedPaymentCapturesQuery.php b/src/Http/Data/GetPaginatedPaymentCapturesQuery.php index 9be1254e..1fe96696 100644 --- a/src/Http/Data/GetPaginatedPaymentCapturesQuery.php +++ b/src/Http/Data/GetPaginatedPaymentCapturesQuery.php @@ -2,8 +2,8 @@ namespace Mollie\Api\Http\Data; -use Mollie\Api\Utils\Arr; use Mollie\Api\Types\PaymentIncludesQuery; +use Mollie\Api\Utils\Arr; class GetPaginatedPaymentCapturesQuery extends Data { diff --git a/src/Http/Data/GetPaymentCaptureQuery.php b/src/Http/Data/GetPaymentCaptureQuery.php index 56058bcd..d4f4caeb 100644 --- a/src/Http/Data/GetPaymentCaptureQuery.php +++ b/src/Http/Data/GetPaymentCaptureQuery.php @@ -2,8 +2,8 @@ namespace Mollie\Api\Http\Data; -use Mollie\Api\Utils\Arr; use Mollie\Api\Types\PaymentIncludesQuery; +use Mollie\Api\Utils\Arr; class GetPaymentCaptureQuery extends Data { diff --git a/src/Http/Data/GetPaymentMethodQuery.php b/src/Http/Data/GetPaymentMethodQuery.php index 3dfa7d61..4d85fee2 100644 --- a/src/Http/Data/GetPaymentMethodQuery.php +++ b/src/Http/Data/GetPaymentMethodQuery.php @@ -2,8 +2,8 @@ namespace Mollie\Api\Http\Data; -use Mollie\Api\Utils\Arr; use Mollie\Api\Types\MethodQuery; +use Mollie\Api\Utils\Arr; class GetPaymentMethodQuery extends Data { diff --git a/src/Http/Data/GetPaymentQuery.php b/src/Http/Data/GetPaymentQuery.php index 725a03c4..cece7d96 100644 --- a/src/Http/Data/GetPaymentQuery.php +++ b/src/Http/Data/GetPaymentQuery.php @@ -2,8 +2,8 @@ namespace Mollie\Api\Http\Data; -use Mollie\Api\Utils\Arr; use Mollie\Api\Types\PaymentQuery; +use Mollie\Api\Utils\Arr; class GetPaymentQuery extends Data { diff --git a/src/Http/Middleware.php b/src/Http/Middleware.php index 200f4851..2d13ce95 100644 --- a/src/Http/Middleware.php +++ b/src/Http/Middleware.php @@ -5,8 +5,6 @@ use Mollie\Api\Contracts\ViableResponse; use Mollie\Api\Http\Middleware\Handlers; use Mollie\Api\Http\Middleware\MiddlewarePriority; -use Mollie\Api\Http\PendingRequest; -use Mollie\Api\Http\Response; class Middleware { diff --git a/src/Http/PendingRequest.php b/src/Http/PendingRequest.php index fa9784f9..de732551 100644 --- a/src/Http/PendingRequest.php +++ b/src/Http/PendingRequest.php @@ -7,12 +7,11 @@ use Mollie\Api\Contracts\PayloadRepository; use Mollie\Api\Contracts\SupportsTestmodeInPayload; use Mollie\Api\Contracts\SupportsTestmodeInQuery; -use Mollie\Api\Http\Middleware\MiddlewarePriority; -use Mollie\Api\Utils\Url; use Mollie\Api\Http\Middleware\ApplyIdempotencyKey; use Mollie\Api\Http\Middleware\EvaluateHydrationSetting; use Mollie\Api\Http\Middleware\GuardResponse; use Mollie\Api\Http\Middleware\Hydrate; +use Mollie\Api\Http\Middleware\MiddlewarePriority; use Mollie\Api\Http\Middleware\ResetIdempotencyKey; use Mollie\Api\Http\Middleware\ThrowExceptionIfRequestFailed; use Mollie\Api\Http\PendingRequest\AddTestmodeIfEnabled; @@ -24,6 +23,7 @@ use Mollie\Api\Traits\HasMiddleware; use Mollie\Api\Traits\HasRequestProperties; use Mollie\Api\Traits\ManagesPsrRequests; +use Mollie\Api\Utils\Url; class PendingRequest { diff --git a/src/Http/PendingRequest/SetUserAgent.php b/src/Http/PendingRequest/SetUserAgent.php index f821430a..55e34187 100644 --- a/src/Http/PendingRequest/SetUserAgent.php +++ b/src/Http/PendingRequest/SetUserAgent.php @@ -2,9 +2,9 @@ namespace Mollie\Api\Http\PendingRequest; -use Mollie\Api\Utils\Arr; use Mollie\Api\Http\Auth\AccessTokenAuthenticator; use Mollie\Api\Http\PendingRequest; +use Mollie\Api\Utils\Arr; class SetUserAgent { diff --git a/src/MollieApiClient.php b/src/MollieApiClient.php index 2ab0653d..d95f0858 100644 --- a/src/MollieApiClient.php +++ b/src/MollieApiClient.php @@ -43,7 +43,6 @@ use Mollie\Api\EndpointCollection\SubscriptionPaymentEndpointCollection; use Mollie\Api\EndpointCollection\TerminalEndpointCollection; use Mollie\Api\EndpointCollection\WalletEndpointCollection; -use Mollie\Api\Utils\Url; use Mollie\Api\Http\Adapter\MollieHttpAdapterPicker; use Mollie\Api\Idempotency\DefaultIdempotencyKeyGenerator; use Mollie\Api\Traits\HandlesAuthentication; @@ -57,6 +56,7 @@ use Mollie\Api\Traits\HasRequestProperties; use Mollie\Api\Traits\Initializable; use Mollie\Api\Traits\SendsRequests; +use Mollie\Api\Utils\Url; /** * @property BalanceEndpointCollection $balances diff --git a/src/Traits/Initializable.php b/src/Traits/Initializable.php index 74abba59..b4610978 100644 --- a/src/Traits/Initializable.php +++ b/src/Traits/Initializable.php @@ -12,7 +12,7 @@ protected function initializeTraits(): void foreach (Utility::classUsesRecursive(static::class) as $trait) { $trait = new ReflectionClass($trait); - $method = 'initialize' . $trait->getShortName(); + $method = 'initialize'.$trait->getShortName(); if (method_exists($this, $method)) { $this->{$method}(); diff --git a/src/Traits/ManagesPsrRequests.php b/src/Traits/ManagesPsrRequests.php index 35d16d92..3ed95bda 100644 --- a/src/Traits/ManagesPsrRequests.php +++ b/src/Traits/ManagesPsrRequests.php @@ -3,9 +3,9 @@ namespace Mollie\Api\Traits; use Mollie\Api\Contracts\PayloadRepository; +use Mollie\Api\Http\PendingRequest; use Mollie\Api\Utils\Factories; use Mollie\Api\Utils\Url; -use Mollie\Api\Http\PendingRequest; use Psr\Http\Message\RequestInterface; use Psr\Http\Message\UriInterface; diff --git a/src/Utils/Url.php b/src/Utils/Url.php index 5748408a..965f28a7 100644 --- a/src/Utils/Url.php +++ b/src/Utils/Url.php @@ -13,7 +13,7 @@ public static function join(string $baseUrl, string $endpoint): string return $endpoint; } - return rtrim($baseUrl, '/') . '/' . ltrim($endpoint, '/'); + return rtrim($baseUrl, '/').'/'.ltrim($endpoint, '/'); } /** diff --git a/src/Utils/Utility.php b/src/Utils/Utility.php index 0251b432..9176b5cb 100644 --- a/src/Utils/Utility.php +++ b/src/Utils/Utility.php @@ -2,7 +2,6 @@ namespace Mollie\Api\Utils; -use Mollie\Api\Utils\Arr; use ReflectionClass; use ReflectionProperty; @@ -69,13 +68,13 @@ public static function getProperties($class, $flag = ReflectionProperty::IS_PUBL public static function filterByProperties($class, array $array): array { $properties = array_map( - fn(ReflectionProperty $prop) => $prop->getName(), + fn (ReflectionProperty $prop) => $prop->getName(), static::getProperties($class) ); return array_filter( $array, - fn($key) => ! in_array($key, $properties, true), + fn ($key) => ! in_array($key, $properties, true), ARRAY_FILTER_USE_KEY ); } @@ -96,7 +95,7 @@ public static function compose($value, $composable, $default = null) } $composable = is_string($composable) - ? fn($value) => new $composable($value) + ? fn ($value) => new $composable($value) : $composable; return (bool) $value ? $composable($value) : $default; diff --git a/tests/Fixtures/MockResponse.php b/tests/Fixtures/MockResponse.php index 7b435277..7d2bde88 100644 --- a/tests/Fixtures/MockResponse.php +++ b/tests/Fixtures/MockResponse.php @@ -2,8 +2,8 @@ namespace Tests\Fixtures; -use Mollie\Api\Utils\Arr; use Mollie\Api\Traits\HasDefaultFactories; +use Mollie\Api\Utils\Arr; use PHPUnit\Framework\Assert; use Psr\Http\Message\ResponseInterface; @@ -55,7 +55,7 @@ public function body(): string $path = Arr::join([ __DIR__, 'Responses', - $body . '.json', + $body.'.json', ], DIRECTORY_SEPARATOR); $contents = file_get_contents($path); diff --git a/tests/Http/Adapter/MockMollieHttpAdapter.php b/tests/Http/Adapter/MockMollieHttpAdapter.php index 62c4f7e6..4047db07 100644 --- a/tests/Http/Adapter/MockMollieHttpAdapter.php +++ b/tests/Http/Adapter/MockMollieHttpAdapter.php @@ -3,10 +3,10 @@ namespace Tests\Http\Adapter; use Mollie\Api\Contracts\HttpAdapterContract; -use Mollie\Api\Utils\Arr; use Mollie\Api\Http\PendingRequest; use Mollie\Api\Http\Response; use Mollie\Api\Traits\HasDefaultFactories; +use Mollie\Api\Utils\Arr; use PHPUnit\Framework\Assert as PHPUnit; use Tests\Fixtures\MockResponse; use Tests\Fixtures\SequenceMockResponse; @@ -52,7 +52,7 @@ public function sendRequest(PendingRequest $pendingRequest): Response private function guardAgainstStrayRequests(string $requestClass): void { if (! Arr::has($this->expected, $requestClass)) { - throw new \RuntimeException('The request class ' . $requestClass . ' is not expected.'); + throw new \RuntimeException('The request class '.$requestClass.' is not expected.'); } } @@ -84,7 +84,7 @@ public function recorded(?callable $callback = null): array return $this->recorded; } - return array_filter($this->recorded, fn($recorded) => $callback($recorded[0], $recorded[1])); + return array_filter($this->recorded, fn ($recorded) => $callback($recorded[0], $recorded[1])); } /** @@ -93,7 +93,7 @@ public function recorded(?callable $callback = null): array public function assertSent($callback): void { if (is_string($callback)) { - $callback = fn($request) => get_class($request) === $callback; + $callback = fn ($request) => get_class($request) === $callback; } PHPUnit::assertTrue( diff --git a/tests/Http/Middleware/HandlersTest.php b/tests/Http/Middleware/HandlersTest.php index 86c8e549..dd798e00 100644 --- a/tests/Http/Middleware/HandlersTest.php +++ b/tests/Http/Middleware/HandlersTest.php @@ -14,7 +14,7 @@ class HandlersTest extends TestCase public function add(): void { $handlers = new Handlers; - $handlers->add(fn() => null); + $handlers->add(fn () => null); $this->assertCount(1, $handlers->getHandlers()); } diff --git a/tests/Http/MiddlewareTest.php b/tests/Http/MiddlewareTest.php index b29bad56..67bd5cb8 100644 --- a/tests/Http/MiddlewareTest.php +++ b/tests/Http/MiddlewareTest.php @@ -2,10 +2,10 @@ namespace Tests\Http; +use Mollie\Api\Http\Middleware; use Mollie\Api\Http\PendingRequest; use Mollie\Api\Http\Requests\DynamicGetRequest; use Mollie\Api\Http\Response; -use Mollie\Api\Http\Middleware; use Tests\Fixtures\MockClient; use Tests\TestCase; diff --git a/tests/Utils/ArrTest.php b/tests/Utils/ArrTest.php index 916d57db..8b346d0c 100644 --- a/tests/Utils/ArrTest.php +++ b/tests/Utils/ArrTest.php @@ -3,9 +3,9 @@ namespace Tests\Utils; use DateTimeImmutable; -use Mollie\Api\Utils\Arr; use Mollie\Api\Http\Data\AnyData; use Mollie\Api\Http\Data\Data; +use Mollie\Api\Utils\Arr; use Stringable; use Tests\TestCase; diff --git a/tests/Utils/UtilityTest.php b/tests/Utils/UtilityTest.php index 100cb8c6..dc744199 100644 --- a/tests/Utils/UtilityTest.php +++ b/tests/Utils/UtilityTest.php @@ -2,8 +2,8 @@ namespace Tests\Utils; -use Mollie\Api\Utils\Utility; use Mollie\Api\Http\Data\Metadata; +use Mollie\Api\Utils\Utility; use ReflectionProperty; use Tests\TestCase; @@ -62,7 +62,7 @@ public function filter_by_properties() public function compose() { // Test with callable - $composedWithCallable = Utility::compose(5, fn($x) => $x * 2); + $composedWithCallable = Utility::compose(5, fn ($x) => $x * 2); $this->assertEquals(10, $composedWithCallable); $composedWithClass = Utility::compose('test', TestComposable::class); @@ -70,7 +70,7 @@ public function compose() $this->assertEquals('test', $composedWithClass->value); // Test with falsy value - $composedWithDefault = Utility::compose(false, fn($x) => $x * 2, 'default'); + $composedWithDefault = Utility::compose(false, fn ($x) => $x * 2, 'default'); $this->assertEquals('default', $composedWithDefault); $existingValueIsNotOverriden = Utility::compose(new Metadata(['key' => 'value']), Metadata::class);