forked from GNUsocial/gnu-social
[Actor] Refactor GSActor into Actor
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
namespace Plugin\ActivityStreamsTwo\Util\Model\EntityToType;
|
||||
|
||||
use App\Core\Router\Router;
|
||||
use App\Entity\GSActor;
|
||||
use App\Entity\Actor;
|
||||
use DateTimeInterface;
|
||||
use Exception;
|
||||
use Plugin\ActivityStreamsTwo\Util\Type;
|
||||
@@ -11,13 +11,14 @@ use Plugin\ActivityStreamsTwo\Util\Type;
|
||||
class GSActorToType
|
||||
{
|
||||
/**
|
||||
* @param GSActor $gsactor
|
||||
* @param Actor $gsactor
|
||||
*
|
||||
* @throws Exception
|
||||
*@throws Exception
|
||||
*
|
||||
* @return Type
|
||||
*
|
||||
*/
|
||||
public static function translate(GSActor $gsactor)
|
||||
public static function translate(Actor $gsactor)
|
||||
{
|
||||
$uri = Router::url('actor_view_id', ['id' => $gsactor->getId()], Router::ABSOLUTE_URL);
|
||||
$attr = [
|
||||
|
@@ -2,21 +2,22 @@
|
||||
|
||||
namespace Plugin\ActivityStreamsTwo\Util\Response;
|
||||
|
||||
use App\Entity\GSActor;
|
||||
use App\Entity\Actor;
|
||||
use Exception;
|
||||
use Plugin\ActivityStreamsTwo\Util\Model\EntityToType\GSActorToType;
|
||||
|
||||
abstract class ActorResponse
|
||||
{
|
||||
/**
|
||||
* @param GSActor $gsactor
|
||||
* @param int $status The response status code
|
||||
* @param Actor $gsactor
|
||||
* @param int $status The response status code
|
||||
*
|
||||
* @throws Exception
|
||||
*@throws Exception
|
||||
*
|
||||
* @return TypeResponse
|
||||
*
|
||||
*/
|
||||
public static function handle(GSActor $gsactor, int $status = 200): TypeResponse
|
||||
public static function handle(Actor $gsactor, int $status = 200): TypeResponse
|
||||
{
|
||||
$gsactor->getLocalUser(); // This throws exception if not a local user, which is intended
|
||||
return new TypeResponse(data: GSActorToType::translate($gsactor), status: $status);
|
||||
|
Reference in New Issue
Block a user