Files
pr-vision/includes/collector/interface-prv-data-collector.php
peptiderepo 68ae5b9b1a PHPCS compliance: fix pre-existing violations exposed by gating the lint step
All violations were present in v0.1.0 and hidden by continue-on-error.
Now that PHPCS gates the build (P2-B), they must be fixed.

- Add file-level @package doc comment to all PHP files (file doc requirement)
- Add short descriptions to @var and constructor docblocks throughout
- Fix @param type spacing throughout (PHPCS alignment rules)
- Expand phpcs:ignore lines to include NoCaching where DirectQuery is already
  suppressed (uninstall.php, cost-ledger, table-manager, collector)
- Suppress EscapeOutput.ExceptionNotEscaped on RuntimeException messages
  (exception strings are not HTML output)
- Suppress error_log_error_log on the probe-runner failure log
- Replace date() with gmdate() in panel (timezone-aware per WP standard)
- Convert inline associative arrays to multi-line in config (WP array style)
- Fix double-arrow alignment in probe-runner counts and insert arrays
- Fix double-space before ?? in provider constructors
- Expand phpcs:ignore for  reads to include MissingUnslash
- Fix $counts++ to ++$counts (prefix increment per WP standard)
- Fix V1/v1 capitalisation in interface doc long description

Agent-Session: pr-vision rename v0.1.1
2026-06-13 09:42:55 +00:00

42 lines
1.2 KiB
PHP

<?php
/** @package PrVision */
declare(strict_types=1);
/**
* Seam: contract for all PR Vision data collectors.
*
* V1 implements only PRV_Ai_Visibility_Collector. Future collectors
* (keyword rankings, schema coverage, technical-SEO) implement this
* interface and register themselves with PRV_Collector_Registry without
* changing the dashboard shell.
*
* Who triggers: PRV_Collector_Registry dispatches registered collectors.
* Dependencies: None — pure interface.
*
* @see class-prv-ai-visibility-collector.php — v1 implementation.
* @see class-prv-collector-registry.php — Registration hub.
* @see ARCHITECTURE.md — §Collector/Panel seam.
* @package PrVision
*/
interface PRV_Data_Collector {
/**
* Collect and return the data payload for this category.
*
* The return shape is collector-specific; the dashboard panel for this
* category receives the same array and is responsible for rendering it.
*
* @return array<string, mixed> Collected data.
*/
public function collect(): array;
/**
* Short machine key identifying this collector (e.g. "ai_visibility").
*
* Used as the registry key and as the panel lookup key.
*
* @return string
*/
public function get_key(): string;
}