Skip to content

Commit

Permalink
Merge pull request #286 from saloonphp/feature/v3-remove-interfaces
Browse files Browse the repository at this point in the history
Feature | V3 Remove Interfaces
  • Loading branch information
Sammyjo20 authored Sep 8, 2023
2 parents ed0645e + a62ced6 commit 11a995a
Show file tree
Hide file tree
Showing 121 changed files with 695 additions and 1,843 deletions.
26 changes: 8 additions & 18 deletions phpstan.baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,12 @@ parameters:
path: src/Http/Faking/Fixture.php

-
message: "#^Method Saloon\\\\Http\\\\Faking\\\\MockClient\\:\\:getLastResponse\\(\\) should return Saloon\\\\Contracts\\\\Response\\|null but returns \\(callable\\)\\|Saloon\\\\Http\\\\Faking\\\\Fixture\\|Saloon\\\\Http\\\\Faking\\\\MockResponse\\.$#"
message: "#^Method Saloon\\\\Http\\\\Faking\\\\MockClient\\:\\:getLastResponse\\(\\) should return Saloon\\\\Http\\\\Response\\|null but returns \\(callable\\)\\|Saloon\\\\Http\\\\Faking\\\\Fixture\\|Saloon\\\\Http\\\\Faking\\\\MockResponse\\.$#"
count: 1
path: src/Http/Faking/MockClient.php

-
message: "#^Method Saloon\\\\Http\\\\Faking\\\\MockClient\\:\\:getRecordedResponses\\(\\) should return array\\<Saloon\\\\Contracts\\\\Response\\> but returns array\\<\\(callable\\)\\|Saloon\\\\Http\\\\Faking\\\\Fixture\\|Saloon\\\\Http\\\\Faking\\\\MockResponse\\>\\.$#"
count: 1
path: src/Http/Faking/MockClient.php

-
message: "#^Property Saloon\\\\Http\\\\Faking\\\\MockClient\\:\\:\\$recordedResponses \\(array\\<\\(callable\\(\\)\\: mixed\\)\\|Saloon\\\\Http\\\\Faking\\\\Fixture\\|Saloon\\\\Http\\\\Faking\\\\MockResponse\\>\\) does not accept non\\-empty\\-array\\<\\(callable\\(\\)\\: mixed\\)\\|Saloon\\\\Contracts\\\\Response\\|Saloon\\\\Http\\\\Faking\\\\Fixture\\|Saloon\\\\Http\\\\Faking\\\\MockResponse\\>\\.$#"
message: "#^Method Saloon\\\\Http\\\\Faking\\\\MockClient\\:\\:getRecordedResponses\\(\\) should return array\\<Saloon\\\\Http\\\\Response\\> but returns array\\<\\(callable\\)\\|Saloon\\\\Http\\\\Faking\\\\Fixture\\|Saloon\\\\Http\\\\Faking\\\\MockResponse\\>\\.$#"
count: 1
path: src/Http/Faking/MockClient.php

Expand Down Expand Up @@ -91,26 +86,21 @@ parameters:
path: src/Data/MultipartValue.php

-
message: "#^Parameter \\#1 \\$response of method Saloon\\\\Contracts\\\\PendingRequest\\:\\:executeResponsePipeline\\(\\) expects Saloon\\\\Contracts\\\\Response\\, GuzzleHttp\\\\Promise\\\\PromiseInterface\\|Saloon\\\\Contracts\\\\Response given.$#"
count: 1
path: src/Traits/Connector/SendsRequests.php

-
message: "#^Call to an undefined method GuzzleHttp\\\\Promise\\\\PromiseInterface\\|Saloon\\\\Contracts\\\\Response\\:\\:then\\(\\).$#"
message: "#^Parameter \\#1 \\$response of method Saloon\\\\Http\\\\PendingRequest\\:\\:executeResponsePipeline\\(\\) expects Saloon\\\\Http\\\\Response\\, GuzzleHttp\\\\Promise\\\\PromiseInterface\\|Saloon\\\\Http\\\\Response given.$#"
count: 1
path: src/Traits/Connector/SendsRequests.php

