InvalidTypeException::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 7
rs 9.4285
cc 1
eloc 4
nc 1
nop 2
1
<?php
2
namespace Jmw\Collection\Exception;
3
4
/**
5
 * Thrown when an invalid type is encountered
6
 * Allows certain collections to have a modicum 
7
 * of type checking
8
 * @author john
9
 *
10
 */
11
class InvalidTypeException extends CollectionException
12
{
13
	/**
14
	 * 
15
	 * @var multitype
16
	 */
17
	protected $expected;
18
	
19
	/**
20
	 * 
21
	 * @var multitype
22
	 */
23
	protected $received;
24
	
25
	/**
26
	 * 
27
	 * @param multitype $expected
28
	 * @param multitype $received
29
	 */
30
	public function __construct($expected, $received)
31
	{
32
		$this->expected = $expected;
33
		$this->received = $received;
34
		
35
		parent::__construct("Expected {$expected}, received $received");
36
	}
37
	
38
	/**
39
	 * 
40
	 * @return multitype
41
	 */
42
	public function getExpected()
43
	{
44
		return $this->expected;
45
	}
46
	
47
	/**
48
	 * 
49
	 * @return multitype
50
	 */
51
	public function getReceived()
52
	{
53
		return $this->received;
54
	}
55
}