Passed
Branch dev (5c692d)
by Alan
02:14
created

InvalidConfigFilePathException::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 3
dl 0
loc 5
rs 10
1
<?php
2
3
namespace FigTree\Config\Exceptions;
4
5
use Throwable;
6
use RuntimeException;
7
use FigTree\Exceptions\Contracts\SevereExceptionInterface;
8
use FigTree\Exceptions\Concerns\{
9
	HasSeverity,
10
	SetsLocation
11
};
12
13
/**
14
 * Exception thrown when a Config file is outside the search directories.
15
 */
16
class InvalidConfigFilePathException extends RuntimeException implements SevereExceptionInterface
17
{
18
	use HasSeverity;
19
	use SetsLocation;
20
21
	protected int $severity = E_ERROR;
22
23
	/**
24
	 * Exception thrown when a Config file is outside the search directories.
25
	 *
26
	 * @param string $filename The path to the Config file.
27
	 * @param int $code The Exception code.
28
	 * @param \Throwable $previous The previous throwable used for the exception chaining.
29
	 */
30
	public function __construct(string $filename, int $code = 0, Throwable $previous = null)
31
	{
32
		$message = sprintf('Config file %s is outside the search directories.', $filename);
33
34
		parent::__construct($message, $code, $previous);
35
	}
36
}
37