@@ 7-37 (lines=31) @@ | ||
4 | ||
5 | use Exception as BaseException; |
|
6 | ||
7 | class FileExistsException extends Exception |
|
8 | { |
|
9 | /** |
|
10 | * @var string |
|
11 | */ |
|
12 | protected $path; |
|
13 | ||
14 | /** |
|
15 | * Constructor. |
|
16 | * |
|
17 | * @param string $path |
|
18 | * @param int $code |
|
19 | * @param BaseException $previous |
|
20 | */ |
|
21 | public function __construct($path, $code = 0, BaseException $previous = null) |
|
22 | { |
|
23 | $this->path = $path; |
|
24 | ||
25 | parent::__construct('File already exists at path: ' . $this->getPath(), $code, $previous); |
|
26 | } |
|
27 | ||
28 | /** |
|
29 | * Get the path which was found. |
|
30 | * |
|
31 | * @return string |
|
32 | */ |
|
33 | public function getPath() |
|
34 | { |
|
35 | return $this->path; |
|
36 | } |
|
37 | } |
|
38 |
@@ 7-37 (lines=31) @@ | ||
4 | ||
5 | use Exception as BaseException; |
|
6 | ||
7 | class FileNotFoundException extends Exception |
|
8 | { |
|
9 | /** |
|
10 | * @var string |
|
11 | */ |
|
12 | protected $path; |
|
13 | ||
14 | /** |
|
15 | * Constructor. |
|
16 | * |
|
17 | * @param string $path |
|
18 | * @param int $code |
|
19 | * @param \Exception $previous |
|
20 | */ |
|
21 | public function __construct($path, $code = 0, BaseException $previous = null) |
|
22 | { |
|
23 | $this->path = $path; |
|
24 | ||
25 | parent::__construct('File not found at path: ' . $this->getPath(), $code, $previous); |
|
26 | } |
|
27 | ||
28 | /** |
|
29 | * Get the path which was not found. |
|
30 | * |
|
31 | * @return string |
|
32 | */ |
|
33 | public function getPath() |
|
34 | { |
|
35 | return $this->path; |
|
36 | } |
|
37 | } |
|
38 |