mini-fair-repo/inc/class-provider.php
Ryan McCue a3a5a85baa Initial export of the repository
Signed-off-by: Ryan McCue <me@ryanmccue.info>
2025-06-05 12:06:13 +02:00

46 lines
1.2 KiB
PHP

<?php
namespace MiniFAIR;
use MiniFAIR\PLC\DID;
use WP_Error;
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 string $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.
* @return API\ReleaseDocument|WP_Error
*/
public function get_release( DID $did, string $version );
}