@@ -28,38 +28,38 @@ |
||
28 | 28 | */ |
29 | 29 | final class LineStream extends Stream implements IteratorAggregate |
30 | 30 | { |
31 | - /** |
|
32 | - * @var mixed |
|
33 | - */ |
|
34 | - private $resource; |
|
31 | + /** |
|
32 | + * @var mixed |
|
33 | + */ |
|
34 | + private $resource; |
|
35 | 35 | |
36 | - /** |
|
37 | - * @param mixed $resource |
|
38 | - * |
|
39 | - * @throws InvalidArgumentException |
|
40 | - */ |
|
41 | - public function __construct($resource, bool $autoClose = true) |
|
42 | - { |
|
43 | - parent::__construct($resource, $autoClose); |
|
36 | + /** |
|
37 | + * @param mixed $resource |
|
38 | + * |
|
39 | + * @throws InvalidArgumentException |
|
40 | + */ |
|
41 | + public function __construct($resource, bool $autoClose = true) |
|
42 | + { |
|
43 | + parent::__construct($resource, $autoClose); |
|
44 | 44 | |
45 | - $this->resource = $resource; |
|
46 | - } |
|
45 | + $this->resource = $resource; |
|
46 | + } |
|
47 | 47 | |
48 | - /** |
|
49 | - * @inheritDoc |
|
50 | - */ |
|
51 | - public function getIterator(): Traversable |
|
52 | - { |
|
53 | - if (!is_resource($this->resource)) { |
|
54 | - throw new RuntimeException('Stream has no resource'); |
|
55 | - } |
|
48 | + /** |
|
49 | + * @inheritDoc |
|
50 | + */ |
|
51 | + public function getIterator(): Traversable |
|
52 | + { |
|
53 | + if (!is_resource($this->resource)) { |
|
54 | + throw new RuntimeException('Stream has no resource'); |
|
55 | + } |
|
56 | 56 | |
57 | - if (!$this->isReadable()) { |
|
58 | - throw new RuntimeException('Stream is not readable'); |
|
59 | - } |
|
57 | + if (!$this->isReadable()) { |
|
58 | + throw new RuntimeException('Stream is not readable'); |
|
59 | + } |
|
60 | 60 | |
61 | - while (($line = fgets($this->resource)) !== false) { |
|
62 | - yield rtrim($line); |
|
63 | - } |
|
64 | - } |
|
61 | + while (($line = fgets($this->resource)) !== false) { |
|
62 | + yield rtrim($line); |
|
63 | + } |
|
64 | + } |
|
65 | 65 | } |