Skip to content

Commit

Permalink
适配hyperf3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
wilbur-yu committed Jan 11, 2024
1 parent 9c8d7d4 commit 43372b3
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 15 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"autoload-dev": {
},
"require": {
"php": ">=8.0",
"php": ">=8.1",
"ext-json": "*",
"guanguans/soar-php": "^3.0",
"hyperf/config": "^3.0",
Expand Down
16 changes: 9 additions & 7 deletions src/Aspect/ResponseAspect.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,20 @@
use Hyperf\Di\Annotation\Inject;
use Hyperf\Di\Aop\AbstractAspect;
use Hyperf\Di\Aop\ProceedingJoinPoint;
use Hyperf\Di\Exception\Exception;
use Hyperf\Engine\Channel;
use Hyperf\HttpMessage\Stream\SwooleStream;
use Hyperf\Utils\Exception\ParallelExecutionException;
use Hyperf\Utils\Parallel;
use Hyperf\Utils\Str;
use Hyperf\Coroutine\Exception\ParallelExecutionException;
use Hyperf\Coroutine\Parallel;
use Hyperf\Stringable\Str;
use JsonException;
use Throwable;
use Wilbur\HyperfSoar\Listener\QueryExecListener;
use Wilbur\HyperfSoar\SoarService;
use Psr\Container\ContainerInterface;

use function array_merge;
use function co;
use function Hyperf\Coroutine\co;
use function explode;
use function json_decode;
use function json_encode;
Expand Down Expand Up @@ -61,8 +63,8 @@ public function __construct(ContainerInterface $container)
}

/**
* @throws \Hyperf\Di\Exception\Exception
* @throws \JsonException
* @throws Exception
* @throws JsonException
*/
public function process(ProceedingJoinPoint $proceedingJoinPoint)
{
Expand Down Expand Up @@ -157,7 +159,7 @@ protected function getScore(?string $severity = null): ?int
}

/**
* @throws \JsonException
* @throws JsonException
*/
protected function formatting(string $json): array
{
Expand Down
2 changes: 1 addition & 1 deletion src/Exec.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ trait Exec
/**
* @param string $command
*
* @throws \Guanguans\SoarPHP\Exceptions\RuntimeException
* @throws RuntimeException
*
* @return mixed
*/
Expand Down
4 changes: 2 additions & 2 deletions src/Listener/QueryExecListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
use Hyperf\Database\Events\QueryExecuted;
use Hyperf\Event\Annotation\Listener;
use Hyperf\Event\Contract\ListenerInterface;
use Hyperf\Utils\Arr;
use Hyperf\Utils\Str;
use Hyperf\Collection\Arr;
use Hyperf\Stringable\Str;


#[Listener]
Expand Down
5 changes: 1 addition & 4 deletions src/SoarService.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,10 @@

use Guanguans\SoarPHP\Soar;

use Guanguans\SoarPHP\Support\OS;

use function config;
use function Hyperf\Config\config;

class SoarService extends Soar
{
// use Exec;

public function __construct(array $config = null)
{
Expand Down

0 comments on commit 43372b3

Please sign in to comment.