Skip to content

Commit

Permalink
PHPCS - fixies
Browse files Browse the repository at this point in the history
  • Loading branch information
pekral committed May 31, 2020
1 parent 1d6836b commit 985a240
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 62 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@
"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",
"phpstan/phpstan-phpunit": "^0.12.8",
"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
Expand Down
5 changes: 3 additions & 2 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 1 addition & 10 deletions ruleset.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<ruleset name="EcomailFlexiBeePClientProject">
<ruleset name="EcomailFlexiBeeClientProject">
<!-- Base PHPCS configuration -->
<config name="installed_paths" value="../../slevomat/coding-standard"/>
<arg name="extensions" value="php,inc" />
Expand Down Expand Up @@ -163,13 +163,4 @@
<rule ref="SlevomatCodingStandard.PHP.UselessParentheses.UselessParentheses"/>
<rule ref="SlevomatCodingStandard.Functions.RequireArrowFunction"/>
<rule ref="SlevomatCodingStandard.ControlStructures.RequireNullCoalesceEqualOperator"/>

<!-- Enable after refactoring -->
<exclude name="SlevomatCodingStandard.Functions.UnusedParameter"/>
<exclude name="SlevomatCodingStandard.TypeHints.DisallowMixedTypeHint"/>

<!-- Enable for PHP 7.4 -->
<exclude name="SlevomatCodingStandard.Functions.RequireArrowFunction"/>
<exclude name="SlevomatCodingStandard.ControlStructures.RequireNullCoalesceEqualOperator"/>
</rule>
</ruleset>
26 changes: 1 addition & 25 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ public function getAllApiChanges(?string $fromVersion): Response

/**
* @param array<mixed> $parameters
* @return string
*/
public function getLoginFormUrl(array $parameters): string
{
Expand Down Expand Up @@ -149,9 +148,7 @@ public function deleteByCode(string $id, bool $dryRun = false): void
}

/**
* @param int $id
* @param array<mixed> $uriParameters
* @return \EcomailFlexibee\Result\EvidenceResult
* @throws \EcomailFlexibee\Exception\EcomailFlexibeeConnectionError
* @throws \EcomailFlexibee\Exception\EcomailFlexibeeForbidden
* @throws \EcomailFlexibee\Exception\EcomailFlexibeeInvalidAuthorization
Expand All @@ -169,9 +166,7 @@ public function findById(int $id, array $uriParameters = []): EvidenceResult
}

/**
* @param string $code
* @param array<mixed> $uriParameters
* @return \EcomailFlexibee\Result\EvidenceResult
* @throws \EcomailFlexibee\Exception\EcomailFlexibeeConnectionError
* @throws \EcomailFlexibee\Exception\EcomailFlexibeeForbidden
* @throws \EcomailFlexibee\Exception\EcomailFlexibeeInvalidAuthorization
Expand All @@ -197,9 +192,7 @@ public function getByCode(string $code, array $uriParameters = []): EvidenceResu
}

/**
* @param int $id
* @param array<string> $uriParameters
* @return \EcomailFlexibee\Result\EvidenceResult
* @throws \EcomailFlexibee\Exception\EcomailFlexibeeConnectionError
* @throws \EcomailFlexibee\Exception\EcomailFlexibeeForbidden
* @throws \EcomailFlexibee\Exception\EcomailFlexibeeInvalidAuthorization
Expand All @@ -224,9 +217,7 @@ public function getById(int $id, array $uriParameters = []): EvidenceResult
}

/**
* @param string $code
* @param array<mixed> $uriParameters
* @return \EcomailFlexibee\Result\EvidenceResult
* @throws \EcomailFlexibee\Exception\EcomailFlexibeeConnectionError
* @throws \EcomailFlexibee\Exception\EcomailFlexibeeForbidden
* @throws \EcomailFlexibee\Exception\EcomailFlexibeeInvalidAuthorization
Expand All @@ -246,10 +237,7 @@ public function findByCode(string $code, array $uriParameters = []): EvidenceRes

/**
* @param array<mixed> $evidenceData
* @param int|null $id
* @param bool $dryRun
* @param array<mixed> $uriParameters
* @return \EcomailFlexibee\Http\Response\FlexibeeResponse
* @throws \EcomailFlexibee\Exception\EcomailFlexibeeConnectionError
* @throws \EcomailFlexibee\Exception\EcomailFlexibeeForbidden
* @throws \EcomailFlexibee\Exception\EcomailFlexibeeInvalidAuthorization
Expand Down Expand Up @@ -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
Expand All @@ -384,7 +370,6 @@ public function chunkInEvidence(int $start, int $limit): array
}

/**
* @param string $query
* @param array<string> $uriParameters
* @return array<\EcomailFlexibee\Result\EvidenceResult>
* @throws \EcomailFlexibee\Exception\EcomailFlexibeeConnectionError
Expand All @@ -409,7 +394,6 @@ public function searchInEvidence(string $query, array $uriParameters): array
}

/**
* @param \EcomailFlexibee\Http\Method $httpMethod
* @param mixed $queryFilterOrId
* @param array<mixed> $uriParameters
* @param array<mixed> $postFields
Expand All @@ -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),
Expand All @@ -443,9 +421,7 @@ public function callRequest(
}

/**
* @param int $id
* @param array<mixed> $uriParameters
* @return \EcomailFlexibee\Http\Response\Response
* @throws \EcomailFlexibee\Exception\EcomailFlexibeeConnectionError
* @throws \EcomailFlexibee\Exception\EcomailFlexibeeForbidden
* @throws \EcomailFlexibee\Exception\EcomailFlexibeeInvalidAuthorization
Expand Down
6 changes: 0 additions & 6 deletions src/Http/Response/FlexibeeResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -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<mixed> $data
* @param array<string> $statistics
*/
Expand Down
1 change: 0 additions & 1 deletion src/Http/ResponseFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ public static function createFromOutput(

/**
* @param array<mixed> $errors
* @param int $statusCode
* @throws \EcomailFlexibee\Exception\EcomailFlexibeeRequestError
*/
private static function throwErrorMessage(array $errors, int $statusCode): void
Expand Down
5 changes: 1 addition & 4 deletions src/Http/ResponseHydrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ public function __construct(Config $config)
}

