Skip to content

Commit

Permalink
types
Browse files Browse the repository at this point in the history
  • Loading branch information
ppshobi committed Nov 13, 2022
1 parent ed164e6 commit 14dd00a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
6 changes: 3 additions & 3 deletions src/Contracts/Client.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
<?php
namespace Psonic\Contracts;

use Psonic\Exceptions\ConnectionException;
Expand All @@ -9,12 +9,12 @@ interface Client
* Connects to a socket
* @throws ConnectionException
*/
public function connect();
public function connect(): void;

/**
* disconnects the socket
*/
public function disconnect();
public function disconnect(): void;

/**
* @param Command $command
Expand Down
5 changes: 2 additions & 3 deletions src/Contracts/Response.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
<?php
<?php
namespace Psonic\Contracts;

interface Response
{
/**
* fetches an item from the parsed buffer
* @param $key
* @return mixed
*/
public function get($key);
public function get(string $key);

/**
* returns the status of the read buffer
Expand Down
6 changes: 2 additions & 4 deletions src/SonicResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use Psonic\Contracts\Response as ResponseInterface;
use Psonic\Exceptions\CommandFailedException;

class SonicResponse implements ResponseInterface
class SonicResponse implements ResponseInterface
{
private $message;
private $pieces;
Expand Down Expand Up @@ -68,10 +68,9 @@ public function __toString()
}

/**
* @param $key
* @return mixed
*/
public function get($key)
public function get(string $key)
{
if(isset($this->pieces[$key])){
return $this->pieces[$key];
Expand All @@ -94,4 +93,3 @@ public function getCount():int
return $this->get('count') ?? 0;
}
}

0 comments on commit 14dd00a

Please sign in to comment.