Passed
Branch dev (e23247)
by Alan
01:51
created

InvalidDirectoryException::onFileLine()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 4
nc 2
nop 2
dl 0
loc 8
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace FigTree\Exceptions;
4
5
use Throwable;
6
7
/**
8
 * Exception thrown when a path is expected to be a directory but is not a directory.
9
 */
10
class InvalidDirectoryException extends RuntimeException
11
{
12
	/**
13
	 * Exception thrown when a path is expected to be a directory but is not a directory.
14
	 *
15
	 * @param string $path The path being checked as a directory.
16
	 * @param int $code The Exception code.
17
	 * @param \Throwable $previous The previous throwable used for the exception chaining.
18
	 */
19
	public function __construct(string $path, int $code = 0, Throwable $previous = null)
20
	{
21
		$this->severity = E_RECOVERABLE_ERROR;
22
23
		$message = sprintf('Path %s is not a directory.', $path);
24
25
		parent::__construct($message, $code, $previous);
26
	}
27
}
28