| Conditions | 2 |
| Paths | 2 |
| Total Lines | 8 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 42 | 39 | public function add_symbol($regexp, $binding_power = 0) { |
|
| 43 | 39 | if (array_key_exists($regexp, $this->symbols)) { |
|
| 44 | 1 | throw new \LogicException("Symbol for regexp $regexp already exists."); |
|
| 45 | } |
||
| 46 | 39 | $s = new Symbol($regexp, $binding_power); |
|
| 47 | 39 | $this->symbols[$regexp] = $s; |
|
| 48 | 39 | return $s; |
|
| 49 | } |
||
| 50 | } |
||
| 52 |