Skip to content

Commit 615b2e4

Browse files
committed
[CodeQuality] Skip custom exception param order flipped on no namespace on ThrowWithPreviousExceptionRector
1 parent e934bd7 commit 615b2e4

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?php
2+
3+
/**
4+
* No Namespace and multiple classes is on purpose to reproduce the issue
5+
*/
6+
class HttpException extends \RuntimeException
7+
{
8+
private int $statusCode;
9+
private array $headers;
10+
11+
public function __construct(int $statusCode, string $message = '', ?\Throwable $previous = null, array $headers = [], int $code = 0)
12+
{
13+
$this->statusCode = $statusCode;
14+
$this->headers = $headers;
15+
16+
parent::__construct($message, $code, $previous);
17+
}
18+
}
19+
20+
class BadGatewayHttpException extends HttpException
21+
{
22+
public function __construct(string $message = '', ?Throwable $previous = null, array $headers = [], int $code = 0)
23+
{
24+
parent::__construct(Response::HTTP_BAD_GATEWAY, $message, $previous, $headers, $code);
25+
}
26+
}
27+
28+
29+
try {
30+
// do sth
31+
} catch (\Throwable $exception) {
32+
throw new BadGatewayHttpException('test exception', $exception);
33+
}

0 commit comments

Comments
 (0)