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

Commit 855cea9

Browse files
committed
Move adapter into subnamespace
1 parent feb344d commit 855cea9

File tree

7 files changed

+22
-22
lines changed

7 files changed

+22
-22
lines changed

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,20 @@
2424
"ext-curl": "*",
2525
"guzzlehttp/ringphp": "^1.1",
2626
"php-http/adapter-integration-tests": "dev-master",
27-
"php-http/client-common": "^0.1",
27+
"php-http/client-common": "^0.1.1",
2828
"guzzlehttp/psr7": "^1.2"
2929
},
3030
"provide": {
3131
"php-http/client-implementation": "1.0"
3232
},
3333
"autoload": {
3434
"psr-4": {
35-
"Http\\Adapter\\": "src/"
35+
"Http\\Adapter\\Guzzle5\\": "src/"
3636
}
3737
},
3838
"autoload-dev": {
3939
"psr-4": {
40-
"Http\\Adapter\\Tests\\": "tests/"
40+
"Http\\Adapter\\Guzzle5\\Tests\\": "tests/"
4141
}
4242
},
4343
"scripts": {

src/Guzzle5HttpAdapter.php renamed to src/Client.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?php
22

3-
namespace Http\Adapter;
3+
namespace Http\Adapter\Guzzle5;
44

5-
use GuzzleHttp\Client;
5+
use GuzzleHttp\Client as GuzzleClient;
66
use GuzzleHttp\ClientInterface;
77
use GuzzleHttp\Message\RequestInterface as GuzzleRequest;
88
use GuzzleHttp\Message\ResponseInterface as GuzzleResponse;
@@ -18,7 +18,7 @@
1818
* @author GeLo <[email protected]>
1919
* @author Tobias Nyholm <[email protected]>
2020
*/
21-
class Guzzle5HttpAdapter implements HttpClient
21+
class Client implements HttpClient
2222
{
2323
/**
2424
* @var ClientInterface
@@ -36,7 +36,7 @@ class Guzzle5HttpAdapter implements HttpClient
3636
*/
3737
public function __construct(ClientInterface $client = null, MessageFactory $messageFactory = null)
3838
{
39-
$this->client = $client ?: new Client();
39+
$this->client = $client ?: new GuzzleClient();
4040
$this->messageFactory = $messageFactory ?: MessageFactoryDiscovery::find();
4141
}
4242

tests/Guzzle5CurlHttpAdapterTest.php renamed to tests/CurlHttpAdapterTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
namespace Http\Adapter\Tests;
12+
namespace Http\Adapter\Guzzle5\Tests;
1313

1414
use GuzzleHttp\Ring\Client\CurlHandler;
1515

@@ -18,7 +18,7 @@
1818
*
1919
* @author GeLo <[email protected]>
2020
*/
21-
class Guzzle5CurlHttpAdapterTest extends Guzzle5HttpAdapterTest
21+
class CurlHttpAdapterTest extends HttpAdapterTest
2222
{
2323
/**
2424
* {@inheritdoc}

tests/Guzzle5ExceptionTest.php renamed to tests/ExceptionTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
<?php
22

3-
namespace Http\Adapter\Tests;
3+
namespace Http\Adapter\Guzzle5\Tests;
44

55
use GuzzleHttp\Exception as GuzzleExceptions;
66
use GuzzleHttp\Message\Request as GuzzleRequest;
77
use GuzzleHttp\Message\Response as GuzzleResponse;
88
use GuzzleHttp\Psr7\Request as Psr7Request;
99
use GuzzleHttp\Stream\Stream;
10-
use Http\Adapter\Guzzle5HttpAdapter;
10+
use Http\Adapter\Guzzle5\Client;
1111

1212
/**
1313
* @author Tobias Nyholm <[email protected]>
1414
*/
15-
class Guzzle5ExceptionTest extends \PHPUnit_Framework_TestCase
15+
class ExceptionTest extends \PHPUnit_Framework_TestCase
1616
{
1717
private $guzzleRequest;
1818
private $guzzleResponse;
@@ -30,7 +30,7 @@ protected function makeRequest(GuzzleExceptions\TransferException $exception)
3030
$client->expects($this->any())->method('createRequest')->willReturn($this->guzzleRequest);
3131

3232
$request = new Psr7Request('GET', 'http://foo.com');
33-
(new Guzzle5HttpAdapter($client))->sendRequest($request);
33+
(new Client($client))->sendRequest($request);
3434
}
3535

3636
public function testConnectException()

tests/Guzzle5HttpAdapterTest.php renamed to tests/HttpAdapterTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,23 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
namespace Http\Adapter\Tests;
12+
namespace Http\Adapter\Guzzle5\Tests;
1313

14-
use GuzzleHttp\Client;
15-
use Http\Adapter\Guzzle5HttpAdapter;
14+
use GuzzleHttp\Client as GuzzleClient;
15+
use Http\Adapter\Guzzle5\Client;
1616
use Http\Client\Tests\HttpClientTest;
1717

1818
/**
1919
* @author GeLo <[email protected]>
2020
*/
21-
abstract class Guzzle5HttpAdapterTest extends HttpClientTest
21+
abstract class HttpAdapterTest extends HttpClientTest
2222
{
2323
/**
2424
* {@inheritdoc}
2525
*/
2626
protected function createHttpAdapter()
2727
{
28-
return new Guzzle5HttpAdapter(new Client(['handler' => $this->createHandler()]));
28+
return new Client(new GuzzleClient(['handler' => $this->createHandler()]));
2929
}
3030

3131
/**

tests/Guzzle5MultiCurlHttpAdapterTest.php renamed to tests/MultiCurlHttpAdapterTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
namespace Http\Adapter\Tests;
12+
namespace Http\Adapter\Guzzle5\Tests;
1313

1414
use GuzzleHttp\Ring\Client\CurlMultiHandler;
1515

1616
/**
1717
* @author GeLo <[email protected]>
1818
*/
19-
class Guzzle5MultiCurlHttpAdapterTest extends Guzzle5HttpAdapterTest
19+
class MultiCurlHttpAdapterTest extends HttpAdapterTest
2020
{
2121
/**
2222
* {@inheritdoc}

tests/Guzzle5StreamHttpAdapterTest.php renamed to tests/StreamHttpAdapterTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
namespace Http\Adapter\Tests;
12+
namespace Http\Adapter\Guzzle5\Tests;
1313

1414
use GuzzleHttp\Ring\Client\StreamHandler;
1515

1616
/**
1717
* @author GeLo <[email protected]>
1818
*/
19-
class Guzzle5StreamHttpAdapterTest extends Guzzle5HttpAdapterTest
19+
class StreamHttpAdapterTest extends HttpAdapterTest
2020
{
2121
/**
2222
* {@inheritdoc}

0 commit comments

Comments
 (0)