Conditions | 3 |
Paths | 3 |
Total Lines | 22 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
23 | public function __invoke(Container $container, array $pointcuts): string |
||
24 | { |
||
25 | $log = []; |
||
26 | /** @psalm-suppress MixedAssignment */ |
||
27 | $container = unserialize(serialize($container), ['allowed_classes' => true]); |
||
28 | assert($container instanceof Container); |
||
29 | $spy = new SpyCompiler(); |
||
30 | foreach ($container->getContainer() as $dependencyIndex => $dependency) { |
||
31 | if ($dependency instanceof Dependency) { |
||
32 | $dependency->weaveAspects($spy, $pointcuts); |
||
33 | } |
||
34 | |||
35 | $log[] = sprintf( |
||
36 | '%s => %s', |
||
37 | $dependencyIndex, |
||
38 | (string) $dependency |
||
39 | ); |
||
40 | } |
||
41 | |||
42 | sort($log); |
||
43 | |||
44 | return implode(PHP_EOL, $log); |
||
45 | } |
||
47 |