change type|TYPE to method|METHOD

Signed-off-by: Andy Fragen <andy@thefragens.com>
This commit is contained in:
Andy Fragen 2025-07-27 09:13:35 -07:00
parent 0b9d2fa35b
commit c9337fd72c
4 changed files with 10 additions and 10 deletions

View file

@ -13,7 +13,7 @@ interface DID {
*
* One of plc, web.
*/
public function get_type() : string;
public function get_method() : string;
/**
* Get the full decentralized ID (DID).

View file

@ -16,7 +16,7 @@ class PLC implements DID {
// phpcs:disable WordPress.NamingConventions.ValidVariableName
const DIRECTORY_URL = 'https://plc.directory/';
const TYPE = 'plc';
const METHOD = 'plc';
/**
* Decentralized ID.
@ -39,8 +39,8 @@ class PLC implements DID {
*
* One of plc, web.
*/
public function get_type() : string {
return static::TYPE;
public function get_method() : string {
return static::METHOD;
}
/**

View file

@ -11,7 +11,7 @@ namespace FAIR\Packages\DID;
* Class Web.
*/
class Web implements DID {
const TYPE = 'web';
const METHOD = 'web';
/**
* Decentralized ID.
@ -34,8 +34,8 @@ class Web implements DID {
*
* One of plc, web.
*/
public function get_type() : string {
return static::TYPE;
public function get_method() : string {
return static::METHOD;
}
/**

View file

@ -46,14 +46,14 @@ function parse_did( string $id ) {
}
switch ( $parts[1] ) {
case PLC::TYPE:
case PLC::METHOD:
return new PLC( $id );
case Web::TYPE:
case Web::METHOD:
return new Web( $id );
default:
return new WP_Error( 'fair.packages.validate_id.invalid_type', __( 'Unsupported DID type.', 'fair' ) );
return new WP_Error( 'fair.packages.validate_id.invalid_method', __( 'Unsupported DID method.', 'fair' ) );
}
}