diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index 7777dd9..b75f77c 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -15,6 +15,9 @@ jobs: - name: Checkout code uses: actions/checkout@v3 + - name: Remove phpspec + run: composer remove --dev friends-of-phpspec/phpspec-code-coverage phpspec/phpspec + - name: PHPStan uses: OskarStark/phpstan-ga@0.12.32 env: diff --git a/CHANGELOG.md b/CHANGELOG.md index f4b989a..4cfd5c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Change Log +## unreleased + +- Cleaned up phpdoc. + ## 2.7.1 - 2023-11-30 - Allow installation with Symfony 7. diff --git a/src/Deferred.php b/src/Deferred.php index 646f375..eaf7cdf 100644 --- a/src/Deferred.php +++ b/src/Deferred.php @@ -51,9 +51,6 @@ public function __construct(callable $waitCallback) $this->onRejectedCallbacks = []; } - /** - * {@inheritdoc} - */ public function then(callable $onFulfilled = null, callable $onRejected = null): Promise { $deferred = new self($this->waitCallback); @@ -86,9 +83,6 @@ public function then(callable $onFulfilled = null, callable $onRejected = null): return $deferred; } - /** - * {@inheritdoc} - */ public function getState(): string { return $this->state; @@ -128,9 +122,6 @@ public function reject(ClientExceptionInterface $exception): void } } - /** - * {@inheritdoc} - */ public function wait($unwrap = true) { if (Promise::PENDING === $this->state) { diff --git a/src/HttpAsyncClientDecorator.php b/src/HttpAsyncClientDecorator.php index 2714b4a..91ff5af 100644 --- a/src/HttpAsyncClientDecorator.php +++ b/src/HttpAsyncClientDecorator.php @@ -20,8 +20,6 @@ trait HttpAsyncClientDecorator protected $httpAsyncClient; /** - * {@inheritdoc} - * * @see HttpAsyncClient::sendAsyncRequest */ public function sendAsyncRequest(RequestInterface $request) diff --git a/src/HttpAsyncClientEmulator.php b/src/HttpAsyncClientEmulator.php index 53c2535..ffc0d5a 100644 --- a/src/HttpAsyncClientEmulator.php +++ b/src/HttpAsyncClientEmulator.php @@ -17,15 +17,11 @@ trait HttpAsyncClientEmulator { /** - * {@inheritdoc} - * * @see HttpClient::sendRequest */ abstract public function sendRequest(RequestInterface $request): ResponseInterface; /** - * {@inheritdoc} - * * @see HttpAsyncClient::sendAsyncRequest */ public function sendAsyncRequest(RequestInterface $request) diff --git a/src/HttpClientDecorator.php b/src/HttpClientDecorator.php index c00ba6f..d236ad5 100644 --- a/src/HttpClientDecorator.php +++ b/src/HttpClientDecorator.php @@ -21,8 +21,6 @@ trait HttpClientDecorator protected $httpClient; /** - * {@inheritdoc} - * * @see ClientInterface::sendRequest */ public function sendRequest(RequestInterface $request): ResponseInterface diff --git a/src/HttpClientEmulator.php b/src/HttpClientEmulator.php index 51e2c05..7c40b50 100644 --- a/src/HttpClientEmulator.php +++ b/src/HttpClientEmulator.php @@ -15,8 +15,6 @@ trait HttpClientEmulator { /** - * {@inheritdoc} - * * @see HttpClient::sendRequest */ public function sendRequest(RequestInterface $request): ResponseInterface @@ -27,8 +25,6 @@ public function sendRequest(RequestInterface $request): ResponseInterface } /** - * {@inheritdoc} - * * @see HttpAsyncClient::sendAsyncRequest */ abstract public function sendAsyncRequest(RequestInterface $request); diff --git a/src/HttpClientPool/HttpClientPool.php b/src/HttpClientPool/HttpClientPool.php index a30bdb0..d7c2dbd 100644 --- a/src/HttpClientPool/HttpClientPool.php +++ b/src/HttpClientPool/HttpClientPool.php @@ -52,17 +52,11 @@ public function addHttpClient($client): void */ abstract protected function chooseHttpClient(): HttpClientPoolItem; - /** - * {@inheritdoc} - */ public function sendAsyncRequest(RequestInterface $request) { return $this->chooseHttpClient()->sendAsyncRequest($request); } - /** - * {@inheritdoc} - */ public function sendRequest(RequestInterface $request): ResponseInterface { return $this->chooseHttpClient()->sendRequest($request); diff --git a/src/HttpClientPool/HttpClientPoolItem.php b/src/HttpClientPool/HttpClientPoolItem.php index f29d065..2496dda 100644 --- a/src/HttpClientPool/HttpClientPoolItem.php +++ b/src/HttpClientPool/HttpClientPoolItem.php @@ -69,9 +69,6 @@ public function __construct($client, int $reenableAfter = null) $this->reenableAfter = $reenableAfter; } - /** - * {@inheritdoc} - */ public function sendRequest(RequestInterface $request): ResponseInterface { if ($this->isDisabled()) { @@ -92,9 +89,6 @@ public function sendRequest(RequestInterface $request): ResponseInterface return $response; } - /** - * {@inheritdoc} - */ public function sendAsyncRequest(RequestInterface $request) { if ($this->isDisabled()) { diff --git a/src/HttpClientPool/LeastUsedClientPool.php b/src/HttpClientPool/LeastUsedClientPool.php index 789c357..bfa1cd0 100644 --- a/src/HttpClientPool/LeastUsedClientPool.php +++ b/src/HttpClientPool/LeastUsedClientPool.php @@ -15,9 +15,6 @@ */ final class LeastUsedClientPool extends HttpClientPool { - /** - * {@inheritdoc} - */ protected function chooseHttpClient(): HttpClientPoolItem { $clientPool = array_filter($this->clientPool, function (HttpClientPoolItem $clientPoolItem) { diff --git a/src/HttpClientPool/RandomClientPool.php b/src/HttpClientPool/RandomClientPool.php index 789ba42..8fda587 100644 --- a/src/HttpClientPool/RandomClientPool.php +++ b/src/HttpClientPool/RandomClientPool.php @@ -13,9 +13,6 @@ */ final class RandomClientPool extends HttpClientPool { - /** - * {@inheritdoc} - */ protected function chooseHttpClient(): HttpClientPoolItem { $clientPool = array_filter($this->clientPool, function (HttpClientPoolItem $clientPoolItem) { diff --git a/src/HttpClientPool/RoundRobinClientPool.php b/src/HttpClientPool/RoundRobinClientPool.php index 7c7b191..a908653 100644 --- a/src/HttpClientPool/RoundRobinClientPool.php +++ b/src/HttpClientPool/RoundRobinClientPool.php @@ -13,9 +13,6 @@ */ final class RoundRobinClientPool extends HttpClientPool { - /** - * {@inheritdoc} - */ protected function chooseHttpClient(): HttpClientPoolItem { $last = current($this->clientPool); diff --git a/src/HttpClientRouter.php b/src/HttpClientRouter.php index 040d893..42c6907 100644 --- a/src/HttpClientRouter.php +++ b/src/HttpClientRouter.php @@ -12,8 +12,6 @@ use Psr\Http\Message\ResponseInterface; /** - * {@inheritdoc} - * * @author Joel Wurtz */ final class HttpClientRouter implements HttpClientRouterInterface @@ -23,17 +21,11 @@ final class HttpClientRouter implements HttpClientRouterInterface */ private $clients = []; - /** - * {@inheritdoc} - */ public function sendRequest(RequestInterface $request): ResponseInterface { return $this->chooseHttpClient($request)->sendRequest($request); } - /** - * {@inheritdoc} - */ public function sendAsyncRequest(RequestInterface $request) { return $this->chooseHttpClient($request)->sendAsyncRequest($request); diff --git a/src/Plugin/AddHostPlugin.php b/src/Plugin/AddHostPlugin.php index 2a866ee..ca811b7 100644 --- a/src/Plugin/AddHostPlugin.php +++ b/src/Plugin/AddHostPlugin.php @@ -48,9 +48,6 @@ public function __construct(UriInterface $host, array $config = []) $this->replace = $options['replace']; } - /** - * {@inheritdoc} - */ public function handleRequest(RequestInterface $request, callable $next, callable $first): Promise { if ($this->replace || '' === $request->getUri()->getHost()) { diff --git a/src/Plugin/AuthenticationPlugin.php b/src/Plugin/AuthenticationPlugin.php index ce9d4bd..2336062 100644 --- a/src/Plugin/AuthenticationPlugin.php +++ b/src/Plugin/AuthenticationPlugin.php @@ -26,9 +26,6 @@ public function __construct(Authentication $authentication) $this->authentication = $authentication; } - /** - * {@inheritdoc} - */ public function handleRequest(RequestInterface $request, callable $next, callable $first): Promise { $request = $this->authentication->authenticate($request); diff --git a/src/Plugin/BaseUriPlugin.php b/src/Plugin/BaseUriPlugin.php index 34c3b64..c361683 100644 --- a/src/Plugin/BaseUriPlugin.php +++ b/src/Plugin/BaseUriPlugin.php @@ -24,7 +24,7 @@ final class BaseUriPlugin implements Plugin /** * @var AddPathPlugin|null */ - private $addPathPlugin = null; + private $addPathPlugin; /** * @param UriInterface $uri Has to contain a host name and can have a path @@ -39,9 +39,6 @@ public function __construct(UriInterface $uri, array $hostConfig = []) } } - /** - * {@inheritdoc} - */ public function handleRequest(RequestInterface $request, callable $next, callable $first): Promise { $addHostNext = function (RequestInterface $request) use ($next, $first) { diff --git a/src/Plugin/ContentLengthPlugin.php b/src/Plugin/ContentLengthPlugin.php index f313c33..ad69ff3 100644 --- a/src/Plugin/ContentLengthPlugin.php +++ b/src/Plugin/ContentLengthPlugin.php @@ -16,9 +16,6 @@ */ final class ContentLengthPlugin implements Plugin { - /** - * {@inheritdoc} - */ public function handleRequest(RequestInterface $request, callable $next, callable $first): Promise { if (!$request->hasHeader('Content-Length')) { diff --git a/src/Plugin/ContentTypePlugin.php b/src/Plugin/ContentTypePlugin.php index da3758e..e4844c4 100644 --- a/src/Plugin/ContentTypePlugin.php +++ b/src/Plugin/ContentTypePlugin.php @@ -57,9 +57,6 @@ public function __construct(array $config = []) $this->sizeLimit = $options['size_limit']; } - /** - * {@inheritdoc} - */ public function handleRequest(RequestInterface $request, callable $next, callable $first): Promise { if (!$request->hasHeader('Content-Type')) { diff --git a/src/Plugin/CookiePlugin.php b/src/Plugin/CookiePlugin.php index aa4d5d7..6a8942a 100644 --- a/src/Plugin/CookiePlugin.php +++ b/src/Plugin/CookiePlugin.php @@ -33,9 +33,6 @@ public function __construct(CookieJar $cookieJar) $this->cookieJar = $cookieJar; } - /** - * {@inheritdoc} - */ public function handleRequest(RequestInterface $request, callable $next, callable $first): Promise { $cookies = []; diff --git a/src/Plugin/DecoderPlugin.php b/src/Plugin/DecoderPlugin.php index 41c1a58..3e781aa 100644 --- a/src/Plugin/DecoderPlugin.php +++ b/src/Plugin/DecoderPlugin.php @@ -48,9 +48,6 @@ public function __construct(array $config = []) $this->useContentEncoding = $options['use_content_encoding']; } - /** - * {@inheritdoc} - */ public function handleRequest(RequestInterface $request, callable $next, callable $first): Promise { $encodings = extension_loaded('zlib') ? ['gzip', 'deflate'] : ['identity']; diff --git a/src/Plugin/ErrorPlugin.php b/src/Plugin/ErrorPlugin.php index 678977f..712e28a 100644 --- a/src/Plugin/ErrorPlugin.php +++ b/src/Plugin/ErrorPlugin.php @@ -54,9 +54,6 @@ public function __construct(array $config = []) $this->onlyServerException = $options['only_server_exception']; } - /** - * {@inheritdoc} - */ public function handleRequest(RequestInterface $request, callable $next, callable $first): Promise { $promise = $next($request); diff --git a/src/Plugin/HeaderAppendPlugin.php b/src/Plugin/HeaderAppendPlugin.php index 95ea673..e6d6235 100644 --- a/src/Plugin/HeaderAppendPlugin.php +++ b/src/Plugin/HeaderAppendPlugin.php @@ -34,9 +34,6 @@ public function __construct(array $headers) $this->headers = $headers; } - /** - * {@inheritdoc} - */ public function handleRequest(RequestInterface $request, callable $next, callable $first): Promise { foreach ($this->headers as $header => $headerValue) { diff --git a/src/Plugin/HeaderDefaultsPlugin.php b/src/Plugin/HeaderDefaultsPlugin.php index bf58070..baf8f9d 100644 --- a/src/Plugin/HeaderDefaultsPlugin.php +++ b/src/Plugin/HeaderDefaultsPlugin.php @@ -30,9 +30,6 @@ public function __construct(array $headers) $this->headers = $headers; } - /** - * {@inheritdoc} - */ public function handleRequest(RequestInterface $request, callable $next, callable $first): Promise { foreach ($this->headers as $header => $headerValue) { diff --git a/src/Plugin/HeaderRemovePlugin.php b/src/Plugin/HeaderRemovePlugin.php index 9f4ca44..abfb922 100644 --- a/src/Plugin/HeaderRemovePlugin.php +++ b/src/Plugin/HeaderRemovePlugin.php @@ -28,9 +28,6 @@ public function __construct(array $headers) $this->headers = $headers; } - /** - * {@inheritdoc} - */ public function handleRequest(RequestInterface $request, callable $next, callable $first): Promise { foreach ($this->headers as $header) { diff --git a/src/Plugin/HeaderSetPlugin.php b/src/Plugin/HeaderSetPlugin.php index 06f00eb..1ca9fb3 100644 --- a/src/Plugin/HeaderSetPlugin.php +++ b/src/Plugin/HeaderSetPlugin.php @@ -30,9 +30,6 @@ public function __construct(array $headers) $this->headers = $headers; } - /** - * {@inheritdoc} - */ public function handleRequest(RequestInterface $request, callable $next, callable $first): Promise { foreach ($this->headers as $header => $headerValue) { diff --git a/src/Plugin/HistoryPlugin.php b/src/Plugin/HistoryPlugin.php index a1796a6..15597ee 100644 --- a/src/Plugin/HistoryPlugin.php +++ b/src/Plugin/HistoryPlugin.php @@ -29,9 +29,6 @@ public function __construct(Journal $journal) $this->journal = $journal; } - /** - * {@inheritdoc} - */ public function handleRequest(RequestInterface $request, callable $next, callable $first): Promise { $journal = $this->journal; diff --git a/src/Plugin/QueryDefaultsPlugin.php b/src/Plugin/QueryDefaultsPlugin.php index 4c8087c..fc11ba1 100644 --- a/src/Plugin/QueryDefaultsPlugin.php +++ b/src/Plugin/QueryDefaultsPlugin.php @@ -31,9 +31,6 @@ public function __construct(array $queryParams) $this->queryParams = $queryParams; } - /** - * {@inheritdoc} - */ public function handleRequest(RequestInterface $request, callable $next, callable $first): Promise { $uri = $request->getUri(); diff --git a/src/Plugin/RedirectPlugin.php b/src/Plugin/RedirectPlugin.php index ee5c232..beb633e 100644 --- a/src/Plugin/RedirectPlugin.php +++ b/src/Plugin/RedirectPlugin.php @@ -158,9 +158,6 @@ public function __construct(array $config = []) $this->streamFactory = $options['stream_factory']; } - /** - * {@inheritdoc} - */ public function handleRequest(RequestInterface $request, callable $next, callable $first): Promise { // Check in storage diff --git a/src/Plugin/RequestMatcherPlugin.php b/src/Plugin/RequestMatcherPlugin.php index 45d4375..8373409 100644 --- a/src/Plugin/RequestMatcherPlugin.php +++ b/src/Plugin/RequestMatcherPlugin.php @@ -38,9 +38,6 @@ public function __construct(RequestMatcher $requestMatcher, ?Plugin $delegateOnM $this->failurePlugin = $delegateOnNoMatch; } - /** - * {@inheritdoc} - */ public function handleRequest(RequestInterface $request, callable $next, callable $first): Promise { if ($this->requestMatcher->matches($request)) { diff --git a/src/Plugin/RequestSeekableBodyPlugin.php b/src/Plugin/RequestSeekableBodyPlugin.php index 1b6c528..f39c88d 100644 --- a/src/Plugin/RequestSeekableBodyPlugin.php +++ b/src/Plugin/RequestSeekableBodyPlugin.php @@ -15,9 +15,6 @@ */ final class RequestSeekableBodyPlugin extends SeekableBodyPlugin { - /** - * {@inheritdoc} - */ public function handleRequest(RequestInterface $request, callable $next, callable $first): Promise { if (!$request->getBody()->isSeekable()) { diff --git a/src/Plugin/ResponseSeekableBodyPlugin.php b/src/Plugin/ResponseSeekableBodyPlugin.php index 6f941b6..ef8bee4 100644 --- a/src/Plugin/ResponseSeekableBodyPlugin.php +++ b/src/Plugin/ResponseSeekableBodyPlugin.php @@ -16,9 +16,6 @@ */ final class ResponseSeekableBodyPlugin extends SeekableBodyPlugin { - /** - * {@inheritdoc} - */ public function handleRequest(RequestInterface $request, callable $next, callable $first): Promise { return $next($request)->then(function (ResponseInterface $response) { diff --git a/src/Plugin/RetryPlugin.php b/src/Plugin/RetryPlugin.php index 144679e..992bb21 100644 --- a/src/Plugin/RetryPlugin.php +++ b/src/Plugin/RetryPlugin.php @@ -96,9 +96,6 @@ public function __construct(array $config = []) $this->exceptionDelay = $options['exception_delay']; } - /** - * {@inheritdoc} - */ public function handleRequest(RequestInterface $request, callable $next, callable $first): Promise { $chainIdentifier = spl_object_hash((object) $first); diff --git a/src/PluginClient.php b/src/PluginClient.php index db81243..d728c78 100644 --- a/src/PluginClient.php +++ b/src/PluginClient.php @@ -64,9 +64,6 @@ public function __construct($client, array $plugins = [], array $options = []) $this->options = $this->configure($options); } - /** - * {@inheritdoc} - */ public function sendRequest(RequestInterface $request): ResponseInterface { // If the client doesn't support sync calls, call async @@ -87,9 +84,6 @@ public function sendRequest(RequestInterface $request): ResponseInterface return $pluginChain($request)->wait(); } - /** - * {@inheritdoc} - */ public function sendAsyncRequest(RequestInterface $request) { $pluginChain = $this->createPluginChain($this->plugins, function (RequestInterface $request) { diff --git a/src/PluginClientBuilder.php b/src/PluginClientBuilder.php index 8746498..45fd787 100644 --- a/src/PluginClientBuilder.php +++ b/src/PluginClientBuilder.php @@ -31,7 +31,7 @@ public function addPlugin(Plugin $plugin, int $priority = 0): self } /** - * @param mixed $value + * @param string|int|float|bool|string[] $value */ public function setOption(string $name, $value): self {