Skip to content

Commit 31740b9

Browse files
committed
refactor(config): update soar configuration keys and comments
- Rename environment variable from `SOAR_SCORE_ENABLED` to `SOAR_ENABLED` to align with naming convention. - Update comments to improve clarity and better describe excluded items. - Replace '评分输出的命令、URL 路径、路由' with '评分的命令、请求路径、请求路由'. - Change '评分的 sql' to '评分的查询'. - Maintain consistency across configuration and documentation for readability and maintainability.
1 parent e591971 commit 31740b9

File tree

4 files changed

+222
-214
lines changed

4 files changed

+222
-214
lines changed

README-zh_CN.md

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -35,21 +35,19 @@
3535
## 环境要求
3636

3737
* PHP >= 8.0
38-
* ext-json
39-
* ext-pdo
4038

4139
## 安装
4240

4341
```shell
44-
$ composer require guanguans/laravel-soar --dev -v
42+
composer require guanguans/laravel-soar --dev --ansi -v
4543
```
4644

4745
## 配置
4846

4947
### 发布文件(可选的)
5048

5149
```shell
52-
$ php artisan vendor:publish --provider="Guanguans\\LaravelSoar\\SoarServiceProvider"
50+
php artisan vendor:publish --provider="Guanguans\\LaravelSoar\\SoarServiceProvider"
5351
```
5452

5553
### :warning: 在 unix 操作系统非 cli 环境中运行时,可能会抛出 Fatal error: ...Exit Code: 2(Misuse of shell builtins)
@@ -134,24 +132,35 @@ SQL
134132
<details>
135133
<summary><b>Debug bar</b></summary>
136134

