. // }}} /** * ActivityPub implementation for GNU social * * @package GNUsocial * @category ActivityPub * * @author Diogo Peralta Cordeiro <@diogo.site> * @copyright 2021 Free Software Foundation, Inc http://www.fsf.org * @license https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later */ namespace Plugin\ActivityPub\Util; /** * Provides a response in application/ld+json to GS Entities * * @copyright 2021 Free Software Foundation, Inc http://www.fsf.org * @license https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later */ abstract class ModelResponse { /** * Provides a response in application/ld+json for ActivityStreams 2.0 Types * * @param mixed $object (Entity) * @param int $status The response status code */ public static function handle(mixed $object, int $status = 200): TypeResponse { return new TypeResponse( json: Model::toJson($object), status: $status, ); } }