Skip to content

Commit

Permalink
mark classes as final and methods and properties as private
Browse files Browse the repository at this point in the history
  • Loading branch information
dbu committed Dec 2, 2018
1 parent 14a2a39 commit 222cac6
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/BatchClient.php
Expand Up @@ -15,7 +15,7 @@
*
* @author Joel Wurtz <jwurtz@jolicode.com>
*/
class BatchClient implements HttpClient
final class BatchClient implements HttpClient
{
/**
* @var HttpClient
Expand Down
2 changes: 1 addition & 1 deletion src/Deferred.php
Expand Up @@ -9,7 +9,7 @@
/**
* A deferred allow to return a promise which has not been resolved yet.
*/
class Deferred implements Promise
final class Deferred implements Promise
{
private $value;

Expand Down
2 changes: 1 addition & 1 deletion src/HttpClientPoolItem.php
Expand Up @@ -16,7 +16,7 @@
*
* @author Joel Wurtz <joel.wurtz@gmail.com>
*/
class HttpClientPoolItem implements HttpClient, HttpAsyncClient
final class HttpClientPoolItem implements HttpClient, HttpAsyncClient
{
/**
* @var int Number of request this client is currently sending
Expand Down
10 changes: 4 additions & 6 deletions src/HttpClientRouter.php
Expand Up @@ -12,6 +12,8 @@
/**
* Route a request to a specific client in the stack based using a RequestMatcher.
*
* This is not a HttpClientPool client because it uses a matcher to select the client.
*
* @author Joel Wurtz <joel.wurtz@gmail.com>
*/
final class HttpClientRouter implements HttpClient, HttpAsyncClient
Expand All @@ -26,19 +28,15 @@ final class HttpClientRouter implements HttpClient, HttpAsyncClient
*/
public function sendRequest(RequestInterface $request): ResponseInterface
{
$client = $this->chooseHttpClient($request);

return $client->sendRequest($request);
return $this->chooseHttpClient($request)->sendRequest($request);
}

/**
* {@inheritdoc}
*/
public function sendAsyncRequest(RequestInterface $request)
{
$client = $this->chooseHttpClient($request);

return $client->sendAsyncRequest($request);
return $this->chooseHttpClient($request)->sendAsyncRequest($request);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/HttpMethodsClient.php
Expand Up @@ -24,7 +24,7 @@
* @author Márk Sági-Kazár <mark.sagikazar@gmail.com>
* @author David Buchmann <mail@davidbu.ch>
*/
class HttpMethodsClient implements HttpClient
final class HttpMethodsClient implements HttpClient
{
/**
* @var HttpClient
Expand Down

0 comments on commit 222cac6

Please sign in to comment.