Skip to content

Commit

Permalink
Remove the request ID from response interface & implementation, #39
Browse files Browse the repository at this point in the history
  • Loading branch information
hollodotme committed Jun 24, 2019
1 parent a53c2a8 commit 1f89ba9
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 13 deletions.
2 changes: 0 additions & 2 deletions src/Interfaces/ProvidesResponseData.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
*/
interface ProvidesResponseData
{
public function getRequestId() : int;

public function getHeaders() : array;

public function getHeader( string $headerKey ) : array;
Expand Down
11 changes: 1 addition & 10 deletions src/Responses/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ class Response implements ProvidesResponseData
{
private const HEADER_PATTERN = '#^([^\:]+):(.*)$#';

/** @var int */
private $requestId;

/** @var array */
private $normalizedHeaders;

Expand All @@ -58,9 +55,8 @@ class Response implements ProvidesResponseData
/** @var float */
private $duration;

public function __construct( int $requestId, string $output, string $error, float $duration )
public function __construct( string $output, string $error, float $duration )
{
$this->requestId = $requestId;
$this->output = $output;
$this->error = $error;
$this->duration = $duration;
Expand Down Expand Up @@ -121,11 +117,6 @@ private function addNormalizedHeader( string $headerKey, string $headerValue ) :
$this->normalizedHeaders[ $key ][] = $headerValue;
}

public function getRequestId() : int
{
return $this->requestId;
}

public function getHeader( string $headerKey ) : array
{
return $this->normalizedHeaders[ strtolower( $headerKey ) ] ?? [];
Expand Down
1 change: 0 additions & 1 deletion src/Sockets/Socket.php
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,6 @@ public function fetchResponse( ?int $timeoutMs = null ) : ProvidesResponseData
$this->guardRequestCompleted( ord( $character ) );

$this->response = new Response(
$this->id,
$output,
$error,
microtime( true ) - $this->startTime
Expand Down

0 comments on commit 1f89ba9

Please sign in to comment.