Files
kiri-core/HttpServer/Controller.php
T

53 lines
813 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;
2021-08-11 01:04:57 +08:00
use Kiri\Abstracts\TraitApplication;
use Kiri\Application;
2021-08-13 16:53:24 +08:00
use Server\RequestInterface;
use Server\ResponseInterface;
2020-08-31 01:27:08 +08:00
/**
* Class WebController
2021-08-11 01:04:57 +08:00
* @package Kiri\Kiri\Web
2021-08-06 00:44:29 +08:00
* @property Application $container
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-06 00:44:29 +08:00
use TraitApplication;
/**
* @param Application $container
*/
public function __construct(protected Application $container)
{
}
/**
* inject request
*
2021-08-13 16:53:24 +08:00
* @var RequestInterface|null
2021-08-06 00:44:29 +08:00
*/
2021-08-13 16:53:24 +08:00
#[Inject(RequestInterface::class)]
public ?RequestInterface $request = null;
2021-08-06 00:44:29 +08:00
/**
* inject response
*
2021-08-13 16:53:24 +08:00
* @var ResponseInterface|null
2021-08-06 00:44:29 +08:00
*/
2021-08-13 16:53:24 +08:00
#[Inject(ResponseInterface::class)]
public ?ResponseInterface $response = null;
2021-08-06 00:44:29 +08:00
2020-11-10 18:04:42 +08:00
2020-08-31 01:27:08 +08:00
}