UnsupportedOperationException::__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 an operation has been called that
6
 * is not supported by the given collection.
7
 * 
8
 * In general, this should only be used by certain types
9
 * of read-only or immutable collections which have the 
10
 * ImmutableCollectionTrait
11
 * @author john
12
 *
13
 */
14
class UnsupportedOperationException extends CollectionException
15
{
16
	/**
17
	 * @var string
18
	 */
19
	protected $operation;
20
	
21
	/**
22
	 * @param string $operation
23
	 */
24
	public function __construct($operation)
25
	{
26
		$this->operation = $operation;
27
		parent::__construct("The $operation operation is not supported");
28
	}
29
	
30
	/**
31
	 * Gets the attempted operation
32
	 * @return string
33
	 */
34
	public function getOperation()
35
	{
36
		return $this->operation;
37
	}
38
}