Files
kiri-core/HttpServer/Controller.php
T

68 lines
1002 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-02-08 17:01:03 +08:00
use Snowflake\Abstracts\TraitApplication;
2021-08-02 16:38:50 +08:00
use Snowflake\Application;
2021-08-04 14:05:00 +08:00
use Server\Constrict\Response as CrResponse;
2021-08-05 19:15:39 +08:00
use Server\Constrict\Request as CrRequest;
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
*
2021-08-05 19:15:39 +08:00
* @var CrRequest|null
2021-08-02 16:38:50 +08:00
*/
2021-08-05 19:15:39 +08:00
#[Inject(CrRequest::class)]
public ?CrRequest $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
*
2021-08-04 14:05:00 +08:00
* @var CrResponse|null
2021-08-02 16:38:50 +08:00
*/
2021-08-04 14:05:00 +08:00
#[Inject(CrResponse::class)]
public ?CrResponse $response = null;
2020-11-10 18:04:42 +08:00
2020-08-31 01:27:08 +08:00
}