Completed
Push — master ( db51c6...b72e43 )
by Robin
04:26
created

InvalidRequestException::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 1

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 7
ccs 7
cts 7
cp 1
rs 9.4285
cc 1
eloc 6
nc 1
nop 2
crap 1
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
	/**
17
	 * @param string $path
18
	 * @param int $code
19
	 */
20 434
	public function __construct($path, $code = 0) {
21 434
		$class = get_class($this);
22 434
		$parts = explode('\\', $class);
23 434
		$baseName = array_pop($parts);
24 434
		parent::__construct('Invalid request for ' . $path . ' (' . $baseName . ')', $code);
25 434
		$this->path = $path;
26 434
	}
27
28
	/**
29
	 * @return string
30
	 */
31 4
	public function getPath() {
32 4
		return $this->path;
33
	}
34
}
35