Skip to content

Commit 9b16b3e

Browse files
committed
Merge pull request #15 from joelwurtz/feature/interface-change
Fix interface update in message factory
2 parents 0e52175 + eb71393 commit 9b16b3e

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

spec/MessageFactory/DiactorosFactorySpec.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -32,26 +32,26 @@ function it_creates_a_request()
3232

3333
function it_creates_a_request_with_string_body()
3434
{
35-
$this->createRequest('POST', '/', '1.1', [], 'body')->shouldHaveType('Psr\Http\Message\RequestInterface');
35+
$this->createRequest('POST', '/', [], 'body', '1.1')->shouldHaveType('Psr\Http\Message\RequestInterface');
3636
}
3737

3838
function it_creates_a_request_with_empty_body()
3939
{
40-
$this->createRequest('POST', '/', '1.1', [], null)->shouldHaveType('Psr\Http\Message\RequestInterface');
40+
$this->createRequest('POST', '/', [], null, '1.1')->shouldHaveType('Psr\Http\Message\RequestInterface');
4141
}
4242

4343
function it_creates_a_request_with_stream_body(StreamInterface $stream)
4444
{
4545
$stream->rewind()->shouldBeCalled();
4646

47-
$this->createRequest('POST', '/', '1.1', [], $stream)->shouldHaveType('Psr\Http\Message\RequestInterface');
47+
$this->createRequest('POST', '/', [], $stream, '1.1')->shouldHaveType('Psr\Http\Message\RequestInterface');
4848
}
4949

5050
function it_creates_a_request_with_resource_body()
5151
{
5252
$resource = tmpfile();
5353

54-
$this->createRequest('POST', '/', '1.1', [], $resource)->shouldHaveType('Psr\Http\Message\RequestInterface');
54+
$this->createRequest('POST', '/', [], $resource, '1.1')->shouldHaveType('Psr\Http\Message\RequestInterface');
5555
}
5656

5757
function it_creates_a_response()

src/MessageFactory/DiactorosFactory.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ class DiactorosFactory implements MessageFactory
2828
public function createRequest(
2929
$method,
3030
$uri,
31-
$protocolVersion = '1.1',
3231
array $headers = [],
33-
$body = null
32+
$body = null,
33+
$protocolVersion = '1.1'
3434
) {
3535
return (new Request(
3636
$uri,
@@ -46,9 +46,9 @@ public function createRequest(
4646
public function createResponse(
4747
$statusCode = 200,
4848
$reasonPhrase = null,
49-
$protocolVersion = '1.1',
5049
array $headers = [],
51-
$body = null
50+
$body = null,
51+
$protocolVersion = '1.1'
5252
) {
5353
return (new Response(
5454
$this->createStream($body),

src/MessageFactory/GuzzleFactory.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ class GuzzleFactory implements MessageFactory
2626
public function createRequest(
2727
$method,
2828
$uri,
29-
$protocolVersion = '1.1',
3029
array $headers = [],
31-
$body = null
30+
$body = null,
31+
$protocolVersion = '1.1'
3232
) {
3333
return new Request(
3434
$method,
@@ -45,9 +45,9 @@ public function createRequest(
4545
public function createResponse(
4646
$statusCode = 200,
4747
$reasonPhrase = null,
48-
$protocolVersion = '1.1',
4948
array $headers = [],
50-
$body = null
49+
$body = null,
50+
$protocolVersion = '1.1'
5151
) {
5252
return new Response(
5353
$statusCode,

0 commit comments

Comments
 (0)