| Conditions | 2 |
| Paths | 1 |
| Total Lines | 10 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 42 | 28 | public function compile() { |
|
| 43 | 28 | $name = $this->name; |
|
| 44 | 28 | $regexp = $this->regexp; |
|
| 45 | 28 | return function(Entity $e) use ($name, $regexp) { |
|
| 46 | 26 | if (!$e->has_property($name)) { |
|
| 47 | 1 | return false; |
|
| 48 | } |
||
| 49 | 26 | return preg_match("%^$regexp\$%", $e->property($name)) == 1; |
|
| 50 | 28 | }; |
|
| 51 | } |
||
| 52 | |||
| 60 |