2021-08-25 04:29:26 +09:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Plugin\ActivityStreamsTwo\Util\Response;
|
|
|
|
|
|
|
|
use Plugin\ActivityStreamsTwo\Util\Model\EntityToType\EntityToType;
|
|
|
|
|
|
|
|
abstract class AbstractResponse
|
|
|
|
{
|
|
|
|
/**
|
2021-09-07 07:47:28 +09:00
|
|
|
* param Type $type // What is this `Type`
|
|
|
|
*
|
|
|
|
* @param int $status The response status code
|
|
|
|
* @param mixed $type
|
2021-08-25 04:29:26 +09:00
|
|
|
*
|
|
|
|
* @throws \Exception
|
|
|
|
*
|
|
|
|
* @return TypeResponse
|
|
|
|
*/
|
|
|
|
public static function handle($type, int $status = 200): TypeResponse
|
|
|
|
{
|
|
|
|
return new TypeResponse(
|
|
|
|
data: EntityToType::translate($type),
|
|
|
|
status: $status
|
|
|
|
);
|
|
|
|
}
|
2021-09-07 07:47:28 +09:00
|
|
|
}
|