Passed
Push — 1.x ( cf963f...5ef8bb )
by Ulises Jeremias
03:00
created

ImmutableArray::count()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php namespace Mbh\Collection;
2
3
/**
4
 * MBHFramework
5
 *
6
 * @link      https://github.com/MBHFramework/mbh-framework
7
 * @copyright Copyright (c) 2017 Ulises Jeremias Cornejo Fandos
8
 * @license   https://github.com/MBHFramework/mbh-framework/blob/master/LICENSE (MIT License)
9
 */
10
11
/**
12
 * The Immutable Array
13
 *
14
 * This provides special methods for quickly creating an immutable array,
15
 * either from any Traversable, or using a C-optimized fromArray() to directly
16
 * instantiate from. Also includes methods fundamental to functional
17
 * programming, e.g. map, filter, join, and sort.
18
 *
19
 * @package structures
20
 * @author Ulises Jeremias Cornejo Fandos <[email protected]>
21
 */
22
23
class ImmutableArray extends FixedArray
24
{
25
    public function offsetSet($offset, $value)
26
    {
27
        throw new RuntimeException('Attempt to mutate immutable ' . __CLASS__ . ' object.');
0 ignored issues
show
Bug introduced by
The type Mbh\Collection\RuntimeException was not found. Did you mean RuntimeException? If so, make sure to prefix the type with \.
Loading history...
28
    }
29
30
    public function offsetUnset($offset)
31
    {
32
        throw new RuntimeException('Attempt to mutate immutable ' . __CLASS__ . ' object.');
33
    }
34
35
    public function clear()
36
    {
37
        throw new RuntimeException('Attempt to mutate immutable ' . __CLASS__ . ' object.');
38
    }
39
}
40