2021-08-24 20:29:26 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Plugin\ActivityStreamsTwo\Util\Response;
|
|
|
|
|
|
|
|
use Plugin\ActivityStreamsTwo\Util\Model\EntityToType\EntityToType;
|
|
|
|
|
|
|
|
abstract class AbstractResponse
|
|
|
|
{
|
|
|
|
/**
|
2021-09-06 23:47:28 +01:00
|
|
|
* param Type $type // What is this `Type`
|
|
|
|
*
|
|
|
|
* @param int $status The response status code
|
|
|
|
* @param mixed $type
|
2021-08-24 20:29:26 +01: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-06 23:47:28 +01:00
|
|
|
}
|