-
message: "#^Access to an undefined property Saloon\\\\Contracts\\\\Request\\:\\:\\$tries.$#"
message: "#^Call to an undefined method GuzzleHttp\\\\Promise\\\\PromiseInterface\\|Saloon\\\\Http\\\\Response\\:\\:then\\(\\).$#"
count: 1
path: src/Traits/Connector/SendsRequests.php

-
message: "#^Access to an undefined property Saloon\\\\Contracts\\\\Request\\:\\:\\$retryInterval.$#"
message: "#^Property Saloon\\\\Http\\\\Faking\\\\MockClient::$recordedResponses (array<(callable():mixed)|Saloon\\\\Http\\\\Faking\\\\Fixture|Saloon\\\\Http\\\\Faking\\\\MockResponse>) does not accept non-empty-array<(callable():mixed)|Saloon\\\\Http\\\\Faking\\\\Fixture|Saloon\\\\Http\\\\Faking\\\\MockResponse|Saloon\\\\Http\\\\Response>.$#"
count: 1
path: src/Traits/Connector/SendsRequests.php
path: src/Http/Faking/MockClient.php

-
message: "#^Access to an undefined property Saloon\\\\Contracts\\\\Request\\:\\:\\$throwOnMaxTries.$#"
message: "#^Match arm is unreachable because previous comparison is always true.$#"
count: 1
path: src/Traits/Connector/SendsRequests.php
path: src/Http/Pool.php
44 changes: 0 additions & 44 deletions src/Contracts/Authenticatable.php

This file was deleted.

2 changes: 2 additions & 0 deletions src/Contracts/Authenticator.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

namespace Saloon\Contracts;

use Saloon\Http\PendingRequest;

interface Authenticator
{
/**
Expand Down
26 changes: 0 additions & 26 deletions src/Contracts/CanThrowRequestExceptions.php

This file was deleted.

80 changes: 0 additions & 80 deletions src/Contracts/Connector.php

This file was deleted.

2 changes: 1 addition & 1 deletion src/Contracts/DataObjects/WithResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Saloon\Contracts\DataObjects;

use Saloon\Contracts\Response;
use Saloon\Http\Response;

interface WithResponse
{
Expand Down
9 changes: 1 addition & 8 deletions src/Contracts/FakeResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@
use Closure;
use Throwable;
use Saloon\Http\Faking\Fixture;
use Saloon\Http\PendingRequest;
use Psr\Http\Message\ResponseInterface;
use Saloon\Contracts\Body\BodyRepository;
use Psr\Http\Message\StreamFactoryInterface;
use Psr\Http\Message\ResponseFactoryInterface;

/**
* @method static static make(mixed $body = [], int $status = 200, array $headers = []) Create a new mock response
*/
interface FakeResponse
{
/**
Expand All @@ -39,11 +37,6 @@ public function body(): BodyRepository;
*/
public function throw(Closure|Throwable $value): static;

/**
* Checks if the response throws an exception.
*/
public function throwsException(): bool;

/**
* Get the exception
*/
Expand Down
16 changes: 0 additions & 16 deletions src/Contracts/HasConfig.php

This file was deleted.

25 changes: 0 additions & 25 deletions src/Contracts/HasDebugging.php

This file was deleted.

18 changes: 0 additions & 18 deletions src/Contracts/HasDelay.php

This file was deleted.

16 changes: 0 additions & 16 deletions src/Contracts/HasHeaders.php

This file was deleted.

16 changes: 0 additions & 16 deletions src/Contracts/HasMiddlewarePipeline.php

This file was deleted.

28 changes: 0 additions & 28 deletions src/Contracts/HasMockClient.php

This file was deleted.

16 changes: 0 additions & 16 deletions src/Contracts/HasQueryParams.php

This file was deleted.

Loading

0 comments on commit 11a995a

Please sign in to comment.