Completed
Pull Request — master (#20)
by Haralan
11:12 queued 09:14
created

Exception_Notfound::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 1.027

Importance

Changes 2
Bugs 0 Features 1
Metric Value
c 2
b 0
f 1
dl 0
loc 12
ccs 7
cts 10
cp 0.7
rs 9.4285
cc 1
eloc 8
nc 1
nop 2
crap 1.027
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