Completed
Push — PSR-11-2 ( a5ad88...7f5041 )
by Nikolaos
03:59
created

ReadOnly   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 50%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 27
c 0
b 0
f 0
ccs 4
cts 8
cp 0.5
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A remove() 0 4 1
A set() 0 4 1
1
<?php
2
3
/**
4
 * This file is part of the Phalcon Framework.
5
 *
6
 * (c) Phalcon Team <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE.txt
9
 * file that was distributed with this source code.
10
 */
11
12
declare(strict_types=1);
13
14
namespace Phalcon\Collection;
15
16
use Phalcon\Collection;
17
18
/**
19
 * Phalcon\Collection\ReadOnly is a read only Collection object
20
 */
21
class ReadOnly extends Collection
22
{
23
    /**
24
     * Delete the element from the collection
25
     *
26
     * @param string $element
27
     *
28
     * @throws Exception
29
     */
30 1
    public function remove(string $element): void
31
    {
32 1
        throw new Exception("The object is read only");
33
    }
34
35
    /**
36
     * Set an element in the collection
37
     *
38
     * @param string $element
39
     * @param mixed  $value
40
     *
41
     * @throws Exception
42
     */
43 1
    public function set(string $element, $value): void
44
    {
45 1
        throw new Exception("The object is read only");
46
    }
47
}
48