# metricool/2.1.1/app/Http/Endpoints/Responses/AnalyticsResponse.php

Metricool – Social media and site statistics, version 2.1.1. 45 lines.

- Page: https://pluginprobe.com/plugins/metricool/2.1.1/code/app/Http/Endpoints/Responses/AnalyticsResponse.php
- Raw: https://pluginprobe.com/plugins/metricool/2.1.1/raw/app/Http/Endpoints/Responses/AnalyticsResponse.php
- Modified: 2026-08-20T14:08:30+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/metricool/2.1.1/code/app/Http/Endpoints/Responses/AnalyticsResponse.php#L10-L20`.

```php
<?php

declare(strict_types=1);

namespace Metricool\Http\Endpoints\Responses;

class AnalyticsResponse extends Response
{
    /**
     * Sets the totals to be shown in the response
     * @see \Metricool\Services\AnalyticsService::getTotals()
     */
    public array $totals = [];
    /**
     * Sets the totals to be shown in the response
     * @see \Metricool\Services\AnalyticsService::getTimelineData()
     */
    public array $timelineData = [];

    public function setTotals(array $totals): self
    {
        $this->totals = $totals;

        return $this;
    }

    public function setTimelineData(array $timelineData): self
    {
        $this->timelineData = $timelineData;

        return $this;
    }

    /**
     * @inheritDoc
     */
    public function body(): array
    {
        return [
            'totals' => $this->totals,
            'timelineData' => $this->timelineData,
        ];
    }
}

```
