public function ClientFactory::isConfigurationSet in Acquia Content Hub 8.2
Verifies whether Content Hub has been configured or not.
Return value
bool TRUE if configuration is set, FALSE otherwise.
1 call to ClientFactory::isConfigurationSet()
- ClientFactory::getClient in src/
Client/ ClientFactory.php - Instantiates the content hub client.
1 method overrides ClientFactory::isConfigurationSet()
- ClientFactoryMock::isConfigurationSet in tests/
modules/ acquia_contenthub_server_test/ src/ Client/ ClientFactoryMock.php - Verifies whether Content Hub has been configured or not.
File
- src/
Client/ ClientFactory.php, line 127
Class
- ClientFactory
- Instantiates an Acquia ContentHub Client object.
Namespace
Drupal\acquia_contenthub\ClientCode
public function isConfigurationSet(Settings $settings = NULL) : bool {
$settings = $settings ?? $this
->getSettings();
// If any of these variables is empty, then we do NOT have a valid
// connection.
// @todo add validation for the Hostname.
if (!$settings || !Uuid::isValid($settings
->getUuid()) || empty($settings
->getName()) || empty($settings
->getUrl()) || empty($settings
->getApiKey()) || empty($settings
->getSecretKey())) {
return FALSE;
}
return TRUE;
}