| Conditions | 4 |
| Paths | 4 |
| Total Lines | 25 |
| Code Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 30 | protected function configure() |
||
| 31 | { |
||
| 32 | $this->install(new SpyBaseModule()); |
||
| 33 | foreach ($this->spyTargets as $class) { |
||
| 34 | if (interface_exists($class)) { |
||
| 35 | $this->bindInterceptor( |
||
| 36 | new IsInterfaceMatcher($class), |
||
| 37 | $this->matcher->any(), |
||
| 38 | [SpyInterceptor::class], |
||
| 39 | ); |
||
| 40 | continue; |
||
| 41 | } |
||
| 42 | |||
| 43 | if (class_exists($class)) { |
||
| 44 | $this->bindInterceptor( |
||
| 45 | $this->matcher->subclassesOf($class), |
||
| 46 | $this->matcher->any(), |
||
| 47 | [SpyInterceptor::class], |
||
| 48 | ); |
||
| 49 | continue; |
||
| 50 | } |
||
| 51 | |||
| 52 | assert(is_string($class)); |
||
| 53 | |||
| 54 | throw new InvalidSpyTargetException($class); |
||
| 55 | } |
||
| 58 |