135+
1. 安装 [barryvdh/laravel-debugbar](https://github.com/barryvdh/laravel-debugbar)
136+
2. 配置 [soar.outputs.Guanguans\LaravelSoar\Outputs\DebugBarOutput::class](config/soar.php)
137+
137138
![Debug bar](docs/debug-bar.png)
138139
</details>
139140

140141
<details>
141142
<summary><b>Clockwork</b></summary>
142143

144+
1. 安装 [itsgoingd/clockwork](https://github.com/itsgoingd/clockwork)
145+
2. 配置 [soar.outputs.Guanguans\LaravelSoar\Outputs\ClockworkOutput::class](config/soar.php)
146+
143147
![Clockwork](docs/clockwork.png)
144148
</details>
145149

146150
<details>
147151
<summary><b>Ray</b></summary>
148152

153+
1. 安装 [spatie/laravel-ray](https://github.com/spatie/laravel-ray)
154+
2. 配置 [soar.outputs.Guanguans\LaravelSoar\Outputs\RayOutput::class](config/soar.php)
155+
149156
![Ray](docs/ray.png)
150157
</details>
151158

152159
<details>
153160
<summary><b>Json 响应</b></summary>
154161

162+
1. 配置 [soar.outputs.Guanguans\LaravelSoar\Outputs\JsonOutput::class](config/soar.php)
163+
155164
```json
156165
{
157166
"message": "ok",
@@ -466,29 +475,25 @@ SQL
466475
<details>
467476
<summary><b>Console</b></summary>
468477

478+
1. 配置 [soar.outputs.Guanguans\LaravelSoar\Outputs\ConsoleOutput::class](config/soar.php)
479+
469480
![Console](docs/console.png)
470481
</details>
471482

472483
<details>
473484
<summary><b>Dump</b></summary>
474485

486+
1. 配置 [soar.outputs.Guanguans\LaravelSoar\Outputs\DumpOutput::class](config/soar.php)
487+
475488
![Dump](docs/dump.png)
476489
</details>
477490

478491
<details>
479492
<summary><b>Log</b></summary>
480493

481-
![Log](docs/log.png)
482-
</details>
483-
484-
<details>
485-
<summary><b>Error log</b></summary>
486-
487-
</details>
488-
489-
<details>
490-
<summary><b>Syslog</b></summary>
494+
1. 配置 [soar.outputs.Guanguans\LaravelSoar\Outputs\LogOutput::class](config/soar.php)
491495

496+
![Log](docs/log.png)
492497
</details>
493498

494499
<details>
@@ -503,19 +508,15 @@ declare(strict_types=1);
503508

504509
namespace Guanguans\LaravelSoar\Contracts;
505510

511+
use Illuminate\Console\Events\CommandFinished;
506512
use Illuminate\Support\Collection;
513+
use Symfony\Component\HttpFoundation\Response;
507514

508-
interface Output
515+
interface OutputContract
509516
{
510-
/**
511-
* @param \Illuminate\Console\Events\CommandFinished|\Symfony\Component\HttpFoundation\Response $outputter
512-
*/
513-
public function shouldOutput($outputter): bool;
517+
public function shouldOutput(CommandFinished|Response $outputter): bool;
514518

515-
/**
516-
* @param \Illuminate\Console\Events\CommandFinished|\Symfony\Component\HttpFoundation\Response $outputter
517-
*/
518-
public function output(Collection $scores, $outputter);
519+
public function output(Collection $scores, CommandFinished|Response $outputter): mixed;
519520
}
520521
```
521522

@@ -639,7 +640,7 @@ namespace Illuminate\Database\Eloquent {
639640
## 测试
640641

641642
```shell
642-
$ composer test
643+
composer test
643644
```
644645

645646
## 变更日志

README.md

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -35,21 +35,19 @@
3535
## Requirement
3636

3737
* PHP >= 8.0
38-
* ext-json
39-
* ext-pdo
4038

4139
## Installation
4240

4341
```shell
44-
$ composer require guanguans/laravel-soar --dev -v
42+
composer require guanguans/laravel-soar --dev --ansi -v
4543
```
4644

4745
## Configuration
4846

4947
### Publish files(optional)
5048

5149
```shell
52-
$ php artisan vendor:publish --provider="Guanguans\\LaravelSoar\\SoarServiceProvider"
50+
php artisan vendor:publish --provider="Guanguans\\LaravelSoar\\SoarServiceProvider"
5351
```
5452

5553
### :warning: When running in a unix OS non-cli environment, may throw Fatal error: ...Exit Code: 2(Misuse of shell builtins)
@@ -134,24 +132,35 @@ SQL
134132
<details>
135133
<summary><b>Debug bar</b></summary>
136134

135+
1. Install [barryvdh/laravel-debugbar](https://github.com/barryvdh/laravel-debugbar)
136+
2. Configure [soar.outputs.Guanguans\LaravelSoar\Outputs\DebugBarOutput::class](config/soar.php)
137+
137138
![Debug bar](docs/debug-bar.png)
138139
</details>
139140

140141
<details>
141142
<summary><b>Clockwork</b></summary>
142143

144+
1. Install [itsgoingd/clockwork](https://github.com/itsgoingd/clockwork)
145+
2. Configure [soar.outputs.Guanguans\LaravelSoar\Outputs\ClockworkOutput::class](config/soar.php)
146+
143147
![Clockwork](docs/clockwork.png)
144148
</details>
145149

146150
<details>
147151
<summary><b>Ray</b></summary>
148152

153+
1. Install [spatie/laravel-ray](https://github.com/spatie/laravel-ray)
154+
2. Configure [soar.outputs.Guanguans\LaravelSoar\Outputs\RayOutput::class](config/soar.php)
155+
149156
![Ray](docs/ray.png)
150157
</details>
151158

152159
<details>
153160
<summary><b>Json response</b></summary>
154161

162+
1. Configure [soar.outputs.Guanguans\LaravelSoar\Outputs\JsonOutput::class](config/soar.php)
163+
155164
```json
156165
{
157166
"message": "ok",
@@ -466,29 +475,25 @@ SQL
466475
<details>
467476
<summary><b>Console</b></summary>
468477

478+
1. Configure [soar.outputs.Guanguans\LaravelSoar\Outputs\ConsoleOutput::class](config/soar.php)
479+
469480
![Console](docs/console.png)
470481
</details>
471482

472483
<details>
473484
<summary><b>Dump</b></summary>
474485

486+
1. Configure [soar.outputs.Guanguans\LaravelSoar\Outputs\DumpOutput::class](config/soar.php)
487+
475488
![Dump](docs/dump.png)
476489
</details>
477490

478491
<details>
479492
<summary><b>Log</b></summary>
480493

481-
![Log](docs/log.png)
482-
</details>
483-
484-
<details>
485-
<summary><b>Error log</b></summary>
486-
487-
</details>
488-
489-
<details>
490-
<summary><b>Syslog</b></summary>
494+
1. Configure [soar.outputs.Guanguans\LaravelSoar\Outputs\LogOutput::class](config/soar.php)
491495

496+
![Log](docs/log.png)
492497
</details>
493498

494499
<details>
@@ -503,19 +508,15 @@ declare(strict_types=1);
503508

504509
namespace Guanguans\LaravelSoar\Contracts;
505510

511+
use Illuminate\Console\Events\CommandFinished;
506512
use Illuminate\Support\Collection;
513+
use Symfony\Component\HttpFoundation\Response;
507514

508-
interface Output
515+
interface OutputContract
509516
{
510-
/**
511-
* @param \Illuminate\Console\Events\CommandFinished|\Symfony\Component\HttpFoundation\Response $outputter
512-
*/
513-
public function shouldOutput($outputter): bool;
517+
public function shouldOutput(CommandFinished|Response $outputter): bool;
514518

515-
/**
516-
* @param \Illuminate\Console\Events\CommandFinished|\Symfony\Component\HttpFoundation\Response $outputter
517-
*/
518-
public function output(Collection $scores, $outputter);
519+
public function output(Collection $scores, CommandFinished|Response $outputter): mixed;
519520
}
520521
```
521522

@@ -639,7 +640,7 @@ namespace Illuminate\Database\Eloquent {
639640
## Testing
640641

641642
```shell
642-
$ composer test
643+
composer test
643644
```
644645

645646
## Changelog

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@
8585
"shipmonk/composer-dependency-analyser": "^1.8",
8686
"shipmonk/dead-code-detector": "^0.11",
8787
"shipmonk/phpstan-baseline-per-identifier": "^2.1",
88+
"spatie/laravel-ray": "^1.40",
8889
"spatie/pest-plugin-snapshots": "^1.1 || ^2.0",
89-
"spatie/ray": "^1.42",
9090
"spaze/phpstan-disallowed-calls": "^4.5",
9191
"staabm/phpstan-todo-by": "^0.2",
9292
"symfony/thanks": "^1.3",
@@ -102,7 +102,7 @@
102102
"buggregator/trap": "Output SQL scores to Trap.",
103103
"itsgoingd/clockwork": "Output SQL scores to Clockwork.",
104104
"laradumps/laradumps": "Output SQL scores to Laradumps.",
105-
"spatie/ray": "Output SQL scores to Spatie Ray."
105+
"spatie/laravel-ray": "Output SQL scores to Laravel Ray."
106106
},
107107
"repositories": {
108108
"facade-documenter": {

0 commit comments

Comments
 (0)