protected function connect($url, $username, $password) { $client = new Client(array( 'baseUri' => $url, 'userName' => $username, 'password' => $password, )); try { $response = $client->options(); return $response ? $client : null; } catch (Exception $exc) { return null; } }