Skip to content

Commit 099d96e

Browse files
committed
Only support php >= 8.0
1 parent 4be884a commit 099d96e

File tree

8 files changed

+23
-47
lines changed

8 files changed

+23
-47
lines changed

app/Controller/AbstractController.php

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,12 @@
1818

1919
abstract class AbstractController
2020
{
21-
/**
22-
* @Inject
23-
* @var ContainerInterface
24-
*/
25-
protected $container;
21+
#[Inject]
22+
protected ContainerInterface $container;
2623

27-
/**
28-
* @Inject
29-
* @var RequestInterface
30-
*/
31-
protected $request;
24+
#[Inject]
25+
protected RequestInterface $request;
3226

33-
/**
34-
* @Inject
35-
* @var ResponseInterface
36-
*/
37-
protected $response;
27+
#[Inject]
28+
protected ResponseInterface $response;
3829
}

app/Exception/Handler/AppExceptionHandler.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,8 @@
1919

2020
class AppExceptionHandler extends ExceptionHandler
2121
{
22-
/**
23-
* @var StdoutLoggerInterface
24-
*/
25-
protected $logger;
26-
27-
public function __construct(StdoutLoggerInterface $logger)
22+
public function __construct(protected StdoutLoggerInterface $logger)
2823
{
29-
$this->logger = $logger;
3024
}
3125

3226
public function handle(Throwable $throwable, ResponseInterface $response)

app/Listener/DbQueryExecutedListener.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@
2020
use Psr\Container\ContainerInterface;
2121
use Psr\Log\LoggerInterface;
2222

23-
/**
24-
* @Listener
25-
*/
23+
#[Listener]
2624
class DbQueryExecutedListener implements ListenerInterface
2725
{
2826
/**

bin/hyperf.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
#!/usr/bin/env php
22
<?php
3-
3+
/**
4+
* This file is part of Hyperf.
5+
*
6+
* @link https://www.hyperf.io
7+
* @document https://hyperf.wiki
8+
* @contact [email protected]
9+
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
10+
*/
411
ini_set('display_errors', 'on');
512
ini_set('display_startup_errors', 'on');
613
ini_set('memory_limit', '1G');

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"description": "A coroutine framework that focuses on hyperspeed and flexible, specifically use for build microservices and middlewares.",
1313
"license": "Apache-2.0",
1414
"require": {
15-
"php": ">=7.3",
15+
"php": ">=8.0",
1616
"hyperf/cache": "~2.2.0",
1717
"hyperf/command": "~2.2.0",
1818
"hyperf/config": "~2.2.0",

installer/resources/async_queue/AsyncQueueConsumer.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@
1414
use Hyperf\AsyncQueue\Process\ConsumerProcess;
1515
use Hyperf\Process\Annotation\Process;
1616

17-
/**
18-
* @Process
19-
*/
17+
#[Process]
2018
class AsyncQueueConsumer extends ConsumerProcess
2119
{
2220
}

installer/resources/async_queue/QueueHandleListener.php

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,26 +21,16 @@
2121
use Hyperf\Event\Contract\ListenerInterface;
2222
use Hyperf\ExceptionHandler\Formatter\FormatterInterface;
2323
use Hyperf\Logger\LoggerFactory;
24+
use Psr\Log\LoggerInterface;
2425

25-
/**
26-
* @Listener
27-
*/
26+
#[Listener]
2827
class QueueHandleListener implements ListenerInterface
2928
{
30-
/**
31-
* @var \Psr\Log\LoggerInterface
32-
*/
33-
protected $logger;
34-
35-
/**
36-
* @var FormatterInterface
37-
*/
38-
protected $formatter;
29+
protected LoggerInterface $logger;
3930

40-
public function __construct(LoggerFactory $loggerFactory, FormatterInterface $formatter)
31+
public function __construct(LoggerFactory $loggerFactory, protected FormatterInterface $formatter)
4132
{
4233
$this->logger = $loggerFactory->get('queue');
43-
$this->formatter = $formatter;
4434
}
4535

4636
public function listen(): array

installer/resources/constants/ErrorCode.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@
1414
use Hyperf\Constants\AbstractConstants;
1515
use Hyperf\Constants\Annotation\Constants;
1616

17-
/**
18-
* @Constants
19-
*/
17+
#[Constants]
2018
class ErrorCode extends AbstractConstants
2119
{
2220
/**

0 commit comments

Comments
 (0)