InvalidDirectoryException   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 16
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
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
		$message = sprintf('Path %s is not a directory.', $path);
22
23
		parent::__construct($message, $code, $previous);
24
25
		$this->severity = E_RECOVERABLE_ERROR;
26
	}
27
}
28