Skip to content

Commit ac3c141

Browse files
committed
Migrate from php-http/discovery and php-http/utils to php-http/message.
1 parent c8e583d commit ac3c141

9 files changed

+33
-29
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
.puli/
12
build/
23
vendor/
34
composer.lock
45
phpunit.xml
6+
puli.json

CHANGELOG.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
# Change Log
22

3-
## [Unreleased]
3+
## 0.7.0 - 2016-01-26
44

5+
### Changed
6+
7+
- Migrate from `php-http/discovery` and `php-http/utils` to `php-http/message`.
58

69
## 0.6.0 - 2016-01-12
710

@@ -10,7 +13,7 @@
1013
- Root namespace changed from `Http\Curl` to `Http\Client\Curl`.
1114
- Main client class name renamed from `CurlHttpClient` to `Client`.
1215
- Minimum required [php-http/discovery](https://packagist.org/packages/php-http/discovery)
13-
version changed to 0.5.
16+
version changed to 0.5.
1417

1518

1619
## 0.5.0 - 2015-12-18

README.md

+11-11
Original file line numberDiff line numberDiff line change
@@ -20,30 +20,30 @@ $ composer require php-http/curl-client
2020

2121
## Usage
2222

23-
### Using [php-http/discovery](https://packagist.org/packages/php-http/discovery):
23+
### Using [php-http/message](https://packagist.org/packages/php-http/message):
2424

2525
```php
2626
use Http\Client\Curl\Client;
27-
use Http\Discovery\MessageFactoryDiscovery;
28-
use Http\Discovery\StreamFactoryDiscovery;
27+
use Http\Message\MessageFactory\DiactorosMessageFactory;
28+
use Http\Message\StreamFactory\DiactorosStreamFactory;
2929

30-
$messageFactory = MessageFactoryDiscovery::find();
31-
$streamFactory = StreamFactoryDiscovery::find();
32-
$client = new Client($messageFactory, $streamFactory);
30+
$messageFactory = new DiactorosMessageFactory();
31+
$client = new Client($messageFactory, new DiactorosStreamFactory());
3332

3433
$request = $messageFactory->createRequest('GET', 'http://example.com/');
3534
$response = $client->sendRequest($request);
3635
```
3736

38-
### Using [mekras/httplug-diactoros-bridge](https://packagist.org/packages/mekras/httplug-diactoros-bridge):
37+
### Using [php-http/discovery](https://packagist.org/packages/php-http/discovery):
3938

4039
```php
4140
use Http\Client\Curl\Client;
42-
use Mekras\HttplugDiactorosBridge\DiactorosMessageFactory;
43-
use Mekras\HttplugDiactorosBridge\DiactorosStreamFactory;
41+
use Http\Discovery\MessageFactoryDiscovery;
42+
use Http\Discovery\StreamFactoryDiscovery;
4443

45-
$messageFactory = new DiactorosMessageFactory();
46-
$client = new Client($messageFactory, new DiactorosStreamFactory());
44+
$messageFactory = MessageFactoryDiscovery::find();
45+
$streamFactory = StreamFactoryDiscovery::find();
46+
$client = new Client($messageFactory, $streamFactory);
4747

4848
$request = $messageFactory->createRequest('GET', 'http://example.com/');
4949
$response = $client->sendRequest($request);

composer.json

+6-7
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,18 @@
1010
"email": "[email protected]"
1111
}
1212
],
13+
"prefer-stable": true,
14+
"minimum-stability": "dev",
1315
"require": {
1416
"php": ">=5.5",
1517
"ext-curl": "*",
16-
"php-http/httplug": "^1.0.0-alpha3",
18+
"php-http/httplug": "^1.0",
1719
"php-http/message-factory": "^1.0"
1820
},
1921
"require-dev": {
2022
"guzzlehttp/psr7": "^1.0",
21-
"php-http/adapter-integration-tests": "dev-master#a7fcf3e8b6d6f4f5172f15e3bf62a4ee17e8c877",
22-
"php-http/discovery": "^0.5",
23-
"php-http/utils": "^0.2",
23+
"php-http/adapter-integration-tests": "0.3",
24+
"php-http/message": "^0.2",
2425
"phpunit/phpunit": "^4.8@stable",
2526
"zendframework/zend-diactoros": "^1.0"
2627
},
@@ -40,7 +41,5 @@
4041
"scripts": {
4142
"test": "vendor/bin/phpunit",
4243
"test-ci": "vendor/bin/phpunit --coverage-clover build/coverage.xml"
43-
},
44-
"prefer-stable": true,
45-
"minimum-stability": "dev"
44+
}
4645
}

tests/HttpAsyncClientDiactorosTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
use Http\Client\Curl\Client;
55
use Http\Client\HttpClient;
6-
use Http\Client\Utils\MessageFactory\DiactorosMessageFactory;
7-
use Http\Client\Utils\StreamFactory\DiactorosStreamFactory;
6+
use Http\Message\MessageFactory\DiactorosMessageFactory;
7+
use Http\Message\StreamFactory\DiactorosStreamFactory;
88
use Zend\Diactoros\Request;
99
use Zend\Diactoros\Response;
1010

tests/HttpAsyncClientGuzzleTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
use Http\Client\Curl\Client;
55
use Http\Client\HttpClient;
6-
use Http\Client\Utils\MessageFactory\GuzzleMessageFactory;
7-
use Http\Client\Utils\StreamFactory\GuzzleStreamFactory;
6+
use Http\Message\MessageFactory\GuzzleMessageFactory;
7+
use Http\Message\StreamFactory\GuzzleStreamFactory;
88

99
/**
1010
* Tests for Http\Curl\Client

tests/HttpClientDiactorosTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
use Http\Client\Curl\Client;
55
use Http\Client\HttpClient;
6-
use Http\Client\Utils\MessageFactory\DiactorosMessageFactory;
7-
use Http\Client\Utils\StreamFactory\DiactorosStreamFactory;
6+
use Http\Message\MessageFactory\DiactorosMessageFactory;
7+
use Http\Message\StreamFactory\DiactorosStreamFactory;
88
use Zend\Diactoros\Request;
99
use Zend\Diactoros\Response;
1010

tests/HttpClientGuzzleTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
use Http\Client\Curl\Client;
55
use Http\Client\HttpClient;
6-
use Http\Client\Utils\MessageFactory\GuzzleMessageFactory;
7-
use Http\Client\Utils\StreamFactory\GuzzleStreamFactory;
6+
use Http\Message\MessageFactory\GuzzleMessageFactory;
7+
use Http\Message\StreamFactory\GuzzleStreamFactory;
88

99
/**
1010
* Tests for Http\Curl\Client

tests/PromiseCoreTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ function (ResponseInterface $response) {
4242
return $response->withAddedHeader('X-Test', 'bar');
4343
}
4444
);
45-
static::assertEquals('foo, bar', $core->getResponse()->getHeaderLine('X-Test'));
45+
static::assertEquals('foo,bar', $core->getResponse()->getHeaderLine('X-Test'));
4646
}
4747

4848
/**

0 commit comments

Comments
 (0)