| Conditions | 4 |
| Paths | 4 |
| Total Lines | 16 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | public function traitor($method_name) |
||
| 8 | { |
||
| 9 | $regex = sprintf('/.+Traitor_%s$/', $method_name); |
||
| 10 | $errors = []; |
||
| 11 | $traits = (new \ReflectionClass($this))->getTraitNames(); |
||
| 12 | |||
| 13 | foreach ($traits as $trait_name) { |
||
| 14 | $trait_methods = (new \ReflectionClass($trait_name))->getMethods(); |
||
| 15 | foreach ($trait_methods as $method) { |
||
| 16 | if (preg_match($regex, $method->name, $match) === 1) { |
||
| 17 | $callable = current($match); |
||
| 18 | $errors ["$trait_name::" . $method->name] = $this->$callable(); |
||
| 19 | } |
||
| 20 | } |
||
| 21 | } |
||
| 22 | return $errors; |
||
| 23 | } |
||
| 25 |