Skip to content

Commit

Permalink
Fix code style
Browse files Browse the repository at this point in the history
  • Loading branch information
Art4 committed Oct 11, 2024
1 parent 2d7c8b2 commit bb22206
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@
'@PHPUnit84Migration:risky' => true,
])
->setFinder($finder)
->setRiskyAllowed(true)
;
2 changes: 1 addition & 1 deletion src/Psr/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ public function getStatusCode(): int
* @return static
* @throws \InvalidArgumentException For invalid status code arguments.
*/
public function withStatus(int $code, string $reasonPhrase = ''): ResponseInterface
public function withStatus(int $code, string $reasonPhrase = ''): ResponseInterface
{
$response = clone($this);
$response->status_code = $code;
Expand Down
10 changes: 5 additions & 5 deletions src/Psr/Uri.php
Original file line number Diff line number Diff line change
Expand Up @@ -514,16 +514,16 @@ public function __toString(): string

$path = $this->getPath();

// If the path is rootless and an authority is present, the path MUST
// be prefixed by "/".
if (strncmp($path, '/', 1) !== 0 && $authority !== '') {
// If the path is rootless and an authority is present, the path MUST
// be prefixed by "/".
$string .= '/' . $path;
// If the path is starting with more than one "/" and no authority is
// present, the starting slashes MUST be reduced to one.
} elseif (strncmp($path, '//', 2) === 0 && $authority === '') {
// If the path is starting with more than one "/" and no authority is
// present, the starting slashes MUST be reduced to one.
$string .= '/' . ltrim($path, '/');
// The path can be concatenated without delimiters
} else {
// The path can be concatenated without delimiters
$string .= $path;
}

Expand Down

0 comments on commit bb22206

Please sign in to comment.