Ohh I found answer:
$params = $key; if($siteworxDomain) { $params = [ 'apikey' => $key, 'domain' => $siteworxDomain]; } $this->_key = $params;