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 / Metricool / Traits / IsCountable.php

IsCountable.php in Metricool – Social media and site statistics 2.1.1, at app/Http/Metricool/Traits/IsCountable.php

27 lines 643 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\Metricool\Traits;
6
7 trait IsCountable
8 {
9 /**
10 * Abstract method to be implemented by classes using this trait. It should
11 * return an array of data. When {@see count()} is called, this method will
12 * be used to retrieve the data to count.
13 */
14 abstract public function get(): array;
15
16 /**
17 * Method just returns the count of the items in the array returned by the
18 * get() method. Operation type methods should always return an array.
19 */
20 public function count(): array
21 {
22 return [
23 count($this->get()),
24 ];
25 }
26 }
27