1 | <?php |
||
18 | class ProfilePlugin implements Plugin |
||
19 | { |
||
20 | /** |
||
21 | * @var Plugin |
||
22 | */ |
||
23 | private $plugin; |
||
24 | |||
25 | /** |
||
26 | * @var Collector |
||
27 | */ |
||
28 | private $collector; |
||
29 | |||
30 | /** |
||
31 | * @var Formatter |
||
32 | */ |
||
33 | private $formatter; |
||
34 | |||
35 | /** |
||
36 | * @var string |
||
37 | */ |
||
38 | private $pluginName; |
||
39 | |||
40 | /** |
||
41 | * @param Plugin $plugin |
||
42 | * @param Collector $collector |
||
43 | * @param Formatter $formatter |
||
44 | * @param string $pluginName |
||
45 | */ |
||
46 | 9 | public function __construct(Plugin $plugin, Collector $collector, Formatter $formatter, $pluginName) |
|
53 | |||
54 | /** |
||
55 | * {@inheritdoc} |
||
56 | */ |
||
57 | 8 | public function handleRequest(RequestInterface $request, callable $next, callable $first) |
|
98 | |||
99 | /** |
||
100 | * @param RequestInterface $request |
||
101 | * @param Profile $profile |
||
102 | * @param Exception $exception |
||
103 | * @param Stack $stack |
||
104 | */ |
||
105 | 2 | private function onException( |
|
115 | |||
116 | /** |
||
117 | * @param RequestInterface $request |
||
118 | * @param Profile $profile |
||
119 | */ |
||
120 | 7 | private function onOutgoingRequest(RequestInterface $request, Profile $profile) |
|
124 | |||
125 | /** |
||
126 | * @param ResponseInterface $response |
||
127 | * @param Profile $profile |
||
128 | * @param RequestInterface $request |
||
129 | * @param Stack $stack |
||
130 | */ |
||
131 | 6 | private function onOutgoingResponse(ResponseInterface $response, Profile $profile, RequestInterface $request, Stack $stack = null) |
|
136 | |||
137 | /** |
||
138 | * Collect request information when not already done by the HTTP client. This happens when using the CachePlugin |
||
139 | * and the cache is hit without re-validation. |
||
140 | * |
||
141 | * @param RequestInterface $request |
||
142 | * @param Stack|null $stack |
||
143 | */ |
||
144 | 8 | private function collectRequestInformation(RequestInterface $request, Stack $stack = null) |
|
169 | } |
||
170 |