Passed
Push — master ( 0966fb...0f94e0 )
by Luka
18:04
created

ReadOnly::__set()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 5
ccs 3
cts 3
cp 1
rs 9.4285
cc 1
eloc 3
nc 1
nop 2
crap 1
1
<?php
2
3
namespace Teto\Object;
4
5
/**
6
 * Restrict write to not accessable property.
7
 *
8
 * @see \Teto\Object\PrivateGetterTest
9
 *
10
 * @author    USAMI Kenta <[email protected]>
11
 * @copyright 2016 Baguette HQ
12
 * @license   http://www.apache.org/licenses/LICENSE-2.0
13
 */
14
trait ReadOnly
0 ignored issues
show
Bug introduced by
A parse error occurred: Syntax error, unexpected T_READONLY, expecting T_STRING on line 14 at column 6
Loading history...
15
{
16 3
    public function __set($name, $_value)
17
    {
18 3
        $message = sprintf('%s->%s is not writable property.', static::class, $name);
19 3
        throw new \OutOfRangeException($message);
20
    }
21
}
22