Skip to content

Commit 15834ab

Browse files
committed
fixup! Use ternary operator
1 parent b6c6b7f commit 15834ab

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

library/Vspheredb/Polling/CurlOptions.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,7 @@ class CurlOptions
2222
public static function forServerInfo(ServerInfo $server): array
2323
{
2424
$host = $server->get('host');
25-
if (preg_match('/^(.+?):(\d{1,5})$/', $host, $match)) {
26-
$port = (int) $match[2];
27-
} else {
28-
$port = null;
29-
}
30-
$options = [CURLOPT_HTTPHEADER => ['Expect:', 'User-Agent: Icinga-vSphereDB/1.8']];
25+
$port = preg_match('/^(.+?):(\d{1,5})$/', $host, $match) ? (int) $match[2] : null;
3126
$options[CURLOPT_HTTPHEADER] = ['Expect:', 'User-Agent: Icinga-vSphereDB/1.8'];
3227

3328
if ($proxyType = $server->get('proxy_type')) {

0 commit comments

Comments
 (0)