public function login(CredentialsInterface $credentials = null, $workspaceName = null)
{
$this->credentials = $credentials;
$this->workspaceName = $workspaceName ?: 'default';
if (!$this->checkLoginOnServer) {
return $this->workspaceName;
}
if (!$this->workspaceExists($this->workspaceName)) {
if ('default' !== $this->workspaceName) {
throw new NoSuchWorkspaceException("Requested workspace: '{$this->workspaceName}'");
}
// create default workspace if it not exists
$this->createWorkspace($this->workspaceName);
}
$this->loggedIn = true;
return $this->workspaceName;
}