/**
* @param \EcomailFlexibee\Http\Response\Response $response
* @return array<\EcomailFlexibee\Result\EvidenceResult>
* @throws \EcomailFlexibee\Exception\EcomailFlexibeeRequestError
*/
Expand All @@ -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
Expand Down
12 changes: 0 additions & 12 deletions src/Http/UrlBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ public function createAuthTokenUrl(): string

/**
* @param array<mixed> $uriParameters
* @return string
*/
public function createLoginFormUrl(array $uriParameters): string
{
Expand All @@ -48,9 +47,7 @@ public function createLoginFormUrl(array $uriParameters): string
}

/**
* @param int $id
* @param array<mixed> $uriParameters
* @return string
*/
public function createPdfUrl(int $id, array $uriParameters): string
{
Expand All @@ -76,7 +73,6 @@ public function createRestoreUrl(string $companyName): string

/**
* @param array<mixed> $uriParameters
* @return string
*/
public function createChangesUrl(array $uriParameters = []): string
{
Expand All @@ -95,7 +91,6 @@ public function createChangesStatusUrl(): string

/**
* @param array<mixed> $uriParameters
* @return string
*/
public function createUriByEvidenceOnly(array $uriParameters): string
{
Expand All @@ -106,9 +101,7 @@ public function createUriByEvidenceOnly(array $uriParameters): string
}

/**
* @param string $filterQuery
* @param array<mixed> $uriParameters
* @return string
*/
public function createFilterQuery(string $filterQuery, array $uriParameters): string
{
Expand All @@ -119,9 +112,7 @@ public function createFilterQuery(string $filterQuery, array $uriParameters): st
}

/**
* @param string $code
* @param array<mixed> $uriParameters
* @return string
* @throws \EcomailFlexibee\Exception\EcomailFlexibeeInvalidRequestParameter
*/
public function createUriByCodeOnly(string $code, array $uriParameters): string
Expand All @@ -145,7 +136,6 @@ public function getUrl(): string
/**
* @param mixed $filterQueryOrId
* @param array<mixed> $uriParams
* @return string
*/
public function createUri($filterQueryOrId, array $uriParams): string
{
Expand All @@ -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
{
Expand Down

0 comments on commit 985a240

Please sign in to comment.