ImmutableListTrait   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 52
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

5 Methods

Rating   Name   Duplication   Size   Complexity  
A addAt() 0 4 1
A removeAt() 0 4 1
A set() 0 4 1
A offsetSet() 0 4 1
A offsetUnset() 0 4 1
1
<?php 
2
namespace Jmw\Collection\Lists;
3
4
use Jmw\Collection\ImmutableCollectionTrait;
5
use Jmw\Collection\Exception\UnsupportedOperationException;
6
/**
7
 * This trait is ensures immutability by throwing an exception
8
 * on all mutable ListInterface methods
9
 * @author john
10
 *
11
 */
12
trait ImmutableListTrait
13
{
14
	use ImmutableCollectionTrait;
15
	
16
	/**
17
	 * @throws UnsupportedOperationException
18
	 */
19
	public function addAt($index, $element)
0 ignored issues
show
Unused Code introduced by
The parameter $index is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $element is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
20
	{
21
		throw new UnsupportedOperationException('addAt');
22
	}
23
	
24
	/**
25
	 * @throws UnsupportedOperationException
26
	 */
27
	public function removeAt($index)
0 ignored issues
show
Unused Code introduced by
The parameter $index is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
28
	{
29
		throw new UnsupportedOperationException('removeAt');
30
	}
31
	
32
	/**
33
	 * @throws UnsupportedOperationException
34
	 */
35
	public function set($index, $element)
0 ignored issues
show
Unused Code introduced by
The parameter $index is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $element is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
36
	{
37
		throw new UnsupportedOperationException('set');
38
	}
39
	
40
	/*********************************************
41
	 ** Array Access Methods
42
	 *********************************************/
43
		
44
	/**
45
	 *
46
	 * {@inheritDoc}
47
	 * @see ArrayAccess::offsetSet()
48
	 */
49
	public function offsetSet($offset, $value)
0 ignored issues
show
Unused Code introduced by
The parameter $offset is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $value is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
50
	{
51
		throw new UnsupportedOperationException('offsetSet');
52
	}
53
	
54
	/**
55
	 *
56
	 * {@inheritDoc}
57
	 * @see ArrayAccess::offsetUnset()
58
	 */
59
	public function offsetUnset($offset)
0 ignored issues
show
Unused Code introduced by
The parameter $offset is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
60
	{
61
		throw new UnsupportedOperationException('offsetUnset');
62
	}
63
}