fix more namespaces
All checks were successful
PHP Code Checker / PHP Code Checker (pull_request) Successful in 51s
PHPUnit / PHPUnit – PHP 7.4 (pull_request) Successful in 1m8s
PHPUnit / PHPUnit – PHP 8.0 (pull_request) Successful in 1m5s
PHPUnit / PHPUnit – PHP 8.1 (pull_request) Successful in 1m3s
PHPUnit / PHPUnit – PHP 8.2 (pull_request) Successful in 1m6s
PHPUnit / PHPUnit – PHP 8.3 (pull_request) Successful in 1m3s
PHPUnit / PHPUnit – PHP 8.4 (pull_request) Successful in 1m10s
All checks were successful
PHP Code Checker / PHP Code Checker (pull_request) Successful in 51s
PHPUnit / PHPUnit – PHP 7.4 (pull_request) Successful in 1m8s
PHPUnit / PHPUnit – PHP 8.0 (pull_request) Successful in 1m5s
PHPUnit / PHPUnit – PHP 8.1 (pull_request) Successful in 1m3s
PHPUnit / PHPUnit – PHP 8.2 (pull_request) Successful in 1m6s
PHPUnit / PHPUnit – PHP 8.3 (pull_request) Successful in 1m3s
PHPUnit / PHPUnit – PHP 8.4 (pull_request) Successful in 1m10s
This commit is contained in:
parent
a5a062bb17
commit
e8b2b4c899
2 changed files with 19 additions and 19 deletions
|
@ -10,7 +10,7 @@ namespace Event_Bridge_For_ActivityPub\ActivityPub\Collection;
|
||||||
|
|
||||||
use WP_Error;
|
use WP_Error;
|
||||||
use WP_Query;
|
use WP_Query;
|
||||||
use Event_Bridge_For_ActivityPub\ActivityPub\Event_Source;
|
use Event_Bridge_For_ActivityPub\ActivityPub\Model\Event_Source;
|
||||||
|
|
||||||
use function Activitypub\is_tombstone;
|
use function Activitypub\is_tombstone;
|
||||||
use function Activitypub\get_remote_metadata_by_actor;
|
use function Activitypub\get_remote_metadata_by_actor;
|
||||||
|
@ -32,8 +32,8 @@ class Event_Sources {
|
||||||
self::POST_TYPE,
|
self::POST_TYPE,
|
||||||
array(
|
array(
|
||||||
'labels' => array(
|
'labels' => array(
|
||||||
'name' => _x( 'Event Sources', 'post_type plural name', 'activitypub' ),
|
'name' => _x( 'Event Sources', 'post_type plural name', 'event-bridge-for-activitypub' ),
|
||||||
'singular_name' => _x( 'Event Source', 'post_type single name', 'activitypub' ),
|
'singular_name' => _x( 'Event Source', 'post_type single name', 'event-bridge-for-activitypub' ),
|
||||||
),
|
),
|
||||||
'public' => false,
|
'public' => false,
|
||||||
'hierarchical' => false,
|
'hierarchical' => false,
|
||||||
|
@ -63,7 +63,7 @@ class Event_Sources {
|
||||||
'single' => false,
|
'single' => false,
|
||||||
'sanitize_callback' => function ( $value ) {
|
'sanitize_callback' => function ( $value ) {
|
||||||
if ( ! is_string( $value ) ) {
|
if ( ! is_string( $value ) ) {
|
||||||
throw new Exception( 'Error message is no valid string' );
|
throw new \Exception( 'Error message is no valid string' );
|
||||||
}
|
}
|
||||||
|
|
||||||
return esc_sql( $value );
|
return esc_sql( $value );
|
||||||
|
@ -111,7 +111,7 @@ class Event_Sources {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( empty( $meta ) || ! is_array( $meta ) || is_wp_error( $meta ) ) {
|
if ( empty( $meta ) || ! is_array( $meta ) || is_wp_error( $meta ) ) {
|
||||||
return new WP_Error( 'activitypub_invalid_follower', __( 'Invalid Follower', 'activitypub' ), array( 'status' => 400 ) );
|
return new WP_Error( 'activitypub_invalid_actor', __( 'Invalid ActivityPub Actor', 'event-bridge-for-activitypub' ), array( 'status' => 400 ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
$event_source = new Event_Source();
|
$event_source = new Event_Source();
|
||||||
|
@ -139,9 +139,9 @@ class Event_Sources {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get all Followers.
|
* Get all Event-Sources.
|
||||||
*
|
*
|
||||||
* @return array The Term list of Followers.
|
* @return array The Term list of Event Sources.
|
||||||
*/
|
*/
|
||||||
public static function get_all_followers() {
|
public static function get_all_followers() {
|
||||||
$args = array(
|
$args = array(
|
||||||
|
@ -159,6 +159,6 @@ class Event_Sources {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
return self::get_followers( null, null, null, $args );
|
return self::get_event_sources( null, null, null, $args );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,8 +27,8 @@ class Event_Sources extends WP_List_Table {
|
||||||
public function __construct() {
|
public function __construct() {
|
||||||
parent::__construct(
|
parent::__construct(
|
||||||
array(
|
array(
|
||||||
'singular' => \__( 'Event Source', 'activitypub' ),
|
'singular' => \__( 'Event Source', 'event-bridge-for-activitypub' ),
|
||||||
'plural' => \__( 'Event Sources', 'activitypub' ),
|
'plural' => \__( 'Event Sources', 'event-bridge-for-activitypub' ),
|
||||||
'ajax' => false,
|
'ajax' => false,
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
@ -42,12 +42,12 @@ class Event_Sources extends WP_List_Table {
|
||||||
public function get_columns() {
|
public function get_columns() {
|
||||||
return array(
|
return array(
|
||||||
'cb' => '<input type="checkbox" />',
|
'cb' => '<input type="checkbox" />',
|
||||||
'avatar' => \__( 'Avatar', 'activitypub' ),
|
'avatar' => \__( 'Avatar', 'event-bridge-for-activitypub' ),
|
||||||
'post_title' => \__( 'Name', 'activitypub' ),
|
'post_title' => \__( 'Name', 'event-bridge-for-activitypub' ),
|
||||||
'username' => \__( 'Username', 'activitypub' ),
|
'username' => \__( 'Username', 'event-bridge-for-activitypub' ),
|
||||||
'url' => \__( 'URL', 'activitypub' ),
|
'url' => \__( 'URL', 'event-bridge-for-activitypub' ),
|
||||||
'published' => \__( 'Followed', 'activitypub' ),
|
'published' => \__( 'Followed', 'event-bridge-for-activitypub' ),
|
||||||
'modified' => \__( 'Last updated', 'activitypub' ),
|
'modified' => \__( 'Last updated', 'event-bridge-for-activitypub' ),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -146,7 +146,7 @@ class Event_Sources extends WP_List_Table {
|
||||||
*/
|
*/
|
||||||
public function get_bulk_actions() {
|
public function get_bulk_actions() {
|
||||||
return array(
|
return array(
|
||||||
'delete' => __( 'Delete', 'activitypub' ),
|
'delete' => __( 'Delete', 'event-bridge-for-activitypub' ),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -159,7 +159,7 @@ class Event_Sources extends WP_List_Table {
|
||||||
*/
|
*/
|
||||||
public function column_default( $item, $column_name ) {
|
public function column_default( $item, $column_name ) {
|
||||||
if ( ! array_key_exists( $column_name, $item ) ) {
|
if ( ! array_key_exists( $column_name, $item ) ) {
|
||||||
return __( 'None', 'activitypub' );
|
return __( 'None', 'event-bridge-for-activitypub' );
|
||||||
}
|
}
|
||||||
return $item[ $column_name ];
|
return $item[ $column_name ];
|
||||||
}
|
}
|
||||||
|
@ -224,7 +224,7 @@ class Event_Sources extends WP_List_Table {
|
||||||
$followers = array( $followers );
|
$followers = array( $followers );
|
||||||
}
|
}
|
||||||
foreach ( $followers as $follower ) {
|
foreach ( $followers as $follower ) {
|
||||||
FollowerCollection::remove_follower( $this->user_id, $follower );
|
Event_Source::remove( $this->user_id, $follower );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue