Conditions | 2 |
Paths | 2 |
Total Lines | 14 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
33 | 103 | public function __construct(string $name, $value) |
|
34 | { |
||
35 | 103 | if (!preg_match(self::REGEX_NAME, $name)) { |
|
36 | 2 | throw new InvalidArgumentException( |
|
37 | 2 | sprintf( |
|
38 | 2 | 'Name must be a valid variable or method name, "%s" given', |
|
39 | 2 | $name |
|
40 | ) |
||
41 | ); |
||
42 | } |
||
43 | |||
44 | 101 | $this->name = $name; |
|
45 | 101 | $this->value = $value; |
|
46 | } |
||
47 | |||
64 |