PluginProbe
Metricool – Social media and site statistics / 2.1.1
Metricool – Social media and site statistics v2.1.1
2.1.1 2.1.0 2.0.2 2.0.1 2.0.0 1.27 trunk
metricool / app / Http / Endpoints / Responses / AnalyticsResponse.php

AnalyticsResponse.php in Metricool – Social media and site statistics 2.1.1, at app/Http/Endpoints/Responses/AnalyticsResponse.php

45 lines 921 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 declare(strict_types=1);
4
5 namespace Metricool\Http\Endpoints\Responses;
6
7 class AnalyticsResponse extends Response
8 {
9 /**
10 * Sets the totals to be shown in the response
11 * @see \Metricool\Services\AnalyticsService::getTotals()
12 */
13 public array $totals = [];
14 /**
15 * Sets the totals to be shown in the response
16 * @see \Metricool\Services\AnalyticsService::getTimelineData()
17 */
18 public array $timelineData = [];
19
20 public function setTotals(array $totals): self
21 {
22 $this->totals = $totals;
23
24 return $this;
25 }
26
27 public function setTimelineData(array $timelineData): self
28 {
29 $this->timelineData = $timelineData;
30
31 return $this;
32 }
33
34 /**
35 * @inheritDoc
36 */
37 public function body(): array
38 {
39 return [
40 'totals' => $this->totals,
41 'timelineData' => $this->timelineData,
42 ];
43 }
44 }
45