| 1 |
<?php |
| 2 |
|
| 3 |
namespace Give\Framework\Http\Response; |
| 4 |
|
| 5 |
|
| 6 |
/** |
| 7 |
* Return a new response from the application. |
| 8 |
* |
| 9 |
* @since 2.18.0 |
| 10 |
* |
| 11 |
* @param string $content |
| 12 |
* @param int $status |
| 13 |
* @param array $headers |
| 14 |
* @return Response|ResponseFactory |
| 15 |
*/ |
| 16 |
function response($content = '', $status = 200, array $headers = []) |
| 17 |
{ |
| 18 |
/** @var ResponseFactory $factory */ |
| 19 |
$factory = give(ResponseFactory::class); |
| 20 |
|
| 21 |
if (func_num_args() === 0) { |
| 22 |
return $factory; |
| 23 |
} |
| 24 |
|
| 25 |
return $factory->make($content, $status, $headers); |
| 26 |
} |
| 27 |
|