Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 69ac111

Browse files
committed
De-yoda conditionals
1 parent db70c1a commit 69ac111

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Symfony/Bundle/TwigBundle/DependencyInjection/Configuration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ private function addHttpExceptionLogLevels(ArrayNodeDefinition $rootNode)
210210
->always(function ($v) {
211211
$map = array();
212212
foreach ($v as $status => $level) {
213-
if (!(is_int($status) && 100 <= $status && $status <= 599)) {
213+
if (!(is_int($status) && $status >= 100 && $status <= 599)) {
214214
throw new InvalidConfigurationException(sprintf(
215215
'The configured status code "%s" in twig.http_exception_log_levels is not a valid http status code.',
216216
$status

src/Symfony/Component/HttpKernel/EventListener/ExceptionListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ protected function getExceptionLogLevel(\Exception $exception): string
104104
$statusCode = $exception->getStatusCode();
105105
if (isset($this->httpStatusCodeLogLevel[$statusCode])) {
106106
$logLevel = $this->httpStatusCodeLogLevel[$statusCode];
107-
} elseif (400 <= $statusCode && $statusCode < 500) {
107+
} elseif ($statusCode >= 400 && $statusCode < 500) {
108108
$logLevel = LogLevel::WARNING;
109109
}
110110
}

0 commit comments

Comments
 (0)