Issues (221)

src/Object/ReadOnly.php (1 issue)

Labels
Severity
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
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