Skip to content

Commit 40a975c

Browse files
committed
Update: 测试修正的错误捕获处理
1 parent 31631a1 commit 40a975c

File tree

3 files changed

+5
-18
lines changed

3 files changed

+5
-18
lines changed

src/Components/database/tests/config/config.php

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,7 @@
1010
'Database' => 'Imi\Db',
1111
],
1212

13-
'beans' => [
14-
'ErrorLog' => [
15-
'catchLevel' => \E_ALL,
16-
'exceptionLevel' => \E_ALL,
17-
'errorEventHandlers' => [
18-
\Imi\Test\Component\ErrorEventHandler::class,
19-
],
20-
],
21-
],
13+
'beans' => [],
2214

2315
// 日志配置
2416
'logger' => [

src/Components/redis/tests/config/config.php

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,7 @@
4646
],
4747
],
4848

49-
'beans' => [
50-
'ErrorLog' => [
51-
'catchLevel' => \E_ALL,
52-
'exceptionLevel' => \E_ALL,
53-
'errorEventHandlers' => [
54-
\Imi\Test\Component\ErrorEventHandler::class,
55-
],
56-
],
57-
],
49+
'beans' => [],
5850

5951
'connectionCenter' => [
6052
'test_phpredis_standalone' => [

src/Log/ErrorLog.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ public function register(): void
5151
*/
5252
public function onError(int $errno, string $errstr, string $errfile, int $errline): void
5353
{
54+
if (0 === (error_reporting() & $errno)) {
55+
return;
56+
}
5457
foreach ($this->errorEventHandlers as $class)
5558
{
5659
$handler = new $class();

0 commit comments

Comments
 (0)