IndexOutOfBoundsException::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 5
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
namespace Jmw\Collection\Exception;
3
4
/**
5
 * Thrown when the given index is out of bounds
6
 * @author john
7
 *
8
 */
9
class IndexOutOfBoundsException extends CollectionException
10
{
11
	/**
12
	 * 
13
	 * @var int
14
	 */
15
	protected $index;
16
	
17
	/**
18
	 * 
19
	 * @param int $index
20
	 */
21
	public function __construct($index)
22
	{
23
		$this->index = $index;
24
		parent::__construct("$index was out of bounds");
25
	}
26
	
27
	/**
28
	 * 
29
	 * @return number
30
	 */
31
	public function getIndex()
32
	{
33
		return $this->index;
34
	}
35
}