1 | <?php |
||
12 | class DataCollectorPlugin implements EventSubscriberInterface |
||
13 | { |
||
14 | /** |
||
15 | * @var SoapCallRegistry |
||
16 | */ |
||
17 | private $registry; |
||
18 | |||
19 | /** |
||
20 | * @param SoapCallRegistry $registry |
||
21 | */ |
||
22 | 6 | public function __construct(SoapCallRegistry $registry) |
|
26 | |||
27 | /** |
||
28 | * @param RequestEvent $event |
||
29 | */ |
||
30 | 6 | public function onClientRequest(RequestEvent $event) |
|
34 | |||
35 | /** |
||
36 | * @param ResponseEvent $event |
||
37 | */ |
||
38 | 6 | public function onClientResponse(ResponseEvent $event) |
|
42 | |||
43 | /** |
||
44 | * @param FaultEvent $event |
||
45 | */ |
||
46 | public function onClientFault(FaultEvent $event) |
||
47 | { |
||
48 | $this->registry->addRequest($event->getRequestEvent()); |
||
49 | //todo use a dedicated fault rendering in profiler |
||
50 | $this->registry->addResponse( |
||
51 | new ResponseEvent( |
||
52 | $event->getId(), |
||
53 | $event->getRequestEvent()->getResource(), |
||
54 | $event->getRequestEvent()->getRequest(), |
||
55 | null, |
||
56 | $event->getException()->getMessage(), |
||
57 | null |
||
58 | ) |
||
59 | ); |
||
60 | } |
||
61 | |||
62 | /** |
||
63 | * {@inheritdoc} |
||
64 | */ |
||
65 | 3 | public static function getSubscribedEvents() |
|
73 | } |
||
74 |