[Actor] Refactor GSActor into Actor

This commit is contained in:
2021-09-18 03:22:27 +01:00
parent 6c899b7b61
commit 941cbe6599
73 changed files with 489 additions and 484 deletions

View File

@@ -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);