1 | <?php |
||
13 | class FastbillDataCollector extends DataCollector |
||
14 | { |
||
15 | /** |
||
16 | * The API credentials. |
||
17 | * |
||
18 | * @var ApiCredentials |
||
19 | */ |
||
20 | protected $apiCredentials; |
||
21 | |||
22 | /** |
||
23 | * The transport collector. |
||
24 | * |
||
25 | * @var TransportCollector |
||
26 | */ |
||
27 | protected $transportCollector; |
||
28 | |||
29 | /** |
||
30 | * Constructor. |
||
31 | * |
||
32 | * @param ApiCredentials $apiCredentials The Fastbill API credentials. |
||
33 | * @param TransportCollector $transportCollector The transport collector. |
||
34 | */ |
||
35 | public function __construct(ApiCredentials $apiCredentials, TransportCollector $transportCollector) |
||
40 | |||
41 | /** |
||
42 | * {@inheritdoc} |
||
43 | */ |
||
44 | public function collect(Request $request, Response $response, \Exception $exception = null) |
||
51 | |||
52 | /** |
||
53 | * Collect the API credentials. |
||
54 | * |
||
55 | * @return array |
||
56 | */ |
||
57 | protected function collectApiCredentials() |
||
65 | |||
66 | /** |
||
67 | * Collect the requests. |
||
68 | * |
||
69 | * @return array |
||
70 | */ |
||
71 | protected function collectRequests() |
||
99 | |||
100 | /** |
||
101 | * Get the credentials. |
||
102 | * |
||
103 | * @return array |
||
104 | */ |
||
105 | public function getCredentials() |
||
109 | |||
110 | /** |
||
111 | * Get the requests. |
||
112 | * |
||
113 | * @return array |
||
114 | */ |
||
115 | public function getRequests() |
||
119 | |||
120 | /** |
||
121 | * Get the total calls. |
||
122 | * |
||
123 | * @return integer |
||
124 | */ |
||
125 | public function getTotalCalls() |
||
134 | |||
135 | /** |
||
136 | * Get the total time. |
||
137 | * |
||
138 | * @return integer |
||
139 | */ |
||
140 | public function getTotalTime() |
||
149 | |||
150 | /** |
||
151 | * {@inheritdoc} |
||
152 | */ |
||
153 | public function getName() |
||
157 | } |
||
158 |