Skip to content

Commit 756b9bb

Browse files
committed
docs: fix ErrorHelpersTrait docblocks, sync with SmartString (twin rule)
Comments only, no code changes. The logDeprecation() docblock claimed the @ suppressor still lets PHP's built-in error logging capture the notice - verified false with a CLI probe: @ mutes default display and logging, and only a custom set_error_handler receives the notices. Rewrote that docblock in plain terms, same text in both repos. Also corrects the getExternalCaller() return shape: line is int|string, not string.
1 parent b5b398b commit 756b9bb

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/ErrorHelpersTrait.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@ trait ErrorHelpersTrait
1818
/**
1919
* Logs a deprecation notice via trigger_error() with the calling file and line number.
2020
*
21-
* The @ suppressor prevents direct output while still allowing custom error handlers
22-
* and PHP's built-in error logging to capture the notice.
21+
* The @ suppressor mutes PHP's default display and logging. Only a custom error
22+
* handler (set_error_handler) receives these notices; without one, nothing is
23+
* shown or logged. This is deliberate: deprecation notices are meant for error
24+
* handlers that collect them, never for page output.
2325
*/
2426
protected static function logDeprecation(string $message): void
2527
{
@@ -34,7 +36,7 @@ protected static function logDeprecation(string $message): void
3436
* Walks the debug backtrace to find the first frame that isn't in the same
3537
* directory as the current file, giving us the actual calling code location.
3638
*
37-
* @return array{file: string, line: string, function: string}
39+
* @return array{file: string, line: int|string, function: string}
3840
*/
3941
private static function getExternalCaller(): array
4042
{

0 commit comments

Comments
 (0)