| 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 |
|