mini-fair-repo/inc/class-provider.php
Joost de Valk d527f95815
Do plugin rename (#78)
Signed-off-by: Joost de Valk <joost@altha.nl>
Co-authored-by: Colin Stewart <79332690+costdev@users.noreply.github.com>
2025-11-24 12:58:34 -08:00

55 lines
1.3 KiB
PHP

<?php
/**
* Provider.
*
* @package FAIR\Beacon
*/
namespace FAIR\Beacon;
use FAIR\Beacon\PLC\DID;
/**
* Provider interface.
*/
interface Provider {
/**
* Get the active package IDs for this provider.
*
* @return array An array of active package IDs.
*/
public function get_active_ids() : array;
/**
* Get the package IDs that have problems.
*
* @return WP_Error[] Map of package ID to WP_Error object. (Use DID as key if available, or some other human-readable identifier.)
*/
public function get_invalid() : array;
/**
* Check if this provider is authoritative for the given DID.
*
* @param DID $did The DID to check.
* @return bool True if this provider is authoritative for the DID, false otherwise.
*/
public function is_authoritative( DID $did ) : bool;
/**
* Get the package metadata for a given package ID.
*
* @param DID $did The DID object representing the package.
* @return API\MetadataDocument|WP_Error
*/
public function get_package_metadata( DID $did );
/**
* Get the release document for a given package ID and version.
*
* @param DID $did The DID object representing the package.
* @param string $version The version to get.
* @return API\ReleaseDocument|WP_Error
*/
public function get_release( DID $did, string $version );
}