Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
CRAP
100.00% covered (success)
100.00%
1 / 1
FileConflictException
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
2
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
2
1<?php
2
3declare(strict_types=1);
4
5namespace Hyde\Framework\Exceptions;
6
7use Exception;
8use Hyde\Hyde;
9
10use function sprintf;
11
12class 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}