Skip to content

Commit

Permalink
Update to use laravie/codex 4.
Browse files Browse the repository at this point in the history
Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
  • Loading branch information
crynobone committed Dec 9, 2018
1 parent c2ca51e commit e342343
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
},
"require": {
"php": ">=7.1",
"laravie/codex": "^3.1"
"laravie/codex": "^4.0"
},
"require-dev": {
"mockery/mockery": "^1.0",
Expand Down
14 changes: 0 additions & 14 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

use Http\Client\Common\HttpMethodsClient as HttpClient;
use Laravie\Codex\Client as BaseClient;
use Laravie\Codex\Contracts\Response as ResponseContract;
use Psr\Http\Message\ResponseInterface;

class Client extends BaseClient
{
Expand Down Expand Up @@ -114,18 +112,6 @@ public function setAccessToken(?string $accessToken)
return $this;
}

/**
* Resolve the responder class.
*
* @param \Psr\Http\Message\ResponseInterface $response
*
* @return \Laravie\Codex\Contracts\Response
*/
protected function responseWith(ResponseInterface $response): ResponseContract
{
return new Response($response);
}

/**
* Get resource default namespace.
*
Expand Down
14 changes: 14 additions & 0 deletions src/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,26 @@
namespace Etiqa\MotorInsurance;

use Laravie\Codex\Concerns\Request\Json;
use Laravie\Codex\Contracts\Response as ResponseContract;
use Laravie\Codex\Request as BaseRequest;
use Psr\Http\Message\ResponseInterface;

abstract class Request extends BaseRequest
{
use Json;

/**
* Resolve the responder class.
*
* @param \Psr\Http\Message\ResponseInterface $response
*
* @return \Laravie\Codex\Contracts\Response
*/
protected function responseWith(ResponseInterface $response): ResponseContract
{
return new Response($response);
}

/**
* Get API Header.
*
Expand Down
2 changes: 1 addition & 1 deletion src/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Response extends BaseResponse
*
* @return $this
*/
public function validate(): BaseResponse
public function validate()
{
$payload = $this->toArray();
$statusCode = $this->getStatusCode();
Expand Down

0 comments on commit e342343

Please sign in to comment.