Skip to content

Commit 566d69a

Browse files
committed
[TASK] Optimise code flow for Configuration class methods.
1 parent acd0de3 commit 566d69a

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/Configuration.php

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,20 @@ public static function getHost($hostName): Host
1212
{
1313
if (isset(Deployer::get()->hosts[$hostName])) {
1414
return Deployer::get()->hosts[$hostName];
15-
} else {
16-
throw new \RuntimeException('Name of host "' . $hostName . '" is not on hosts list:' .
17-
implode(',', array_keys(Deployer::get()->hosts)) . "\n" . 'Please check case sensitive.',
18-
1500717628491);
1915
}
16+
throw new \RuntimeException('Name of host "' . $hostName . '" is not on hosts list:' .
17+
implode(',', array_keys(Deployer::get()->hosts)) . "\n" . 'Please check case sensitive.',
18+
1500717628491);
2019
}
2120

2221
public static function getLocalHost(): Host
2322
{
2423
$defaultStage = Context::get()->getConfig()->get('default_stage');
2524
if (isset(Deployer::get()->hosts[$defaultStage])) {
2625
return Deployer::get()->hosts[$defaultStage];
27-
} else {
28-
throw new \RuntimeException('Name of host "' . $defaultStage . '" is not on hosts list:' .
29-
implode(',', array_keys(Deployer::get()->hosts)) . "\n" . 'Please check case sensitive.',
30-
1500717628491);
3126
}
27+
throw new \RuntimeException('Name of host "' . $defaultStage . '" is not on hosts list:' .
28+
implode(',', array_keys(Deployer::get()->hosts)) . "\n" . 'Please check case sensitive.',
29+
1500717628491);
3230
}
3331
}

0 commit comments

Comments
 (0)