Move SSL Setting To An Array

This will match the add function and help with PHPMD errors
This commit is contained in:
Phil Young
2021-06-22 11:13:53 +01:00
parent 410b8bebff
commit 63b11374f2
2 changed files with 79 additions and 67 deletions

View File

@@ -129,8 +129,7 @@ class CustomHostnames implements API
* @param string $customOriginServer
* @param bool|null $wildcard
* @param string $bundleMethod
* @param string $customKey
* @param string $customCertificate
* @param array $customSsl
* @return \stdClass
*/
public function updateHostname(
@@ -142,8 +141,8 @@ class CustomHostnames implements API
string $customOriginServer = '',
?bool $wildcard = null,
string $bundleMethod = '',
string $customKey = '',
string $customCertificate = ''): \stdClass {
array $customSsl = []
): \stdClass {
$query = [];
if (!empty($sslMethod)) {
@@ -166,12 +165,12 @@ class CustomHostnames implements API
$query['bundle_method'] = $bundleMethod;
}
if (empty($customKey) === false) {
$query['custom_key'] = $customKey;
if (empty($customSsl['key']) === false) {
$query['custom_key'] = $customSsl['key'];
}
if (empty($customCertificate) === false) {
$query['custom_certificate'] = $customCertificate;
if (empty($customSsl['certificate']) === false) {
$query['custom_certificate'] = $customSsl['certificate'];
}
if (!empty($query)) {