From 60ffe087d797cbacd0f0ee29a119813e101f4f2d Mon Sep 17 00:00:00 2001 From: Arman <407448+armanist@users.noreply.github.com> Date: Thu, 29 Oct 2026 15:23:21 +0400 Subject: [PATCH 1/3] [#622] Review the pull requests into the maintenance branches with CodeRabbit Co-Authored-By: Claude Sonnet 5.5 --- .coderabbit.yaml | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .coderabbit.yaml diff --git a/.coderabbit.yaml b/.coderabbit.yaml new file mode 100644 index 00000000..1e5bcee3 --- /dev/null +++ b/.coderabbit.yaml @@ -0,0 +1,7 @@ +# CodeRabbit reviews pull requests into the default branch only, unless more branches are listed here. +# Also review the pull requests into the maintenance branches (3.1.x, 3.2.x, ...), so a change is +# reviewed in its own pull request and not only in the merge of the branch into master. +reviews: + auto_review: + base_branches: + - '^\d+\.\d+\.x$' From 414af9a23037f722bc674c61f7bb09f5f381bfca Mon Sep 17 00:00:00 2001 From: Arman <407448+armanist@users.noreply.github.com> Date: Thu, 29 Oct 2026 15:37:18 +0400 Subject: [PATCH 2/3] [#622] Fail the tests on warnings and risky tests in phpunit.xml Co-Authored-By: Claude Sonnet 5.5 --- phpunit.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/phpunit.xml b/phpunit.xml index 2c5efdfa..9e1e7533 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -6,6 +6,8 @@ colors="true" stderr="true" stopOnFailure="false" + failOnWarning="true" + failOnRisky="true" cacheDirectory=".phpunit.cache" > From d77c1059e6c2f5ed2c222fc15c6e55dfd5735a6d Mon Sep 17 00:00:00 2001 From: Arman <407448+armanist@users.noreply.github.com> Date: Thu, 29 Oct 2026 15:37:20 +0400 Subject: [PATCH 3/3] [#622] Balance the error handlers in ErrorHandlerTest Co-Authored-By: Claude Sonnet 5.5 --- tests/Unit/Tracer/ErrorHandlerTest.php | 49 ++++++++++++++------------ 1 file changed, 26 insertions(+), 23 deletions(-) diff --git a/tests/Unit/Tracer/ErrorHandlerTest.php b/tests/Unit/Tracer/ErrorHandlerTest.php index 89487c2c..86db8ff6 100644 --- a/tests/Unit/Tracer/ErrorHandlerTest.php +++ b/tests/Unit/Tracer/ErrorHandlerTest.php @@ -27,30 +27,28 @@ public function setUp(): void $this->errorHandler = new ErrorHandler(); } - public function tearDown(): void - { - restore_error_handler(); - restore_exception_handler(); - parent::tearDown(); - } - public function testSetupRegistersErrorHandler(): void { $logger = Mockery::mock(Logger::class); $this->errorHandler->setup($logger); - $currentHandler = set_error_handler(function () { - }); - restore_error_handler(); + try { + $currentHandler = set_error_handler(function () { + }); + restore_error_handler(); - $this->assertNotNull($currentHandler); - $this->assertInstanceOf(Closure::class, $currentHandler); + $this->assertNotNull($currentHandler); + $this->assertInstanceOf(Closure::class, $currentHandler); - $reflection = new ReflectionFunction($currentHandler); + $reflection = new ReflectionFunction($currentHandler); - $this->assertInstanceOf(ErrorHandler::class, $reflection->getClosureThis()); - $this->assertEquals('handleError', $reflection->getName()); + $this->assertInstanceOf(ErrorHandler::class, $reflection->getClosureThis()); + $this->assertEquals('handleError', $reflection->getName()); + } finally { + restore_error_handler(); + restore_exception_handler(); + } } public function testSetupRegistersExceptionHandler(): void @@ -59,17 +57,22 @@ public function testSetupRegistersExceptionHandler(): void $this->errorHandler->setup($logger); - $currentHandler = set_exception_handler(function () { - }); - restore_exception_handler(); + try { + $currentHandler = set_exception_handler(function () { + }); + restore_exception_handler(); - $this->assertNotNull($currentHandler); - $this->assertInstanceOf(Closure::class, $currentHandler); + $this->assertNotNull($currentHandler); + $this->assertInstanceOf(Closure::class, $currentHandler); - $reflection = new ReflectionFunction($currentHandler); + $reflection = new ReflectionFunction($currentHandler); - $this->assertInstanceOf(ErrorHandler::class, $reflection->getClosureThis()); - $this->assertEquals('handleException', $reflection->getName()); + $this->assertInstanceOf(ErrorHandler::class, $reflection->getClosureThis()); + $this->assertEquals('handleException', $reflection->getName()); + } finally { + restore_error_handler(); + restore_exception_handler(); + } } public function testHandleErrorThrowsErrorException(): void