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

Skip to content

Commit a527afe

Browse files
committed
De-yoda conditionals
1 parent b890596 commit a527afe

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
@@ -92,7 +92,7 @@ protected function getExceptionLogLevel(\Exception $exception): string
9292
$statusCode = $exception->getStatusCode();
9393
if (isset($this->httpStatusCodeLogLevel[$statusCode])) {
9494
$logLevel = $this->httpStatusCodeLogLevel[$statusCode];
95-
} elseif (400 <= $statusCode && $statusCode < 500) {
95+
} elseif ($statusCode >= 400 && $statusCode < 500) {
9696
$logLevel = LogLevel::WARNING;
9797
}
9898
}

0 commit comments

Comments
 (0)