Files
kiri-core/HttpServer/Controller.php
T

67 lines
922 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;
2021-08-02 16:38:50 +08:00
use Snowflake\Application;
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-08-02 16:38:50 +08:00
use TraitApplication;
2021-02-08 17:01:03 +08:00
2020-09-10 15:54:14 +08:00
2021-08-02 16:38:50 +08:00
/**
* @param Application $container
*/
public function __construct(protected Application $container)
{
2020-09-10 15:54:14 +08:00
2021-08-02 16:38:50 +08:00
}
2021-03-29 17:29:39 +08:00
2021-07-27 00:41:00 +08:00
2021-08-02 16:38:50 +08:00
/**
* inject request
*
* @var Request|null
*/
#[Inject('request')]
public ?Request $request = null;
2021-07-27 00:41:00 +08:00
2021-08-02 16:38:50 +08:00
/**
* @var HttpParams|null
*/
#[Inject('input')]
public ?HttpParams $input = null;
2021-07-27 00:41:00 +08:00
2021-08-02 16:38:50 +08:00
/**
* @var HttpHeaders|null
*/
#[Inject('header')]
public ?HttpHeaders $header = null;
/**
* inject response
*
* @var Response|null
*/
#[Inject('response')]
public ?Response $response = null;
2020-11-10 18:04:42 +08:00
2020-08-31 01:27:08 +08:00
}