From 985a24015184e230d0f80e7e8f9e1525f75bea37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Kr=C3=A1l?= Date: Sun, 31 May 2020 12:59:54 +0200 Subject: [PATCH] PHPCS - fixies --- composer.json | 4 ++-- composer.lock | 5 +++-- ruleset.xml | 11 +---------- src/Client.php | 26 +------------------------- src/Http/Response/FlexibeeResponse.php | 6 ------ src/Http/ResponseFactory.php | 1 - src/Http/ResponseHydrator.php | 5 +---- src/Http/UrlBuilder.php | 12 ------------ 8 files changed, 8 insertions(+), 62 deletions(-) diff --git a/composer.json b/composer.json index bda5fb6..29d07a6 100644 --- a/composer.json +++ b/composer.json @@ -20,6 +20,7 @@ "fzaninotto/faker": "^1.7", "mockery/mockery": "^1.3", "phing/phing": "^2.16", + "php-parallel-lint/php-parallel-lint": "^1.2", "phpstan/extension-installer": "^1.0", "phpstan/phpstan": "^0.12.3", "phpstan/phpstan-deprecation-rules": "^0.12.2", @@ -27,8 +28,7 @@ "phpstan/phpstan-strict-rules": "^0.12.2", "phpunit/phpunit": "^9.0", "slevomat/coding-standard": "^6.0", - "sllh/composer-versions-check": "^2.0", - "php-parallel-lint/php-parallel-lint": "^1.2" + "sllh/composer-versions-check": "^2.0" }, "config": { "sort-packages": true diff --git a/composer.lock b/composer.lock index c5aa91c..97831a8 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "622a5d7318ec6a9bac672c7e77ac7ea3", + "content-hash": "189d878955925fa3a836318f6de52a99", "packages": [ { "name": "consistence/consistence", @@ -2936,5 +2936,6 @@ "ext-mbstring": "*", "ext-simplexml": "*" }, - "platform-dev": [] + "platform-dev": [], + "plugin-api-version": "1.1.0" } diff --git a/ruleset.xml b/ruleset.xml index ed03d30..22aed67 100644 --- a/ruleset.xml +++ b/ruleset.xml @@ -1,5 +1,5 @@ - + @@ -163,13 +163,4 @@ - - - - - - - - - diff --git a/src/Client.php b/src/Client.php index 2690819..3cc683e 100644 --- a/src/Client.php +++ b/src/Client.php @@ -97,7 +97,6 @@ public function getAllApiChanges(?string $fromVersion): Response /** * @param array $parameters - * @return string */ public function getLoginFormUrl(array $parameters): string { @@ -149,9 +148,7 @@ public function deleteByCode(string $id, bool $dryRun = false): void } /** - * @param int $id * @param array $uriParameters - * @return \EcomailFlexibee\Result\EvidenceResult * @throws \EcomailFlexibee\Exception\EcomailFlexibeeConnectionError * @throws \EcomailFlexibee\Exception\EcomailFlexibeeForbidden * @throws \EcomailFlexibee\Exception\EcomailFlexibeeInvalidAuthorization @@ -169,9 +166,7 @@ public function findById(int $id, array $uriParameters = []): EvidenceResult } /** - * @param string $code * @param array $uriParameters - * @return \EcomailFlexibee\Result\EvidenceResult * @throws \EcomailFlexibee\Exception\EcomailFlexibeeConnectionError * @throws \EcomailFlexibee\Exception\EcomailFlexibeeForbidden * @throws \EcomailFlexibee\Exception\EcomailFlexibeeInvalidAuthorization @@ -197,9 +192,7 @@ public function getByCode(string $code, array $uriParameters = []): EvidenceResu } /** - * @param int $id * @param array $uriParameters - * @return \EcomailFlexibee\Result\EvidenceResult * @throws \EcomailFlexibee\Exception\EcomailFlexibeeConnectionError * @throws \EcomailFlexibee\Exception\EcomailFlexibeeForbidden * @throws \EcomailFlexibee\Exception\EcomailFlexibeeInvalidAuthorization @@ -224,9 +217,7 @@ public function getById(int $id, array $uriParameters = []): EvidenceResult } /** - * @param string $code * @param array $uriParameters - * @return \EcomailFlexibee\Result\EvidenceResult * @throws \EcomailFlexibee\Exception\EcomailFlexibeeConnectionError * @throws \EcomailFlexibee\Exception\EcomailFlexibeeForbidden * @throws \EcomailFlexibee\Exception\EcomailFlexibeeInvalidAuthorization @@ -246,10 +237,7 @@ public function findByCode(string $code, array $uriParameters = []): EvidenceRes /** * @param array $evidenceData - * @param int|null $id - * @param bool $dryRun * @param array $uriParameters - * @return \EcomailFlexibee\Http\Response\FlexibeeResponse * @throws \EcomailFlexibee\Exception\EcomailFlexibeeConnectionError * @throws \EcomailFlexibee\Exception\EcomailFlexibeeForbidden * @throws \EcomailFlexibee\Exception\EcomailFlexibeeInvalidAuthorization @@ -359,8 +347,6 @@ public function countInEvidence(): int } /** - * @param int $start - * @param int $limit * @return array<\EcomailFlexibee\Result\EvidenceResult> * @throws \EcomailFlexibee\Exception\EcomailFlexibeeConnectionError * @throws \EcomailFlexibee\Exception\EcomailFlexibeeForbidden @@ -384,7 +370,6 @@ public function chunkInEvidence(int $start, int $limit): array } /** - * @param string $query * @param array $uriParameters * @return array<\EcomailFlexibee\Result\EvidenceResult> * @throws \EcomailFlexibee\Exception\EcomailFlexibeeConnectionError @@ -409,7 +394,6 @@ public function searchInEvidence(string $query, array $uriParameters): array } /** - * @param \EcomailFlexibee\Http\Method $httpMethod * @param mixed $queryFilterOrId * @param array $uriParameters * @param array $postFields @@ -422,13 +406,7 @@ public function searchInEvidence(string $query, array $uriParameters): array * @throws \EcomailFlexibee\Exception\EcomailFlexibeeNotAcceptableRequest * @throws \EcomailFlexibee\Exception\EcomailFlexibeeRequestError */ - public function callRequest( - Method $httpMethod, - $queryFilterOrId, - array $uriParameters, - array $postFields, - array $headers - ): array + public function callRequest(Method $httpMethod, $queryFilterOrId, array $uriParameters, array $postFields, array $headers): array { $response = $this->httpClient->request( $this->queryBuilder->createUri($queryFilterOrId, $uriParameters), @@ -443,9 +421,7 @@ public function callRequest( } /** - * @param int $id * @param array $uriParameters - * @return \EcomailFlexibee\Http\Response\Response * @throws \EcomailFlexibee\Exception\EcomailFlexibeeConnectionError * @throws \EcomailFlexibee\Exception\EcomailFlexibeeForbidden * @throws \EcomailFlexibee\Exception\EcomailFlexibeeInvalidAuthorization diff --git a/src/Http/Response/FlexibeeResponse.php b/src/Http/Response/FlexibeeResponse.php index d11042d..191f265 100644 --- a/src/Http/Response/FlexibeeResponse.php +++ b/src/Http/Response/FlexibeeResponse.php @@ -30,12 +30,6 @@ class FlexibeeResponse implements Response /** * FlexibeeResponse constructor. * - * @param int $statusCode - * @param float|null $version - * @param bool $success - * @param string|null $message - * @param int $rowCount - * @param int|null $globalVersion * @param array $data * @param array $statistics */ diff --git a/src/Http/ResponseFactory.php b/src/Http/ResponseFactory.php index 2c866ae..927a6f1 100644 --- a/src/Http/ResponseFactory.php +++ b/src/Http/ResponseFactory.php @@ -130,7 +130,6 @@ public static function createFromOutput( /** * @param array $errors - * @param int $statusCode * @throws \EcomailFlexibee\Exception\EcomailFlexibeeRequestError */ private static function throwErrorMessage(array $errors, int $statusCode): void diff --git a/src/Http/ResponseHydrator.php b/src/Http/ResponseHydrator.php index 04d7d9c..c3611c9 100644 --- a/src/Http/ResponseHydrator.php +++ b/src/Http/ResponseHydrator.php @@ -20,7 +20,6 @@ public function __construct(Config $config) } /** - * @param \EcomailFlexibee\Http\Response\Response $response * @return array<\EcomailFlexibee\Result\EvidenceResult> * @throws \EcomailFlexibee\Exception\EcomailFlexibeeRequestError */ @@ -44,9 +43,7 @@ public function convertResponseToEvidenceResults(Response $response): array return [new EvidenceResult($data)]; } - return \array_map(static function (array $data) { - return new EvidenceResult($data); - }, $data[$this->config->getEvidence()]); + return \array_map(static fn (array $data) => new EvidenceResult($data), $data[$this->config->getEvidence()]); } public function convertResponseToEvidenceResult(Response $response, bool $throwException): EvidenceResult diff --git a/src/Http/UrlBuilder.php b/src/Http/UrlBuilder.php index 177d74a..fbbe43e 100644 --- a/src/Http/UrlBuilder.php +++ b/src/Http/UrlBuilder.php @@ -37,7 +37,6 @@ public function createAuthTokenUrl(): string /** * @param array $uriParameters - * @return string */ public function createLoginFormUrl(array $uriParameters): string { @@ -48,9 +47,7 @@ public function createLoginFormUrl(array $uriParameters): string } /** - * @param int $id * @param array $uriParameters - * @return string */ public function createPdfUrl(int $id, array $uriParameters): string { @@ -76,7 +73,6 @@ public function createRestoreUrl(string $companyName): string /** * @param array $uriParameters - * @return string */ public function createChangesUrl(array $uriParameters = []): string { @@ -95,7 +91,6 @@ public function createChangesStatusUrl(): string /** * @param array $uriParameters - * @return string */ public function createUriByEvidenceOnly(array $uriParameters): string { @@ -106,9 +101,7 @@ public function createUriByEvidenceOnly(array $uriParameters): string } /** - * @param string $filterQuery * @param array $uriParameters - * @return string */ public function createFilterQuery(string $filterQuery, array $uriParameters): string { @@ -119,9 +112,7 @@ public function createFilterQuery(string $filterQuery, array $uriParameters): st } /** - * @param string $code * @param array $uriParameters - * @return string * @throws \EcomailFlexibee\Exception\EcomailFlexibeeInvalidRequestParameter */ public function createUriByCodeOnly(string $code, array $uriParameters): string @@ -145,7 +136,6 @@ public function getUrl(): string /** * @param mixed $filterQueryOrId * @param array $uriParams - * @return string */ public function createUri($filterQueryOrId, array $uriParams): string { @@ -162,8 +152,6 @@ public function createUri($filterQueryOrId, array $uriParams): string /** * @param string|int $filterQueryOrId - * @param string $format - * @return \Purl\Path */ private function buildPathWithIdOrFilter($filterQueryOrId, string $format = 'json'): Path {