File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change 1212
1313namespace App \Controller ;
1414
15+ use Hyperf \Di \Annotation \Inject ;
1516use Hyperf \HttpServer \Contract \RequestInterface ;
1617use Hyperf \HttpServer \Contract \ResponseInterface ;
1718use Psr \Container \ContainerInterface ;
1819
1920abstract class Controller
2021{
2122 /**
23+ * @Inject
2224 * @var ContainerInterface
2325 */
2426 protected $ container ;
2527
2628 /**
29+ * @Inject
2730 * @var RequestInterface
2831 */
2932 protected $ request ;
3033
3134 /**
35+ * @Inject
3236 * @var ResponseInterface
3337 */
3438 protected $ response ;
35-
36- public function __construct (ContainerInterface $ container )
37- {
38- $ this ->container = $ container ;
39- $ this ->request = $ container ->get (RequestInterface::class);
40- $ this ->response = $ container ->get (ResponseInterface::class);
41- }
4239}
You can’t perform that action at this time.
0 commit comments