1 | <?php |
||
11 | class Profiler implements ProfilerContract |
||
12 | { |
||
13 | use DescriptionMaker; |
||
14 | |||
15 | /** |
||
16 | * @var \DebugBar\DataCollector\TimeDataCollector |
||
17 | */ |
||
18 | protected $timeline; |
||
19 | |||
20 | /** |
||
21 | * @var array |
||
22 | */ |
||
23 | protected $availableParameters = [ |
||
24 | 'method', 'url', 'resource', 'request_version', 'response_version', 'host', 'hostname', 'status_code', 'phrase', |
||
25 | ]; |
||
26 | |||
27 | /** |
||
28 | * @var array |
||
29 | */ |
||
30 | protected $context = ['host', 'method', 'url', 'status_code', 'phrase']; |
||
31 | |||
32 | /** |
||
33 | * Public constructor. |
||
34 | * |
||
35 | * @param \DebugBar\DataCollector\TimeDataCollector $timeline |
||
36 | */ |
||
37 | 2 | public function __construct(TimeDataCollector $timeline) |
|
41 | |||
42 | /** |
||
43 | * @param float $start |
||
44 | * @param float $end |
||
45 | * @param \Psr\Http\Message\RequestInterface $request |
||
46 | * @param \Psr\Http\Message\ResponseInterface $response |
||
47 | */ |
||
48 | 2 | public function add(float $start, float $end, RequestInterface $request, ResponseInterface $response = null): void |
|
55 | |||
56 | /** |
||
57 | * Get context fields to add to the time-line entry. |
||
58 | * |
||
59 | * @param \Psr\Http\Message\RequestInterface $request |
||
60 | * @param \Psr\Http\Message\ResponseInterface $response |
||
61 | * |
||
62 | * @return array |
||
63 | */ |
||
64 | 2 | protected function getParameters(RequestInterface $request, ResponseInterface $response = null): array |
|
104 | } |
||
105 |