AbstractResponse.php 589 B

123456789101112131415161718192021222324252627
  1. <?php
  2. namespace Plugin\ActivityStreamsTwo\Util\Response;
  3. use Plugin\ActivityStreamsTwo\Util\Model\EntityToType\EntityToType;
  4. abstract class AbstractResponse
  5. {
  6. /**
  7. * param Type $type // What is this `Type`
  8. *
  9. * @param int $status The response status code
  10. * @param mixed $type
  11. *
  12. * @throws \Exception
  13. *
  14. * @return TypeResponse
  15. */
  16. public static function handle($type, int $status = 200): TypeResponse
  17. {
  18. return new TypeResponse(
  19. data: EntityToType::translate($type),
  20. status: $status
  21. );
  22. }
  23. }