mirror of
https://ghproxy.net/https://github.com/fairpm/fair-plugin.git
synced 2025-09-04 10:32:01 +08:00
change type|TYPE to method|METHOD
Signed-off-by: Andy Fragen <andy@thefragens.com>
This commit is contained in:
parent
0b9d2fa35b
commit
c9337fd72c
4 changed files with 10 additions and 10 deletions
|
@ -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).
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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' ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue