Skip to content

Commit 43372b3

Browse files
committed
适配hyperf3.1
1 parent 9c8d7d4 commit 43372b3

File tree

5 files changed

+14
-15
lines changed

5 files changed

+14
-15
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"autoload-dev": {
2929
},
3030
"require": {
31-
"php": ">=8.0",
31+
"php": ">=8.1",
3232
"ext-json": "*",
3333
"guanguans/soar-php": "^3.0",
3434
"hyperf/config": "^3.0",

src/Aspect/ResponseAspect.php

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,20 @@
2121
use Hyperf\Di\Annotation\Inject;
2222
use Hyperf\Di\Aop\AbstractAspect;
2323
use Hyperf\Di\Aop\ProceedingJoinPoint;
24+
use Hyperf\Di\Exception\Exception;
2425
use Hyperf\Engine\Channel;
2526
use Hyperf\HttpMessage\Stream\SwooleStream;
26-
use Hyperf\Utils\Exception\ParallelExecutionException;
27-
use Hyperf\Utils\Parallel;
28-
use Hyperf\Utils\Str;
27+
use Hyperf\Coroutine\Exception\ParallelExecutionException;
28+
use Hyperf\Coroutine\Parallel;
29+
use Hyperf\Stringable\Str;
30+
use JsonException;
2931
use Throwable;
3032
use Wilbur\HyperfSoar\Listener\QueryExecListener;
3133
use Wilbur\HyperfSoar\SoarService;
3234
use Psr\Container\ContainerInterface;
3335

3436
use function array_merge;
35-
use function co;
37+
use function Hyperf\Coroutine\co;
3638
use function explode;
3739
use function json_decode;
3840
use function json_encode;
@@ -61,8 +63,8 @@ public function __construct(ContainerInterface $container)
6163
}
6264

6365
/**
64-
* @throws \Hyperf\Di\Exception\Exception
65-
* @throws \JsonException
66+
* @throws Exception
67+
* @throws JsonException
6668
*/
6769
public function process(ProceedingJoinPoint $proceedingJoinPoint)
6870
{
@@ -157,7 +159,7 @@ protected function getScore(?string $severity = null): ?int
157159
}
158160

159161
/**
160-
* @throws \JsonException
162+
* @throws JsonException
161163
*/
162164
protected function formatting(string $json): array
163165
{

src/Exec.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ trait Exec
2424
/**
2525
* @param string $command
2626
*
27-
* @throws \Guanguans\SoarPHP\Exceptions\RuntimeException
27+
* @throws RuntimeException
2828
*
2929
* @return mixed
3030
*/

src/Listener/QueryExecListener.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
use Hyperf\Database\Events\QueryExecuted;
2121
use Hyperf\Event\Annotation\Listener;
2222
use Hyperf\Event\Contract\ListenerInterface;
23-
use Hyperf\Utils\Arr;
24-
use Hyperf\Utils\Str;
23+
use Hyperf\Collection\Arr;
24+
use Hyperf\Stringable\Str;
2525

2626

2727
#[Listener]

src/SoarService.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,10 @@
1717

1818
use Guanguans\SoarPHP\Soar;
1919

20-
use Guanguans\SoarPHP\Support\OS;
21-
22-
use function config;
20+
use function Hyperf\Config\config;
2321

2422
class SoarService extends Soar
2523
{
26-
// use Exec;
2724

2825
public function __construct(array $config = null)
2926
{

0 commit comments

Comments
 (0)