Completed
Pull Request — master (#20)
by Haralan
18:05 queued 16:21
created

Exception_Notfound   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 70%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 12 1
1
<?php
2
3
namespace Openbuildings\Spiderling;
4
5
/**
6
 * @package    Openbuildings\Spiderling
7
 * @author     Ivan Kerin
8
 * @copyright  (c) 2013 OpenBuildings Ltd.
9
 * @license    http://spdx.org/licenses/BSD-3-Clause
10
 */
11
class Exception_Notfound extends Exception {
12
13
	public $driver;
14
	public $locator;
15
16 2
	public function __construct(Locator $locator, Driver $driver)
17
	{
18 2
		$this->driver = $driver;
19 2
		$this->locator = $locator;
20
21 2
		parent::__construct('Item (:type) ":selector", filters :filters, not found by driver ":driver"', array(
22 2
			':type' => $locator->type(),
23 2
			':selector' => $locator->selector(),
24 2
			':driver' => $driver->name,
25
			':filters' => json_encode($locator->filters()),
26
		));
27
	}
28
}
29