Skip to content

Commit c48540d

Browse files
authored
[8.x] Catch suppressed deprecation logs (#40942)
* Report "suppressed" deprecations * Report "suppressed" deprecations on tests
1 parent 29bc877 commit c48540d

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/Illuminate/Foundation/Bootstrap/HandleExceptions.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,11 @@ public function bootstrap(Application $app)
6767
*/
6868
public function handleError($level, $message, $file = '', $line = 0, $context = [])
6969
{
70-
if (error_reporting() & $level) {
71-
if ($this->isDeprecation($level)) {
72-
return $this->handleDeprecation($message, $file, $line);
73-
}
70+
if ($this->isDeprecation($level)) {
71+
return $this->handleDeprecation($message, $file, $line);
72+
}
7473

74+
if (error_reporting() & $level) {
7575
throw new ErrorException($message, 0, $level, $file, $line);
7676
}
7777
}

src/Illuminate/Foundation/Testing/Concerns/InteractsWithDeprecationHandling.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ protected function withoutDeprecationHandling()
3838
{
3939
if ($this->originalDeprecationHandler == null) {
4040
$this->originalDeprecationHandler = set_error_handler(function ($level, $message, $file = '', $line = 0) {
41-
if (error_reporting() & $level) {
41+
if (in_array($level, [E_DEPRECATED, E_USER_DEPRECATED]) || (error_reporting() & $level)) {
4242
throw new ErrorException($message, 0, $level, $file, $line);
4343
}
4444
});

0 commit comments

Comments
 (0)