Skip to content

Commit ca54979

Browse files
PabloJoanclue
authored andcommitted
Minor code improvements (cherry-picked from #295 by @PabloJoan)
1 parent 8651146 commit ca54979

4 files changed

Lines changed: 7 additions & 8 deletions

File tree

src/Io/IniUtil.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ final class IniUtil
1616
public static function iniSizeToBytes($size)
1717
{
1818
if (is_numeric($size)) {
19-
return $size;
19+
return (int)$size;
2020
}
2121

2222
$suffix = strtoupper(substr($size, -1));
@@ -43,6 +43,6 @@ public static function iniSizeToBytes($size)
4343
return $strippedSize * 1024 * 1024 * 1024 * 1024;
4444
}
4545

46-
return $size;
46+
return (int)$size;
4747
}
4848
}

src/Io/MultipartParser.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@
1818
final class MultipartParser
1919
{
2020
/**
21-
* @var ServerRequestInterface
21+
* @var ServerRequestInterface|null
2222
*/
23-
protected $request;
23+
private $request;
2424

2525
/**
2626
* @var int|null
2727
*/
28-
protected $maxFileSize;
28+
private $maxFileSize;
2929

3030
/**
3131
* ini setting "max_input_vars"

src/Io/ServerRequest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class ServerRequest extends Request implements ServerRequestInterface
3737
* @param array $headers Headers for the message.
3838
* @param string|resource|StreamInterface $body Message body.
3939
* @param string $protocolVersion HTTP protocol version.
40-
* @param array server-side parameters
40+
* @param array $serverParams server-side parameters
4141
*
4242
* @throws \InvalidArgumentException for an invalid URI
4343
*/

src/StreamingServer.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace React\Http;
44

55
use Evenement\EventEmitter;
6-
use Psr\Http\Message\RequestInterface;
76
use Psr\Http\Message\ResponseInterface;
87
use Psr\Http\Message\ServerRequestInterface;
98
use React\Http\Io\ChunkedDecoder;
@@ -171,7 +170,7 @@ public function handleConnection(ConnectionInterface $conn)
171170
$parser = new RequestHeaderParser($uriLocal, $uriRemote);
172171

173172
$listener = array($parser, 'feed');
174-
$parser->on('headers', function (RequestInterface $request, $bodyBuffer) use ($conn, $listener, $that) {
173+
$parser->on('headers', function (ServerRequestInterface $request, $bodyBuffer) use ($conn, $listener, $that) {
175174
// parsing request completed => stop feeding parser
176175
$conn->removeListener('data', $listener);
177176

0 commit comments

Comments
 (0)