Skip to content

Commit 03aeb5a

Browse files
committed
CS fixes
1 parent ab56d0d commit 03aeb5a

File tree

5 files changed

+17
-12
lines changed

5 files changed

+17
-12
lines changed

src/AcceptXmlMiddleware.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ class AcceptXmlMiddleware implements MiddlewareInterface
1515
use ErrorTrait;
1616

1717
/**
18-
* @param RequestInterface $request
19-
* @param array $options
18+
* @param RequestInterface $request
19+
* @param array $options
2020
* @return CancellablePromiseInterface
2121
*/
2222
public function pre(

src/Options.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?php declare (strict_types=1);
1+
<?php declare(strict_types=1);
22

33
namespace ApiClients\Middleware\Xml;
44

src/XmlDecodeMiddleware.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ class XmlDecodeMiddleware implements MiddlewareInterface
1919
use ErrorTrait;
2020

2121
/**
22-
* @param ResponseInterface $response
23-
* @param array $options
22+
* @param ResponseInterface $response
23+
* @param array $options
2424
* @return CancellablePromiseInterface
2525
*
2626
* @ThirdLast()
@@ -48,11 +48,13 @@ public function post(
4848
if ($body === '') {
4949
$stream = new BufferStream(0);
5050
$stream->write($body);
51+
5152
return resolve($response->withBody($stream));
5253
}
5354

5455
$xml = XML2Array::createArray($body);
5556
$body = new XmlStream($xml);
57+
5658
return resolve($response->withBody($body));
5759
}
5860
}

src/XmlEncodeMiddleware.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ class XmlEncodeMiddleware implements MiddlewareInterface
1919
use ErrorTrait;
2020

2121
/**
22-
* @param RequestInterface $request
23-
* @param array $options
22+
* @param RequestInterface $request
23+
* @param array $options
2424
* @return CancellablePromiseInterface
2525
*
2626
* @Third()
@@ -38,6 +38,7 @@ public function pre(
3838
$xml = (new A2X($body->getParsedContents()))->asXml();
3939
$body = new BufferStream(strlen($xml));
4040
$body->write($xml);
41+
4142
return resolve($request->withBody($body)->withAddedHeader('Content-Type', 'text/xml'));
4243
}
4344
}

src/XmlStream.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ public function __construct(array $xml)
2626
$this->bufferStream->write($jsonString);
2727
}
2828

29+
public function __toString()
30+
{
31+
return $this->getContents();
32+
}
33+
2934
/**
3035
* @return array
3136
*/
@@ -34,11 +39,6 @@ public function getParsedContents(): array
3439
return $this->xml;
3540
}
3641

37-
public function __toString()
38-
{
39-
return $this->getContents();
40-
}
41-
4242
public function getContents()
4343
{
4444
return $this->bufferStream->getContents();
@@ -94,6 +94,7 @@ public function tell()
9494

9595
/**
9696
* Reads data from the buffer.
97+
* @param mixed $length
9798
*/
9899
public function read($length)
99100
{
@@ -102,6 +103,7 @@ public function read($length)
102103

103104
/**
104105
* Writes data to the buffer.
106+
* @param mixed $string
105107
*/
106108
public function write($string)
107109
{

0 commit comments

Comments
 (0)