Skip to content

Commit c065086

Browse files
committed
QA: WS / CS
1 parent 9074d86 commit c065086

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

src/main/php/io/archive/zip/ZipFileInputStream.class.php

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,15 @@
88
* certain length.
99
*/
1010
class ZipFileInputStream implements InputStream {
11-
protected
12-
$reader = null,
13-
$start = 0,
14-
$pos = 0,
15-
$length = 0;
11+
protected $reader, $start, $length;
12+
protected $pos= 0;
1613

1714
/**
1815
* Constructor
1916
*
20-
* @param io.archive.zip.AbstractZipReaderImpl reader
21-
* @param int start
22-
* @param int length
17+
* @param io.archive.zip.AbstractZipReaderImpl $reader
18+
* @param int $start
19+
* @param int $length
2320
*/
2421
public function __construct(AbstractZipReaderImpl $reader, $start, $length) {
2522
$this->reader= $reader;
@@ -30,16 +27,18 @@ public function __construct(AbstractZipReaderImpl $reader, $start, $length) {
3027
/**
3128
* Read a string
3229
*
33-
* @param int limit default 8192
34-
* @return string
30+
* @param int $limit default 8192
31+
* @return string
32+
* @throws io.IOException on EOF
3533
*/
3634
public function read($limit= 8192) {
3735
if (0 === $this->pos) {
3836
$this->reader->streamPosition($this->start);
3937
} else if ($this->pos >= $this->length) {
4038
throw new IOException('EOF');
4139
}
42-
$chunk= $this->reader->streamRead(min($limit, $this->length- $this->pos));
40+
41+
$chunk= $this->reader->streamRead(min($limit, $this->length - $this->pos));
4342
$l= strlen($chunk);
4443
$this->pos+= $l;
4544
$this->reader->skip-= $l;
@@ -50,6 +49,7 @@ public function read($limit= 8192) {
5049
* Returns the number of bytes that can be read from this stream
5150
* without blocking.
5251
*
52+
* @return int
5353
*/
5454
public function available() {
5555
return $this->pos < $this->length ? $this->reader->streamAvailable() : 0;
@@ -58,6 +58,7 @@ public function available() {
5858
/**
5959
* Close this buffer
6060
*
61+
* @return void
6162
*/
6263
public function close() {
6364
// NOOP, leave underlying stream open

0 commit comments

Comments
 (0)