1 | <?php |
||
11 | class Error { |
||
12 | |||
13 | public const SEVERITY_ERROR = 9; |
||
14 | public const SEVERITY_WARNING = 4; |
||
15 | |||
16 | private $text; |
||
17 | private $severity; |
||
18 | private $property; |
||
19 | |||
20 | private $code; |
||
21 | private $params; |
||
22 | |||
23 | 8 | public static function newError( string $text = '', string $property = null, string $code = 'invalid', array $params = [] ): self { |
|
26 | |||
27 | 8 | protected function __construct( string $text, int $severity, ?string $property, string $code, array $params ) { |
|
34 | |||
35 | 7 | public function getText(): string { |
|
38 | |||
39 | /** |
||
40 | * @return integer, element of the ValueValidatorError::SEVERITY_ enum |
||
|
|||
41 | */ |
||
42 | public function getSeverity(): int { |
||
43 | return $this->severity; |
||
44 | } |
||
45 | |||
46 | /** |
||
47 | * Returns the property of the value for which the error occurred, or null if it occurred for the value itself. |
||
48 | */ |
||
49 | 8 | public function getProperty(): ?string { |
|
52 | |||
53 | 1 | public function getParameters(): array { |
|
56 | |||
57 | 2 | public function getCode(): string { |
|
60 | |||
61 | } |
||
62 |
This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.