| Conditions | 1 |
| Paths | 1 |
| Total Lines | 18 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | public function log(MethodInvocation $invocation): mixed |
||
| 19 | { |
||
| 20 | $t = microtime(true); |
||
| 21 | /** @psalm-suppress MixedAssignment */ |
||
| 22 | $result = $invocation->proceed(); |
||
| 23 | $time = microtime(true) - $t; |
||
| 24 | $parent = (new ReflectionClass($invocation->getThis()))->getParentClass(); |
||
| 25 | assert($parent instanceof ReflectionClass); |
||
| 26 | $class = $parent->getName(); |
||
| 27 | $method = $invocation->getMethod()->getName(); |
||
| 28 | $this->logs[$class][$method][] = new Log( |
||
| 29 | (array) $invocation->getArguments(), |
||
| 30 | (array) $invocation->getNamedArguments(), |
||
| 31 | $result, |
||
| 32 | $time, |
||
| 33 | ); |
||
| 34 | |||
| 35 | return $result; |
||
| 36 | } |
||
| 52 |