PluginProbe
404 Solution / trunk
404 Solution vtrunk
4.3.5 4.3.4 4.3.3 4.3.2 4.3.1 4.3.0 4.2.0 4.1.19 4.1.18 4.1.17 4.1.16 4.1.15 4.1.13 4.1.12 4.1.11 4.1.10 4.1.9 4.1.8 4.1.7 4.1.6 4.1.5 4.1.4 4.1.3 trunk 2.30.0 All 109 releases
404-solution / includes / stats / UnavailableStatsRepository.php

UnavailableStatsRepository.php in 404 Solution trunk, at includes/stats/UnavailableStatsRepository.php

50 lines 2.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 if (!defined('ABSPATH')) {
4 exit;
5 }
6
7 require_once __DIR__ . '/StatsRepositoryInterface.php';
8
9 /**
10 * Explicit placeholder for legacy construction paths that do not exercise
11 * stats behavior. Calling a stats method without injecting/registering the
12 * real repository is a configuration error, not a DataAccess fallback.
13 */
14 class ABJ_404_Solution_UnavailableStatsRepository implements ABJ_404_Solution_StatsRepositoryInterface {
15
16 /** @var string */
17 private $context;
18
19 public function __construct(string $context = '') {
20 $this->context = $context;
21 }
22
23 public static function resolve(string $context = ''): ABJ_404_Solution_StatsRepositoryInterface {
24 return new self($context);
25 }
26
27 /** @return never */
28 private function unavailable() {
29 throw new RuntimeException(
30 'StatsRepositoryInterface is required'
31 . ($this->context !== '' ? ' for ' . $this->context : '')
32 . '; inject stats_repository instead of resolving stats through DataAccess.'
33 );
34 }
35
36 public function getStatsCount($query, array $valueParams) { $this->unavailable(); }
37 public function getPeriodicStatsSummary($sinceTimestamp, $notFoundDest = '404') { $this->unavailable(); }
38 public function getPeriodicStatsSummariesCached($notFoundDest = '404') { $this->unavailable(); }
39 public function getStatsDashboardSnapshot($allowStale = true) { $this->unavailable(); }
40 public function refreshStatsDashboardSnapshot($force = false) { $this->unavailable(); }
41 public function getEarliestLogTimestamp() { $this->unavailable(); }
42 public function getConfidenceBandCounts() { $this->unavailable(); }
43 public function getTopCapturedForDigest(int $limit): array { $this->unavailable(); }
44 public function buildTopCapturedForDigestQuery(int $limit): string { $this->unavailable(); }
45 public function getDigestSummaryStats(): array { $this->unavailable(); }
46 public function getCapturedCountForNotification(): int { $this->unavailable(); }
47 public function getPostsNeedingContentKeywords(int $limit = 500): array { $this->unavailable(); }
48 public function bulkUpdateContentKeywords(array $idToKeywords): void { $this->unavailable(); }
49 }
50