Skip to content

Commit 9fe1bb6

Browse files
author
Lawri van Buël
committed
Tweaks
1 parent fec3ecb commit 9fe1bb6

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

modules/rocket_chat_api/src/RocketChat/ApiClient.php

+9-7
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
use \GuzzleHttp\Client;
2222
use \GuzzleHttp\Exception\ClientException;
23+
use \Drupal\rocket_chat_api\RocketChat\RocketChatConfigInterface;
2324

2425
/**
2526
* Class ApiClient
@@ -49,7 +50,7 @@ class ApiClient {
4950

5051
/**
5152
* Config Object.
52-
* @var \Drupal\rocket_chat_api\RocketChat\RocketChatConfigInterface Object
53+
* @var \Drupal\rocket_chat_api\RocketChat\RocketChatConfigInterface $config
5354
* RocketChatConfigInterface object.
5455
*/
5556
private $config;
@@ -58,24 +59,25 @@ class ApiClient {
5859

5960
/**
6061
* ApiClient constructor.
61-
* Loads in the configuration from the Drupal Variables and preparers the
62-
* Client with some defaults and base values for ease of use.
6362
*
6463
* @param \Drupal\rocket_chat_api\RocketChat\RocketChatConfigInterface $config
6564
* Config Object.
66-
*
6765
* @param bool $login
68-
* When true the stored login tokens will not be used. when false the
66+
* When true the stored login tokens will not be used. when false the
6967
* stored login tokens will be used. This is to facilitate login and
7068
* non-auth calls. Or in other words, is this a login call.
7169
*/
72-
public function __construct($config = NULL, $login = FALSE) {
70+
public function __construct(RocketChatConfigInterface $config = NULL,
71+
$login = FALSE) {
7372
$this->config = $config;
7473
if (!empty($config)) {
7574
$this->client = $this->createClient($login);
7675
$userToken = $this->config->getElement("rocket_chat_uit");
7776
if (empty($userToken)) {
78-
$this->loggedIn = $this->login($this->config->getElement("user"), $this->config->getElement("secret"));
77+
$this->loggedIn = $this->login(
78+
$this->config->getElement("user"),
79+
$this->config->getElement("secret")
80+
);
7981
}
8082
}
8183
else {

0 commit comments

Comments
 (0)