Lines 100.00% 3 / 3
Functions and Methods 100.00% 2 / 2
Classes and Traits 100.00% 1 / 1
Name Lines Functions and Methods CRAP Classes and Traits
ValidationException 100.00% 3 / 3 100.00% 2 / 2 2 100.00% 1 / 1
 withErrors 100.00% 2 / 2 100.00% 1 / 1 1
 getErrors 100.00% 1 / 1 100.00% 1 / 1 1
1<?php
2
3declare(strict_types=1);
4
5namespace Districts\Editor\Application\Exception;
6
7use RuntimeException;
8
9final class ValidationException extends RuntimeException
10{
11    /**
12     * @var string[]
13     */
14    private array $errors = [];
15
16    /**
17     * @param string[] $errors
18     */
19    public function withErrors(array $errors): self
20    {
21        $this->errors = $errors;
22        return $this;
23    }
24
25    /**
26     * @return string[]
27     */
28    public function getErrors(): array
29    {
30        return $this->errors;
31    }
32}