Skip to content

Commit 9330edd

Browse files
author
Mohamed Khaled
committed
Fix code style violations in HTTP exception classes
1 parent d2f5d62 commit 9330edd

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

src/Providers/Http/Exception/NetworkException.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,11 @@ public function getRequest(): RequestInterface
5959
{
6060
if ($this->request === null) {
6161
throw new \RuntimeException(
62-
'Request object not available. This exception was directly instantiated. Use fromPsr18NetworkException() factory method for PSR-18 compliance.'
62+
'Request object not available. This exception was directly instantiated. ' .
63+
'Use fromPsr18NetworkException() factory method for PSR-18 compliance.'
6364
);
6465
}
65-
66+
6667
return $this->request;
6768
}
6869
}

src/Providers/Http/Exception/RequestException.php

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,12 @@ class RequestException extends InvalidArgumentException implements RequestExcept
3535
* @param string $errorDetail Details about what made the request bad.
3636
* @return self
3737
*/
38-
public static function fromBadRequest(RequestInterface $request, string $errorDetail = 'Invalid request parameters'): self
39-
{
38+
public static function fromBadRequest(
39+
RequestInterface $request,
40+
string $errorDetail = 'Invalid request parameters'
41+
): self {
4042
$message = sprintf('Bad request to %s (400): %s', (string) $request->getUri(), $errorDetail);
41-
43+
4244
$exception = new self($message);
4345
$exception->request = $request;
4446
return $exception;
@@ -52,7 +54,7 @@ public static function fromBadRequest(RequestInterface $request, string $errorDe
5254
* @param string $uri The URI that was requested.
5355
* @param string $errorDetail Details about what made the request bad.
5456
* @return self
55-
*
57+
*
5658
* @deprecated Use fromBadRequest() with RequestInterface for PSR-18 compliance
5759
*/
5860
public static function fromBadRequestToUri(string $uri, string $errorDetail = 'Invalid request parameters'): self
@@ -72,10 +74,11 @@ public function getRequest(): RequestInterface
7274
{
7375
if ($this->request === null) {
7476
throw new \RuntimeException(
75-
'Request object not available. This exception was created using the deprecated fromBadRequestToUri() method. Use fromBadRequest() instead for PSR-18 compliance.'
77+
'Request object not available. This exception was created using the deprecated ' .
78+
'fromBadRequestToUri() method. Use fromBadRequest() instead for PSR-18 compliance.'
7679
);
7780
}
78-
81+
7982
return $this->request;
8083
}
8184
}

0 commit comments

Comments
 (0)