Skip to content

Commit 53d9659

Browse files
committed
升级guanguans/soar-php至3.0
1 parent 5c56f82 commit 53d9659

File tree

4 files changed

+6
-17
lines changed

4 files changed

+6
-17
lines changed

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
"friendsofphp/php-cs-fixer": "^3.0",
4242
"mockery/mockery": "^1.0",
4343
"phpunit/phpunit": ">=7.0",
44+
"swoole/ide-helper": "^5.0",
4445
"symfony/var-dumper": "^5.1"
4546
},
4647
"config": {

src/Aspect/ResponseAspect.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ protected function parallel(array $eventSqlList): array
122122
try {
123123
foreach ($eventSqlList as $sql) {
124124
$parallel->add(function () use ($sql) {
125-
$soar = $this->service->score($sql);
125+
$soar = $this->service->jsonScores($sql);
126126

127127
return $this->formatting($soar);
128128
});

src/Exec.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
namespace Wilbur\HyperfSoar;
1717

1818
use Guanguans\SoarPHP\Exceptions\RuntimeException;
19-
use Guanguans\SoarPHP\Support\OsHelper;
19+
use Guanguans\SoarPHP\Support\OS;
2020
use Swoole\Coroutine\System;
2121

2222
trait Exec
@@ -30,7 +30,7 @@ trait Exec
3030
*/
3131
public function exec(string $command): string
3232
{
33-
OsHelper::isWindows() && $command = 'powershell '.$command;
33+
OS::isWindows() && $command = 'powershell '.$command;
3434
$result = System::exec($command);
3535

3636
if ($result['code'] !== 0) {

src/SoarService.php

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@
1717

1818
use Guanguans\SoarPHP\Soar;
1919

20-
use Guanguans\SoarPHP\Support\OsHelper;
20+
use Guanguans\SoarPHP\Support\OS;
2121

2222
use function config;
2323

2424
class SoarService extends Soar
2525
{
26-
use Exec;
26+
// use Exec;
2727

2828
public function __construct(array $config = null)
2929
{
@@ -33,16 +33,4 @@ public function __construct(array $config = null)
3333
unset($config['enabled'], $config['cut_classes'], $config['-soar-path']);
3434
parent::__construct($config, $soarPath);
3535
}
36-
37-
protected function getDefaultSoarPath(): string
38-
{
39-
if (OsHelper::isWindows()) {
40-
return __DIR__.'/../vendor/guanguans/soar-php/bin/soar.windows-amd64';
41-
}
42-
if (OsHelper::isMacOS()) {
43-
return __DIR__.'/../vendor/guanguans/soar-php/bin/soar.darwin-amd64';
44-
}
45-
46-
return __DIR__.'/../vendor/guanguans/soar-php/bin/soar.linux-amd64';
47-
}
4836
}

0 commit comments

Comments
 (0)