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