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

InvalidRequestException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 3
Bugs 0 Features 0
Metric Value
wmc 2
c 3
b 0
f 0
lcom 0
cbo 1
dl 0
loc 25
ccs 9
cts 9
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A getPath() 0 3 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