InvalidFileException::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
nc 1
nop 3
dl 0
loc 7
rs 10
c 1
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 file but is not a file.
9
 */
10
class InvalidFileException extends RuntimeException
11
{
12
	/**
13
	 * Exception thrown when a path is expected to be a file but is not a file.
14
	 *
15
	 * @param string $path The path being checked as a file.
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 file.', $path);
22
23
		parent::__construct($message, $code, $previous);
24
25
		$this->severity = E_RECOVERABLE_ERROR;
26
	}
27
}
28