InvalidTypeException   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 2
Bugs 1 Features 0
Metric Value
wmc 3
c 2
b 1
f 0
lcom 0
cbo 1
dl 0
loc 45
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A getExpected() 0 4 1
A getReceived() 0 4 1
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
}