Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #362 from saloonphp/feature/reduce-throw-docblocks
Fix | Remove Unnecesary @ throws tags in docblocks
  • Loading branch information
Sammyjo20 committed Jan 14, 2024
2 parents 5c4675f + ab94d4e commit 3222ff8
Show file tree
Hide file tree
Showing 14 changed files with 0 additions and 48 deletions.
2 changes: 0 additions & 2 deletions src/Contracts/FakeResponse.php
Expand Up @@ -44,8 +44,6 @@ public function getException(PendingRequest $pendingRequest): ?Throwable;

/**
* Create a new mock response from a fixture
*
* @throws \Saloon\Exceptions\DirectoryNotFoundException
*/
public static function fixture(string $name): Fixture;

Expand Down
1 change: 0 additions & 1 deletion src/Helpers/Helpers.php
Expand Up @@ -66,7 +66,6 @@ public static function value(mixed $value, mixed ...$args): mixed
* Check if a class is a subclass of another.
*
* @param class-string $class
* @throws \ReflectionException
*/
public static function isSubclassOf(string $class, string $subclass): bool
{
Expand Down
3 changes: 0 additions & 3 deletions src/Helpers/MiddlewarePipeline.php
Expand Up @@ -35,7 +35,6 @@ public function __construct()
*
* @param callable(\Saloon\Http\PendingRequest): (\Saloon\Http\PendingRequest|\Saloon\Contracts\FakeResponse|void) $callable
* @return $this
* @throws \Saloon\Exceptions\DuplicatePipeNameException
*/
public function onRequest(callable $callable, ?string $name = null, ?PipeOrder $order = null): static
{
Expand Down Expand Up @@ -71,7 +70,6 @@ public function onRequest(callable $callable, ?string $name = null, ?PipeOrder $
*
* @param callable(\Saloon\Http\Response): (\Saloon\Http\Response|void) $callable
* @return $this
* @throws \Saloon\Exceptions\DuplicatePipeNameException
*/
public function onResponse(callable $callable, ?string $name = null, ?PipeOrder $order = null): static
{
Expand Down Expand Up @@ -114,7 +112,6 @@ public function executeResponsePipeline(Response $response): Response
* Merge in another middleware pipeline.
*
* @return $this
* @throws \Saloon\Exceptions\DuplicatePipeNameException
*/
public function merge(MiddlewarePipeline $middlewarePipeline): static
{
Expand Down
2 changes: 0 additions & 2 deletions src/Helpers/Pipeline.php
Expand Up @@ -22,7 +22,6 @@ class Pipeline
*
* @param callable(mixed $payload): (mixed) $callable
* @return $this
* @throws \Saloon\Exceptions\DuplicatePipeNameException
*/
public function pipe(callable $callable, ?string $name = null, ?PipeOrder $order = null): static
{
Expand Down Expand Up @@ -79,7 +78,6 @@ protected function sortPipes(): array
*
* @param array<\Saloon\Data\Pipe> $pipes
* @return $this
* @throws \Saloon\Exceptions\DuplicatePipeNameException
*/
public function setPipes(array $pipes): static
{
Expand Down
3 changes: 0 additions & 3 deletions src/Http/Faking/FakeResponse.php
Expand Up @@ -110,9 +110,6 @@ public function getException(PendingRequest $pendingRequest): ?Throwable

/**
* Create a new mock response from a fixture
*
* @throws \Saloon\Exceptions\DirectoryNotFoundException
* @throws \Saloon\Exceptions\UnableToCreateDirectoryException
*/
public static function fixture(string $name): Fixture
{
Expand Down
9 changes: 0 additions & 9 deletions src/Http/Faking/Fixture.php
Expand Up @@ -30,9 +30,6 @@ class Fixture

/**
* Constructor
*
* @throws \Saloon\Exceptions\DirectoryNotFoundException
* @throws \Saloon\Exceptions\UnableToCreateDirectoryException
*/
public function __construct(string $name = '', Storage $storage = null)
{
Expand All @@ -42,9 +39,6 @@ public function __construct(string $name = '', Storage $storage = null)

/**
* Attempt to get the mock response from the fixture.
*
* @throws \Saloon\Exceptions\FixtureMissingException
* @throws \JsonException|\Saloon\Exceptions\FixtureException
*/
public function getMockResponse(): ?MockResponse
{
Expand All @@ -66,9 +60,6 @@ public function getMockResponse(): ?MockResponse
* Store data as the fixture.
*
* @return $this
* @throws \JsonException
* @throws \Saloon\Exceptions\UnableToCreateDirectoryException
* @throws \Saloon\Exceptions\UnableToCreateFileException|\Saloon\Exceptions\FixtureException
*/
public function store(RecordedResponse $recordedResponse): static
{
Expand Down
3 changes: 0 additions & 3 deletions src/Http/Middleware/DetermineMockResponse.php
Expand Up @@ -15,9 +15,6 @@ class DetermineMockResponse implements RequestMiddleware
/**
* Check if a MockClient has been provided and guess the MockResponse based on the request.
*
* @throws \JsonException
* @throws \Saloon\Exceptions\DuplicatePipeNameException
* @throws \Saloon\Exceptions\FixtureException
* @throws \Saloon\Exceptions\FixtureMissingException
* @throws \Saloon\Exceptions\NoMockResponseFoundException
*/
Expand Down
5 changes: 0 additions & 5 deletions src/Http/Middleware/RecordFixture.php
Expand Up @@ -33,11 +33,6 @@ public function __construct(Fixture $fixture, MockClient $mockClient)

/**
* Store the response
*
* @throws \JsonException
* @throws \Saloon\Exceptions\FixtureException
* @throws \Saloon\Exceptions\UnableToCreateDirectoryException
* @throws \Saloon\Exceptions\UnableToCreateFileException
*/
public function __invoke(Response $response): void
{
Expand Down
1 change: 0 additions & 1 deletion src/Http/PendingRequest.php
Expand Up @@ -283,7 +283,6 @@ public function setAsynchronous(bool $asynchronous): static
* Get the response class
*
* @return class-string<\Saloon\Http\Response>
* @throws \ReflectionException
* @throws \Saloon\Exceptions\InvalidResponseClassException
*/
public function getResponseClass(): string
Expand Down
2 changes: 0 additions & 2 deletions src/Http/Pool.php
Expand Up @@ -142,8 +142,6 @@ public function getRequests(): iterable

/**
* Send the pool and create a Promise
*
* @throws \Saloon\Exceptions\InvalidPoolItemException
*/
public function send(): PromiseInterface
{
Expand Down
4 changes: 0 additions & 4 deletions src/Traits/Body/HasMultipartBody.php
Expand Up @@ -18,8 +18,6 @@ trait HasMultipartBody

/**
* Boot the HasMultipartBody trait
*
* @throws \Exception
*/
public function bootHasMultipartBody(PendingRequest $pendingRequest): void
{
Expand All @@ -28,8 +26,6 @@ public function bootHasMultipartBody(PendingRequest $pendingRequest): void

/**
* Retrieve the data repository
*
* @throws \Exception
*/
public function body(): MultipartBodyRepository
{
Expand Down
1 change: 0 additions & 1 deletion src/Traits/Macroable.php
Expand Up @@ -35,7 +35,6 @@ public static function macro(string $name, object|callable $macro): void
* Add a mixin
*
* @param object|class-string $mixin
* @throws \ReflectionException
*/
public static function mixin(object|string $mixin): void
{
Expand Down
9 changes: 0 additions & 9 deletions src/Traits/OAuth2/AuthorizationCodeGrant.php
Expand Up @@ -32,7 +32,6 @@ trait AuthorizationCodeGrant
* Get the Authorization URL.
*
* @param array<string> $scopes
* @throws \Saloon\Exceptions\OAuthConfigValidationException
*/
public function getAuthorizationUrl(array $scopes = [], string $state = null, string $scopeSeparator = ' ', array $additionalQueryParameters = []): string
{
Expand Down Expand Up @@ -71,10 +70,7 @@ public function getAuthorizationUrl(array $scopes = [], string $state = null, st
* @template TRequest of \Saloon\Http\Request
*
* @param callable(TRequest): (void)|null $requestModifier
* @throws \ReflectionException
* @throws \Saloon\Exceptions\InvalidStateException
* @throws \Saloon\Exceptions\OAuthConfigValidationException
* @throws \Throwable
*/
public function getAccessToken(string $code, string $state = null, string $expectedState = null, bool $returnResponse = false, ?callable $requestModifier = null): OAuthAuthenticator|Response
{
Expand Down Expand Up @@ -109,9 +105,6 @@ public function getAccessToken(string $code, string $state = null, string $expec
* @template TRequest of \Saloon\Http\Request
*
* @param callable(TRequest): (void)|null $requestModifier
* @throws \ReflectionException
* @throws \Saloon\Exceptions\OAuthConfigValidationException
* @throws \Throwable
*/
public function refreshAccessToken(OAuthAuthenticator|string $refreshToken, bool $returnResponse = false, ?callable $requestModifier = null): OAuthAuthenticator|Response
{
Expand Down Expand Up @@ -179,8 +172,6 @@ protected function createOAuthAuthenticator(string $accessToken, string $refresh
* @template TRequest of \Saloon\Http\Request
*
* @param callable(TRequest): (void)|null $requestModifier
* @throws \ReflectionException
* @throws \Throwable
*/
public function getUser(OAuthAuthenticator $oauthAuthenticator, ?callable $requestModifier = null): Response
{
Expand Down
3 changes: 0 additions & 3 deletions src/Traits/OAuth2/ClientCredentialsGrant.php
Expand Up @@ -24,9 +24,6 @@ trait ClientCredentialsGrant
*
* @param array<string> $scopes
* @param callable(TRequest): (void)|null $requestModifier
* @throws \ReflectionException
* @throws \Saloon\Exceptions\OAuthConfigValidationException
* @throws \Throwable
*/
public function getAccessToken(array $scopes = [], string $scopeSeparator = ' ', bool $returnResponse = false, ?callable $requestModifier = null): OAuthAuthenticator|Response
{
Expand Down

0 comments on commit 3222ff8

Please sign in to comment.