Skip to content

Commit

Permalink
Fixes coding style
Browse files Browse the repository at this point in the history
  • Loading branch information
Naoray authored and github-actions[bot] committed Dec 3, 2024
1 parent 5e4c726 commit a9b44dd
Show file tree
Hide file tree
Showing 62 changed files with 122 additions and 111 deletions.
2 changes: 1 addition & 1 deletion src/EndpointCollection/ClientEndpointCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class ClientEndpointCollection extends EndpointCollection
*/
public function get(string $id, $query = []): Client
{
if (!$query instanceof GetClientQuery) {
if (! $query instanceof GetClientQuery) {
$query = GetClientQueryFactory::new($query)->create();
}

Expand Down
36 changes: 15 additions & 21 deletions src/EndpointCollection/ProfileMethodEndpointCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
namespace Mollie\Api\EndpointCollection;

use Mollie\Api\Exceptions\ApiException;
use Mollie\Api\Http\Requests\EnableProfileMethodRequest;
use Mollie\Api\Http\Requests\DisableProfileMethodRequest;
use Mollie\Api\Http\Requests\EnableProfileMethodRequest;
use Mollie\Api\Resources\Method;
use Mollie\Api\Resources\Profile;

Expand All @@ -14,8 +14,6 @@ class ProfileMethodEndpointCollection extends EndpointCollection
* Enable a method for the provided Profile ID.
* Alias of enableForId for backwards compatibility.
*
* @param string $profileId
* @param string $id
* @throws ApiException
*/
public function createForId(string $profileId, string $id): Method
Expand All @@ -27,8 +25,6 @@ public function createForId(string $profileId, string $id): Method
* Enable a method for the provided Profile object.
* Alias of enableFor for backwards compatibility.
*
* @param Profile $profile
* @param string $id
* @throws ApiException
*/
public function createFor(Profile $profile, string $id): Method
Expand All @@ -40,7 +36,6 @@ public function createFor(Profile $profile, string $id): Method
* Enable a method for the current profile.
* Alias of enable for backwards compatibility.
*
* @param string $id
* @throws ApiException
*/
public function createForCurrentProfile(string $id): Method
Expand All @@ -51,8 +46,9 @@ public function createForCurrentProfile(string $id): Method
/**
* Enable a payment method for a specific profile.
*
* @param string $profileId The profile's ID or 'me' for the current profile
* @param string $id The payment method ID
* @param string $profileId The profile's ID or 'me' for the current profile
* @param string $id The payment method ID
*
* @throws ApiException
*/
public function enableForId(string $profileId, string $id): Method
Expand All @@ -64,8 +60,8 @@ public function enableForId(string $profileId, string $id): Method
/**
* Enable a payment method for the provided Profile object.
*
* @param Profile $profile
* @param string $id The payment method ID
* @param string $id The payment method ID
*
* @throws ApiException
*/
public function enableFor(Profile $profile, string $id): Method
Expand All @@ -76,7 +72,8 @@ public function enableFor(Profile $profile, string $id): Method
/**
* Enable a payment method for the current profile.
*
* @param string $id The payment method ID
* @param string $id The payment method ID
*
* @throws ApiException
*/
public function enable(string $id): Method
Expand All @@ -88,8 +85,6 @@ public function enable(string $id): Method
* Disable a method for the provided Profile ID.
* Alias of disableForId for backwards compatibility.
*
* @param string $profileId
* @param string $id
* @throws ApiException
*/
public function deleteForId(string $profileId, string $id): void
Expand All @@ -101,8 +96,6 @@ public function deleteForId(string $profileId, string $id): void
* Disable a method for the provided Profile object.
* Alias of disableFor for backwards compatibility.
*
* @param Profile $profile
* @param string $id
* @throws ApiException
*/
public function deleteFor(Profile $profile, string $id): void
Expand All @@ -114,7 +107,6 @@ public function deleteFor(Profile $profile, string $id): void
* Disable a method for the current profile.
* Alias of disable for backwards compatibility.
*
* @param string $id
* @throws ApiException
*/
public function deleteForCurrentProfile(string $id): void
Expand All @@ -125,8 +117,9 @@ public function deleteForCurrentProfile(string $id): void
/**
* Disable a payment method for a specific profile.
*
* @param string $profileId The profile's ID or 'me' for the current profile
* @param string $id The payment method ID
* @param string $profileId The profile's ID or 'me' for the current profile
* @param string $id The payment method ID
*
* @throws ApiException
*/
public function disableForId(string $profileId, string $id): void
Expand All @@ -137,8 +130,8 @@ public function disableForId(string $profileId, string $id): void
/**
* Disable a payment method for the provided Profile object.
*
* @param Profile $profile
* @param string $id The payment method ID
* @param string $id The payment method ID
*
* @throws ApiException
*/
public function disableFor(Profile $profile, string $id): void
Expand All @@ -149,7 +142,8 @@ public function disableFor(Profile $profile, string $id): void
/**
* Disable a payment method for the current profile.
*
* @param string $id The payment method ID
* @param string $id The payment method ID
*
* @throws ApiException
*/
public function disable(string $id): void
Expand Down
11 changes: 6 additions & 5 deletions src/EndpointCollection/SessionEndpointCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Mollie\Api\Exceptions\ApiException;
use Mollie\Api\Factories\SortablePaginatedQueryFactory;
use Mollie\Api\Http\Payload\AnyPayload;
use Mollie\Api\Http\Query\AnyQuery;
use Mollie\Api\Http\Requests\CancelSessionRequest;
use Mollie\Api\Http\Requests\CreateSessionRequest;
use Mollie\Api\Http\Requests\GetPaginatedSessionsRequest;
Expand All @@ -13,7 +14,6 @@
use Mollie\Api\Resources\LazyCollection;
use Mollie\Api\Resources\Session;
use Mollie\Api\Resources\SessionCollection;
use Mollie\Api\Http\Query\AnyQuery;

class SessionEndpointCollection extends EndpointCollection
{
Expand All @@ -22,8 +22,8 @@ class SessionEndpointCollection extends EndpointCollection
*
* Will throw a ApiException if the session id is invalid or the resource cannot be found.
*
* @param string $sessionId
* @param array|AnyQuery $query
* @param array|AnyQuery $query
*
* @throws ApiException
*/
public function get(string $sessionId, $query = []): Session
Expand All @@ -39,8 +39,9 @@ public function get(string $sessionId, $query = []): Session
/**
* Creates a session in Mollie.
*
* @param array|AnyPayload $payload
* @param array|AnyQuery $query
* @param array|AnyPayload $payload
* @param array|AnyQuery $query
*
* @throws ApiException
*/
public function create($payload = [], $query = []): Session
Expand Down
16 changes: 10 additions & 6 deletions src/EndpointCollection/SettlementEndpointCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ class SettlementEndpointCollection extends EndpointCollection
*
* Will throw an ApiException if the settlement id is invalid or the resource cannot be found.
*
* @param array|bool $testmode
* @param array|bool $testmode
*
* @throws ApiException
*/
public function get(string $settlementId, $testmode = []): Settlement
Expand All @@ -32,7 +33,8 @@ public function get(string $settlementId, $testmode = []): Settlement
/**
* Retrieve the next settlement from Mollie.
*
* @param array|bool $testmode
* @param array|bool $testmode
*
* @throws ApiException
*/
public function next($testmode = []): ?Settlement
Expand All @@ -43,7 +45,8 @@ public function next($testmode = []): ?Settlement
/**
* Retrieve the open balance from Mollie.
*
* @param array|bool $testmode
* @param array|bool $testmode
*
* @throws ApiException
*/
public function open($testmode = []): ?Settlement
Expand All @@ -54,7 +57,8 @@ public function open($testmode = []): ?Settlement
/**
* Retrieve a collection of settlements from Mollie.
*
* @param string|null $from The first settlement ID you want to include in your list.
* @param string|null $from The first settlement ID you want to include in your list.
*
* @throws ApiException
*/
public function page(?string $from = null, ?int $limit = null, array $filters = []): SettlementCollection
Expand All @@ -74,8 +78,8 @@ public function page(?string $from = null, ?int $limit = null, array $filters =
/**
* Create an iterator for iterating over settlements retrieved from Mollie.
*
* @param string|null $from The first settlement ID you want to include in your list.
* @param bool $iterateBackwards Set to true for reverse order iteration (default is false).
* @param string|null $from The first settlement ID you want to include in your list.
* @param bool $iterateBackwards Set to true for reverse order iteration (default is false).
*/
public function iterator(
?string $from = null,
Expand Down
1 change: 0 additions & 1 deletion src/Factories/GetAllPaymentMethodsQueryFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use Mollie\Api\Http\Query\GetAllMethodsQuery;
use Mollie\Api\Types\MethodQuery;
use Mollie\Api\Types\PaymentMethod;

class GetAllPaymentMethodsQueryFactory extends Factory
{
Expand Down
1 change: 1 addition & 0 deletions src/Factories/GetPaginatedClientQueryFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Mollie\Api\Http\Query\GetPaginatedClientQuery;
use Mollie\Api\Types\ClientQuery;

class GetPaginatedClientQueryFactory extends Factory
{
public function create(): GetPaginatedClientQuery
Expand Down
1 change: 1 addition & 0 deletions src/Factories/GetPaginatedRefundsQueryFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Mollie\Api\Http\Query\GetPaginatedRefundsQuery;
use Mollie\Api\Types\PaymentIncludesQuery;

class GetPaginatedRefundsQueryFactory extends Factory
{
public function create(): GetPaginatedRefundsQuery
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Mollie\Api\Http\Query\GetPaginatedSettlementCapturesQuery;
use Mollie\Api\Types\PaymentIncludesQuery;

class GetPaginatedSettlementCapturesQueryFactory extends Factory
{
public function create(): GetPaginatedSettlementCapturesQuery
Expand Down
1 change: 1 addition & 0 deletions src/Factories/GetPaymentRefundQueryFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Mollie\Api\Http\Query\GetPaymentRefundQuery;
use Mollie\Api\Types\PaymentIncludesQuery;

class GetPaymentRefundQueryFactory extends Factory
{
public function create(): GetPaymentRefundQuery
Expand Down
2 changes: 1 addition & 1 deletion src/Helpers/Arr.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public static function wrap($array): array

/**
* Check if a value exists in an array of includes.
* @param array $array
*
* @param string|array<string> $key
* @param mixed $value
*
Expand Down
1 change: 1 addition & 0 deletions src/Http/Query/GetClientQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
class GetClientQuery extends Query
{
private bool $embedOrganization;

private bool $embedOnboarding;

public function __construct(
Expand Down
2 changes: 2 additions & 0 deletions src/Http/Query/GetPaginatedClientQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@

use Mollie\Api\Helpers\Arr;
use Mollie\Api\Types\ClientQuery;

class GetPaginatedClientQuery extends Query
{
private PaginatedQuery $paginatedQuery;

private bool $embedOrganization;

private bool $embedOnboarding;

public function __construct(
Expand Down
1 change: 1 addition & 0 deletions src/Http/Query/GetPaymentCaptureQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Mollie\Api\Helpers\Arr;
use Mollie\Api\Types\PaymentIncludesQuery;

class GetPaymentCaptureQuery extends Query
{
public bool $includePayment = false;
Expand Down
4 changes: 4 additions & 0 deletions src/Http/Query/GetPaymentMethodQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,13 @@
class GetPaymentMethodQuery extends Query
{
private ?string $locale;

private ?string $currency;

private ?string $profileId;

private bool $includeIssuers;

private bool $includePricing;

public function __construct(
Expand Down
1 change: 1 addition & 0 deletions src/Http/Requests/CreateSessionRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class CreateSessionRequest extends ResourceHydratableRequest implements HasPaylo
public static string $targetResourceClass = Session::class;

private AnyPayload $payload;

private AnyQuery $query;

public function __construct(AnyPayload $payload, AnyQuery $query)
Expand Down
1 change: 1 addition & 0 deletions src/Http/Requests/GetSessionRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class GetSessionRequest extends ResourceHydratableRequest
public static string $targetResourceClass = Session::class;

private string $sessionId;

private AnyQuery $query;

public function __construct(string $sessionId, AnyQuery $query)
Expand Down
1 change: 1 addition & 0 deletions src/Http/Requests/GetTerminalRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Mollie\Api\Contracts\SupportsTestmodeInQuery;
use Mollie\Api\Resources\Terminal;
use Mollie\Api\Types\Method;

class GetTerminalRequest extends ResourceHydratableRequest implements SupportsTestmodeInQuery
{
protected static string $method = Method::GET;
Expand Down
1 change: 1 addition & 0 deletions src/Http/Requests/UpdateSessionRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class UpdateSessionRequest extends ResourceHydratableRequest implements HasPaylo
public static string $targetResourceClass = Session::class;

private string $sessionId;

private AnyPayload $payload;

public function __construct(string $sessionId, AnyPayload $payload)
Expand Down
2 changes: 1 addition & 1 deletion src/MollieApiClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
use Mollie\Api\EndpointCollection\ProfileEndpointCollection;
use Mollie\Api\EndpointCollection\ProfileMethodEndpointCollection;
use Mollie\Api\EndpointCollection\RefundEndpointCollection;
use Mollie\Api\EndpointCollection\SessionEndpointCollection;
use Mollie\Api\EndpointCollection\SettlementCaptureEndpointCollection;
use Mollie\Api\EndpointCollection\SettlementChargebackEndpointCollection;
use Mollie\Api\EndpointCollection\SettlementPaymentEndpointCollection;
Expand All @@ -55,7 +56,6 @@
use Mollie\Api\Traits\HasMiddleware;
use Mollie\Api\Traits\HasRequestProperties;
use Mollie\Api\Traits\Initializable;
use Mollie\Api\EndpointCollection\SessionEndpointCollection;
use Mollie\Api\Traits\SendsRequests;

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Traits/HasEndpoints.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
use Mollie\Api\EndpointCollection\ProfileEndpointCollection;
use Mollie\Api\EndpointCollection\ProfileMethodEndpointCollection;
use Mollie\Api\EndpointCollection\RefundEndpointCollection;
use Mollie\Api\EndpointCollection\SessionEndpointCollection;
use Mollie\Api\EndpointCollection\SettlementCaptureEndpointCollection;
use Mollie\Api\EndpointCollection\SettlementChargebackEndpointCollection;
use Mollie\Api\EndpointCollection\SettlementPaymentEndpointCollection;
Expand All @@ -37,7 +38,6 @@
use Mollie\Api\EndpointCollection\SubscriptionPaymentEndpointCollection;
use Mollie\Api\EndpointCollection\TerminalEndpointCollection;
use Mollie\Api\EndpointCollection\WalletEndpointCollection;
use Mollie\Api\EndpointCollection\SessionEndpointCollection;
use Mollie\Api\MollieApiClient;

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/EndpointCollection/BalanceEndpointCollectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
use Mollie\Api\Http\Requests\GetPaginatedBalanceRequest;
use Mollie\Api\Resources\Balance;
use Mollie\Api\Resources\BalanceCollection;
use Tests\TestCase;
use Tests\Fixtures\MockClient;
use Tests\Fixtures\MockResponse;
use Tests\Fixtures\Traits\AmountObjectTestHelpers;
use Tests\Fixtures\Traits\LinkObjectTestHelpers;
use Tests\TestCase;

class BalanceEndpointCollectionTest extends TestCase
{
Expand Down
Loading

0 comments on commit a9b44dd

Please sign in to comment.