Files
kiri-core/HttpServer/Controller.php
T

65 lines
1.1 KiB
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-17 16:23:49 +08:00
use JetBrains\PhpStorm\Pure;
2021-08-11 01:04:57 +08:00
use Kiri\Abstracts\TraitApplication;
use Kiri\Application;
2021-08-17 16:23:49 +08:00
use Kiri\Di\Container;
use Kiri\Di\ContainerInterface;
use Kiri\Kiri;
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;
/**
2021-08-17 16:23:49 +08:00
* @param Application $application
2021-08-06 00:44:29 +08:00
*/
2021-08-17 16:23:49 +08:00
#[Pure] public function __construct(protected Application $application)
2021-08-06 00:44:29 +08:00
{
}
2021-08-17 16:23:49 +08:00
/**
* inject di container
*
* @var ContainerInterface|null
*/
#[Inject(ContainerInterface::class)]
public ?ContainerInterface $container = null;
2021-08-06 00:44:29 +08:00
/**
* 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
}