v1.0.0
This commit is contained in:
commit
6708bbb67f
43 changed files with 8342 additions and 0 deletions
75
includes/External/ScanResult.php
vendored
Normal file
75
includes/External/ScanResult.php
vendored
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
<?php
|
||||
/**
|
||||
* Value object representing the outcome of one external provider scan.
|
||||
*
|
||||
* @package MediaRightsAudit\External
|
||||
*/
|
||||
|
||||
namespace MediaRightsAudit\External;
|
||||
|
||||
/**
|
||||
* Immutable result returned by AbstractProvider::scan().
|
||||
*/
|
||||
class ScanResult {
|
||||
|
||||
/**
|
||||
* Number of pages / images where the attachment was found.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
private int $match_count;
|
||||
|
||||
/**
|
||||
* Top domains where matches were found (domain → occurrence count), max 10.
|
||||
*
|
||||
* @var array<string, int>
|
||||
*/
|
||||
private array $top_domains;
|
||||
|
||||
/**
|
||||
* Full decoded API response for storage.
|
||||
*
|
||||
* @var array<mixed, mixed>
|
||||
*/
|
||||
private array $raw_response;
|
||||
|
||||
/**
|
||||
* Constructs a new scan result.
|
||||
*
|
||||
* @param int $match_count Number of pages or images found.
|
||||
* @param array<string, int> $top_domains Domain → count map.
|
||||
* @param array<mixed, mixed> $raw_response Full decoded API payload.
|
||||
*/
|
||||
public function __construct( int $match_count, array $top_domains, array $raw_response ) {
|
||||
$this->match_count = $match_count;
|
||||
$this->top_domains = $top_domains;
|
||||
$this->raw_response = $raw_response;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number of matching pages or images found.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function match_count(): int {
|
||||
return $this->match_count;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the top-domain occurrence map (domain → count), max 10 entries.
|
||||
*
|
||||
* @return array<string, int>
|
||||
*/
|
||||
public function top_domains(): array {
|
||||
return $this->top_domains;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the full decoded API response payload.
|
||||
*
|
||||
* @return array<mixed, mixed>
|
||||
*/
|
||||
public function raw_response(): array {
|
||||
return $this->raw_response;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue