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 / RealtimeResponse.php

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

45 lines 946 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 RealtimeResponse extends Response
8 {
9 /**
10 * @var array $totals The data to be shown in the totals columns
11 * @see \Metricool\Services\RealtimeService::getTotals()
12 */
13 public array $totals = [];
14 /**
15 * @var array $timelineData The data to be shown in the timeline
16 * @see \Metricool\Services\RealtimeService::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 $timeline): self
28 {
29 $this->timelineData = $timeline;
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