1 | <?php |
||
9 | class DatabaseStore implements StatisticsStore |
||
10 | { |
||
11 | /** |
||
12 | * The model that will interact with the database. |
||
13 | * |
||
14 | * @var string |
||
15 | */ |
||
16 | protected static $model = \BeyondCode\LaravelWebSockets\Models\WebSocketsStatisticsEntry::class; |
||
17 | |||
18 | /** |
||
19 | * Store a new record in the database and return |
||
20 | * the created instance. |
||
21 | * |
||
22 | * @param array $data |
||
23 | * @return mixed |
||
24 | */ |
||
25 | public static function store(array $data) |
||
29 | |||
30 | /** |
||
31 | * Delete records older than the given moment, |
||
32 | * for a specific app id (if given), returning |
||
33 | * the amount of deleted records. |
||
34 | * |
||
35 | * @param \Carbon\Carbon $moment |
||
36 | * @param string|int|null $appId |
||
37 | * @return int |
||
38 | */ |
||
39 | public static function delete(Carbon $moment, $appId = null): int |
||
47 | |||
48 | /** |
||
49 | * Get the query result as eloquent collection. |
||
50 | * |
||
51 | * @param callable $processQuery |
||
52 | * @return \Illuminate\Support\Collection |
||
53 | */ |
||
54 | public function getRawRecords(callable $processQuery = null) |
||
63 | |||
64 | /** |
||
65 | * Get the results for a specific query. |
||
66 | * |
||
67 | * @param callable $processQuery |
||
68 | * @param callable $processCollection |
||
69 | * @return array |
||
70 | */ |
||
71 | public function getRecords(callable $processQuery = null, callable $processCollection = null): array |
||
87 | |||
88 | /** |
||
89 | * Get the results for a specific query into a |
||
90 | * format that is easily to read for graphs. |
||
91 | * |
||
92 | * @param callable $processQuery |
||
93 | * @return array |
||
94 | */ |
||
95 | public function getForGraph(callable $processQuery = null): array |
||
116 | } |
||
117 |
Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.