Skip to content

Commit 5437a4f

Browse files
committed
refactor: extract isDisplayErrorsEnabled()
1 parent f7c471d commit 5437a4f

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

system/Debug/ExceptionHandler.php

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -134,13 +134,7 @@ protected function determineView(
134134
// Production environments should have a custom exception file.
135135
$view = 'production.php';
136136

137-
if (
138-
in_array(
139-
strtolower(ini_get('display_errors')),
140-
['1', 'true', 'on', 'yes'],
141-
true
142-
)
143-
) {
137+
if ($this->isDisplayErrorsEnabled()) {
144138
$view = 'error_exception.php';
145139
}
146140

@@ -158,4 +152,13 @@ protected function determineView(
158152

159153
return $view;
160154
}
155+
156+
private function isDisplayErrorsEnabled(): bool
157+
{
158+
return in_array(
159+
strtolower(ini_get('display_errors')),
160+
['1', 'true', 'on', 'yes'],
161+
true
162+
);
163+
}
161164
}

0 commit comments

Comments
 (0)