Skip to content

Commit 2c69244

Browse files
[9.x] Allows shouldIgnoresDeprecationError() to be overriden (#45299)
* Allows `shouldIgnoresDeprecationError()` to be overriden * wip * wip * wip * Update HandleExceptions.php Co-authored-by: Taylor Otwell <[email protected]>
1 parent 7469819 commit 2c69244

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

src/Illuminate/Foundation/Bootstrap/HandleExceptions.php

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,7 @@ public function handleDeprecation($message, $file, $line)
102102
*/
103103
public function handleDeprecationError($message, $file, $line, $level = E_DEPRECATED)
104104
{
105-
if (! class_exists(LogManager::class)
106-
|| ! static::$app->hasBeenBootstrapped()
107-
|| static::$app->runningUnitTests()
108-
) {
105+
if ($this->shouldIgnoreDeprecationErrors()) {
109106
return;
110107
}
111108

@@ -130,6 +127,18 @@ public function handleDeprecationError($message, $file, $line, $level = E_DEPREC
130127
});
131128
}
132129

130+
/**
131+
* Determine if deprecation errors should be ignored.
132+
*
133+
* @return bool
134+
*/
135+
protected function shouldIgnoreDeprecationErrors()
136+
{
137+
return ! class_exists(LogManager::class)
138+
|| ! static::$app->hasBeenBootstrapped()
139+
|| static::$app->runningUnitTests();
140+
}
141+
133142
/**
134143
* Ensure the "deprecations" logger is configured.
135144
*

0 commit comments

Comments
 (0)