| Conditions | 3 |
| Paths | 3 |
| Total Lines | 10 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 5 |
| CRAP Score | 3.2098 |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 19 | protected function __construct(callable $f) |
||
| 20 | { |
||
| 21 | 1 | if($f instanceof \Closure) { |
|
| 22 | 1 | $this->f = $f->bindTo($this); |
|
| 23 | 1 | } elseif(method_exists('\Closure','fromCallable')) { |
|
| 24 | $this->f = \Closure::fromCallable($f)->bindTo($this); |
||
| 25 | } else { |
||
| 26 | 1 | throw new \RuntimeException('Using anything else than a callable is only possible for PHP >= 7.1.'); |
|
| 27 | } |
||
| 28 | 1 | } |
|
| 29 | |||
| 62 |