Skip to content

Commit 25235e7

Browse files
authored
Update client methods
1 parent 6302b86 commit 25235e7

1 file changed

Lines changed: 24 additions & 2 deletions

File tree

src/OrgManager.php

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ class OrgManager
1717
* @param string $apiToken
1818
* @param string $rootUrl
1919
*/
20-
public function __construct(Client $client, $apiToken = null, $rootUrl = 'https://orgmanager.miguelpiedrafita.com')
20+
public function __construct($apiToken = null, $rootUrl = 'https://orgmanager.miguelpiedrafita.com')
2121
{
22-
$this->client = $client;
22+
$this->client = new Client;
2323

2424
$this->apiToken = $apiToken;
2525

@@ -37,6 +37,28 @@ public function connect($apiToken)
3737

3838
return $this->apiToken;
3939
}
40+
41+
/**
42+
* @return \GuzzleHttp\Client
43+
*/
44+
public function getClient()
45+
{
46+
return $this->client;
47+
}
48+
49+
/**
50+
* @param \GuzzleHttp\Client $client
51+
*
52+
* @return void
53+
*/
54+
public function setClient($client = new Client;)
55+
{
56+
if ($client instanceof Client))
57+
{
58+
$this->client = $client;
59+
}
60+
return $this;
61+
}
4062

4163
/**
4264
* @return array

0 commit comments

Comments
 (0)