Skip to content

Commit

Permalink
Merge pull request #3 from chanshige/develop
Browse files Browse the repository at this point in the history
[fix] miss....
  • Loading branch information
chanshige authored Dec 14, 2023
2 parents d511b0c + 901b044 commit c19c2de
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/Contracts/ResponseFactoryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@

interface ResponseFactoryInterface
{
public function create(PsrResponseInterface $response): SesamiResponseInterface;
public function create(PsrResponseInterface $response): SesameResponseInterface;
}
2 changes: 1 addition & 1 deletion src/Contracts/SesameInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
interface SesameInterface
{
/** @throws SesameException */
public function __invoke(string $uuid, ActionInterface $action): SesamiResponseInterface;
public function __invoke(string $uuid, ActionInterface $action): SesameResponseInterface;
}
2 changes: 1 addition & 1 deletion src/Contracts/SesamiResponseInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Chanshige\SmartLock\Contracts;

interface SesamiResponseInterface
interface SesameResponseInterface
{
/** @return array<string, mixed> */
public function headers(): array;
Expand Down
6 changes: 3 additions & 3 deletions src/ResponseFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
namespace Chanshige\SmartLock;

use Chanshige\SmartLock\Contracts\ResponseFactoryInterface;
use Chanshige\SmartLock\Contracts\SesamiResponseInterface;
use Chanshige\SmartLock\Contracts\SesameResponseInterface;
use Psr\Http\Message\ResponseInterface as PsrResponseInterface;

class ResponseFactory implements ResponseFactoryInterface
{
public function create(PsrResponseInterface $response): SesamiResponseInterface
public function create(PsrResponseInterface $response): SesameResponseInterface
{
return new SesamiResponse($response);
return new SesameResponse($response);
}
}
4 changes: 2 additions & 2 deletions src/Sesame.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use Chanshige\SmartLock\Contracts\ClientInterface;
use Chanshige\SmartLock\Contracts\ResponseFactoryInterface;
use Chanshige\SmartLock\Contracts\SesameInterface;
use Chanshige\SmartLock\Contracts\SesamiResponseInterface;
use Chanshige\SmartLock\Contracts\SesameResponseInterface;
use Chanshige\SmartLock\Exception\ClientException;
use Chanshige\SmartLock\Exception\SesameException;

Expand All @@ -23,7 +23,7 @@ public function __construct(
) {
}

public function __invoke(string $uuid, ActionInterface $action): SesamiResponseInterface
public function __invoke(string $uuid, ActionInterface $action): SesameResponseInterface
{
try {
$actionUri = $this->buildUri($uuid, $action);
Expand Down
4 changes: 2 additions & 2 deletions src/SesamiResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

namespace Chanshige\SmartLock;

use Chanshige\SmartLock\Contracts\SesamiResponseInterface;
use Chanshige\SmartLock\Contracts\SesameResponseInterface;
use Chanshige\SmartLock\Extend\Json;
use Psr\Http\Message\ResponseInterface as PsrResponseInterface;

final readonly class SesamiResponse implements SesamiResponseInterface
final readonly class SesameResponse implements SesameResponseInterface
{
public function __construct(
private PsrResponseInterface $response,
Expand Down
4 changes: 2 additions & 2 deletions tests/SesameStatusTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

use Chanshige\SmartLock\Action\Status;
use Chanshige\SmartLock\Contracts\ClientInterface;
use Chanshige\SmartLock\Contracts\SesamiResponseInterface;
use Chanshige\SmartLock\Contracts\SesameResponseInterface;
use Chanshige\SmartLock\Exception\ClientException;
use Chanshige\SmartLock\Exception\SesameException;
use Koriym\HttpConstants\StatusCode;
Expand Down Expand Up @@ -38,7 +38,7 @@ public function testOK(mixed $code, mixed $headers, mixed $body, mixed $formatte
$sesame = new Sesame($client, new ResponseFactory());
$result = $sesame('488ABAAB-164F-7A86-595F-DDD778CB86C3', new Status());

$this->assertInstanceOf(SesamiResponseInterface::class, $result);
$this->assertInstanceOf(SesameResponseInterface::class, $result);
$this->assertSame($code, $result->statusCode());
$this->assertSame($headers, $result->headers());
$this->assertSame($body, $result->body());
Expand Down

0 comments on commit c19c2de

Please sign in to comment.