gnu-social/plugins/ActivityPub/Util/Response/NoteResponse.php
Diogo Peralta Cordeiro 517ed953f2
[FreeNetwork] First step towards de-duplication mechanism for federation
Refactored AS2 inside AP; [ENTITY][Activity] went from core to AP
Webfinger plugin will be part of FreeNetwork component
2021-10-06 11:48:22 +01:00

26 lines
684 B
PHP

<?php
namespace Plugin\ActivityPub\Util\Response;
use App\Entity\Note;
use Exception;
use Plugin\ActivityPub\Util\Model\EntityToType\NoteToType;
abstract class NoteResponse
//class NoteResponse extends Controller
{
/**
* @param Note $note
* @param int $status The response status code
*
* @throws Exception
*
* @return TypeResponse
*/
public static function handle(Note $note, int $status = 200): TypeResponse
// public function handle(Request $request, int $id): JsonResponse
{
// $note = DB::findOneBy('note', ['id' => $id]);
return new TypeResponse(data: NoteToType::translate($note), status: $status);
}
}