Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
| FileConflictException | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
2 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace Hyde\Framework\Exceptions; |
| 6 | |
| 7 | use Exception; |
| 8 | use Hyde\Hyde; |
| 9 | |
| 10 | use function sprintf; |
| 11 | |
| 12 | class FileConflictException extends Exception |
| 13 | { |
| 14 | /** @var string */ |
| 15 | protected $message = 'A file already exists at this path.'; |
| 16 | |
| 17 | /** @var int */ |
| 18 | protected $code = 409; |
| 19 | |
| 20 | public function __construct(?string $path = null) |
| 21 | { |
| 22 | parent::__construct($path ? sprintf('File [%s] already exists.', Hyde::pathToRelative($path)) : $this->message); |
| 23 | } |
| 24 | } |