Files
kiri-core/HttpServer/Controller.php
T

57 lines
912 B
PHP
Raw Normal View History

2020-08-31 01:27:08 +08:00
<?php
2020-10-29 18:17:25 +08:00
declare(strict_types=1);
2020-08-31 01:27:08 +08:00
namespace HttpServer;
2021-07-27 00:35:50 +08:00
use Annotation\Inject;
2020-08-31 01:27:08 +08:00
use HttpServer\Http\HttpHeaders;
use HttpServer\Http\HttpParams;
use HttpServer\Http\Request;
2021-07-27 00:35:50 +08:00
use HttpServer\Http\Response;
2021-02-08 17:01:03 +08:00
use Snowflake\Abstracts\TraitApplication;
2020-08-31 01:27:08 +08:00
/**
* Class WebController
2020-08-31 12:38:32 +08:00
* @package Snowflake\Snowflake\Web
2020-08-31 01:27:08 +08:00
*/
2021-07-27 00:35:50 +08:00
class Controller
2020-08-31 01:27:08 +08:00
{
2021-07-27 00:35:50 +08:00
use TraitApplication;
2021-02-08 17:01:03 +08:00
2020-09-10 15:54:14 +08:00
2021-07-27 00:35:50 +08:00
/**
* inject request
*
2021-07-28 14:00:38 +08:00
* @var Request|null
2021-07-27 00:35:50 +08:00
*/
2021-08-01 15:25:59 +08:00
#[Inject(value: Request::class)]
2021-07-27 04:16:42 +08:00
public ?Request $request = null;
2020-09-10 15:54:14 +08:00
2021-03-29 17:29:39 +08:00
2021-07-27 00:41:00 +08:00
/**
2021-07-28 14:00:38 +08:00
* @var HttpParams|null
2021-07-27 00:41:00 +08:00
*/
2021-07-28 14:00:38 +08:00
#[Inject(value: HttpParams::class)]
2021-07-27 04:16:42 +08:00
public ?HttpParams $input = null;
2021-07-27 00:41:00 +08:00
/**
2021-07-28 14:00:38 +08:00
* @var HttpHeaders|null
2021-07-27 00:41:00 +08:00
*/
2021-07-28 14:00:38 +08:00
#[Inject(value: HttpHeaders::class)]
2021-07-27 04:16:42 +08:00
public ?HttpHeaders $header = null;
2021-07-27 00:41:00 +08:00
2021-07-27 00:35:50 +08:00
/**
* inject response
*
2021-07-28 14:00:38 +08:00
* @var Response|null
2021-07-27 00:35:50 +08:00
*/
2021-08-01 15:25:59 +08:00
#[Inject(value: Response::class)]
2021-07-27 04:16:42 +08:00
public ?Response $response = null;
2020-11-10 18:04:42 +08:00
2020-08-31 01:27:08 +08:00
}