Skip to content

Commit 03c8d38

Browse files
Simplify if else statement
1 parent cffb82e commit 03c8d38

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/Log/Webhook.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,9 @@ public function setup(array $options)
130130
}
131131

132132
// PHP >7.2 deprecated the filter options and enabled them by default
133-
if (version_compare(PHP_VERSION, '7.2.0', '<')) {
134-
$filterOptions = FILTER_FLAG_SCHEME_REQUIRED | FILTER_FLAG_HOST_REQUIRED;
135-
} else {
136-
$filterOptions = null;
137-
}
133+
$filterOptions = version_compare(PHP_VERSION, '7.2.0', '<')
134+
? FILTER_FLAG_SCHEME_REQUIRED | FILTER_FLAG_HOST_REQUIRED
135+
: null;
138136

139137
if (!filter_var($options['uri'], FILTER_VALIDATE_URL, $filterOptions)) {
140138
throw new Exception('webhook URI is invalid');

0 commit comments

Comments
 (0)