Skip to content
This repository has been archived by the owner on Jan 6, 2024. It is now read-only.

Commit

Permalink
Update discovery usage
Browse files Browse the repository at this point in the history
  • Loading branch information
sagikazarmark committed Feb 23, 2016
1 parent 3240547 commit ac1907c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# Change Log


## UNRELEASED

### Added

- Hard discovery dependency with Puli composer plugin suggested


## 0.4.0 - 2016-01-27

### Changed
Expand Down
9 changes: 5 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,19 @@
"require": {
"php": ">=5.4",
"php-http/httplug": "^1.0",
"guzzlehttp/guzzle": "^5.1"
"guzzlehttp/guzzle": "^5.1",
"php-http/discovery": "^0.8"
},
"require-dev": {
"ext-curl": "*",
"php-http/adapter-integration-tests": "^0.3",
"guzzlehttp/ringphp": "^1.1",
"php-http/client-common": "^1.0",
"guzzlehttp/psr7": "^1.2",
"php-http/discovery": "^0.7"
"puli/composer-plugin": "1.0.0-beta9"
},
"suggest": {
"php-http/discovery": "Used for message factory discovery"
"puli/composer-plugin": "Used to set up Puli modules from composer packages"
},
"provide": {
"php-http/client-implementation": "1.0"
Expand All @@ -49,7 +50,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "0.5-dev"
"dev-master": "0.6-dev"
}
},
"prefer-stable": true,
Expand Down
4 changes: 0 additions & 4 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ class Client implements HttpClient
*/
public function __construct(ClientInterface $client = null, MessageFactory $messageFactory = null)
{
if (null === $messageFactory and false === class_exists('Http\Discovery\MessageFactoryDiscovery')) {
throw new \LogicException('No message factory provided and no discovery service is present to guess it, maybe you need to install php-http/discovery package?');
}

$this->client = $client ?: new GuzzleClient();
$this->messageFactory = $messageFactory ?: MessageFactoryDiscovery::find();
}
Expand Down

0 comments on commit ac1907c

Please sign in to comment.