# metricool/2.1.1/app/Http/Metricool/Traits/IsCountable.php

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

- Page: https://pluginprobe.com/plugins/metricool/2.1.1/code/app/Http/Metricool/Traits/IsCountable.php
- Raw: https://pluginprobe.com/plugins/metricool/2.1.1/raw/app/Http/Metricool/Traits/IsCountable.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/Metricool/Traits/IsCountable.php#L10-L20`.

```php
<?php

declare(strict_types=1);

namespace Metricool\Http\Metricool\Traits;

trait IsCountable
{
    /**
     * Abstract method to be implemented by classes using this trait. It should
     * return an array of data. When {@see count()} is called, this method will
     * be used to retrieve the data to count.
     */
    abstract public function get(): array;

    /**
     * Method just returns the count of the items in the array returned by the
     * get() method. Operation type methods should always return an array.
     */
    public function count(): array
    {
        return [
            count($this->get()),
        ];
    }
}

```
