Skip to content

Commit

Permalink
Fix More Code Style Issues
Browse files Browse the repository at this point in the history
  • Loading branch information
wolffc committed Mar 1, 2022
1 parent 0141c17 commit 2383efb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions src/PSR7/SpecFinder.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
use function json_decode;
use function json_encode;
use function property_exists;
use function substr;

final class SpecFinder
{
Expand Down Expand Up @@ -211,10 +212,10 @@ public function findResponseSpec($addr): ResponseSpec

$response = $operation->responses->getResponse((string) $addr->responseCode());

if (! $response){
$response = $operation->responses->getResponse(substr((string)$addr->responseCode(),0,1) . 'XX');
if (! $response) {
$response = $operation->responses->getResponse(substr((string) $addr->responseCode(), 0, 1) . 'XX');
}

if (! $response) {
$response = $operation->responses->getResponse('default');
}
Expand Down
4 changes: 2 additions & 2 deletions tests/PSR7/SpecFinderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,8 @@ public function testResponseStatusCodesWithWildcards(): void
type: string
YAML;

$schema = (new ValidatorBuilder())->fromYaml($yaml)->getServerRequestValidator()->getSchema();
$specFinder = new SpecFinder($schema);
$schema = (new ValidatorBuilder())->fromYaml($yaml)->getServerRequestValidator()->getSchema();
$specFinder = new SpecFinder($schema);
$responseSpec = $specFinder->findResponseSpec(
new ResponseAddress('/products.find', 'get', 404)
);
Expand Down

0 comments on commit 2383efb

Please sign in to comment.