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