-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Expand file tree
/
Copy pathHttpException.php
More file actions
36 lines (29 loc) · 880 Bytes
/
HttpException.php
File metadata and controls
36 lines (29 loc) · 880 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php declare(strict_types=1);
namespace Shopware\Core\Framework;
use Shopware\Core\Framework\Log\Package;
#[Package('framework')]
abstract class HttpException extends ShopwareHttpException
{
protected static string $couldNotFindMessage = 'Could not find {{ entity }} with {{ field }} "{{ value }}"';
public function __construct(
protected int $statusCode,
protected string $errorCode,
string $message,
array $parameters = [],
?\Throwable $previous = null
) {
parent::__construct($message, $parameters, $previous);
}
public function getErrorCode(): string
{
return $this->errorCode;
}
public function getStatusCode(): int
{
return $this->statusCode;
}
public function is(string ...$code): bool
{
return \in_array($this->errorCode, $code, true);
}
}