Skip to content

Commit f95901d

Browse files
committed
fixes some code
1 parent 64d3cf4 commit f95901d

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

Examples/Basic HTTP Example/BasicHTTPAPI.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,17 @@ public function getAllUsers()
2626

2727
public function createUser(array $data)
2828
{
29-
return $this->json($data)->post('users');
29+
return $this->withJson($data)->post('users');
3030
}
3131

3232
public function updateUser(array $data)
3333
{
34-
return $this->json($data)->put('users');
34+
return $this->withJson($data)->put('users');
3535
}
3636

3737
public function partiallyUpdateUser(array $data)
3838
{
39-
return $this->json($data)->patch('users');
39+
return $this->withJson($data)->patch('users');
4040
}
4141

4242
public function deleteUser($id)

Tests/Feature/Mocks/BasicHTTPAPI.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,17 @@ public function getAllUsers()
2323

2424
public function createUser(array $data)
2525
{
26-
return $this->json($data)->post('users');
26+
return $this->withJson($data)->post('users');
2727
}
2828

2929
public function updateUser(array $data)
3030
{
31-
return $this->json($data)->put('users');
31+
return $this->withJson($data)->put('users');
3232
}
3333

3434
public function partiallyUpdateUser(array $data)
3535
{
36-
return $this->json($data)->patch('users');
36+
return $this->withJson($data)->patch('users');
3737
}
3838

3939
public function deleteUser($id)

src/AbstractApi.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace Apiz;
44

5-
use Apiz\Http\AbstractClient;
5+
use Apiz\Http\Clients\AbstractClient;
66
use Apiz\Http\Clients\GuzzleClient;
77
use Apiz\Http\Request;
88
use Apiz\Http\Response;
@@ -250,7 +250,7 @@ protected function basicAuth($username, $password, array $opts = [])
250250
* @param string|array $contents
251251
* @return AbstractApi|bool
252252
*/
253-
protected function body($contents)
253+
protected function withBody($contents)
254254
{
255255
if (is_array($contents)) {
256256
$this->withHeaders([
@@ -271,7 +271,7 @@ protected function body($contents)
271271
* @param array $params
272272
* @return AbstractApi|bool
273273
*/
274-
protected function json(array $params = [])
274+
protected function withJson(array $params = [])
275275
{
276276
$this->request->setParameters($params, 'json');
277277

@@ -287,7 +287,7 @@ protected function json(array $params = [])
287287
* @param array $headers
288288
* @return AbstractApi
289289
*/
290-
protected function file($name, $file, $filename, array $headers = [])
290+
protected function withFile($name, $file, $filename, array $headers = [])
291291
{
292292
if (file_exists($file)) {
293293
$contents = fopen($file, 'r');

0 commit comments

Comments
 (0)