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