InvalidRequestException::getPath()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 3
ccs 0
cts 0
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
1
<?php
2
/**
3
 * Copyright (c) 2014 Robin Appelman <[email protected]>
4
 * This file is licensed under the Licensed under the MIT license:
5
 * http://opensource.org/licenses/MIT
6
 */
7
8
namespace Icewind\SMB\Exception;
9
10
class InvalidRequestException extends Exception {
11
	/**
12
	 * @var string
13
	 */
14
	protected $path;
15
16
	public function __construct(string $path = "", int $code = 0, \Throwable $previous = null) {
17
		$class = get_class($this);
18
		$parts = explode('\\', $class);
19
		$baseName = array_pop($parts);
20 434
		parent::__construct('Invalid request for ' . $path . ' (' . $baseName . ')', $code, $previous);
21 434
		$this->path = $path;
22 434
	}
23 434
24 434
	/**
25 434
	 * @return string
26 434
	 */
27
	public function getPath() {
28
		return $this->path;
29
	}
30
}
31