LimitStream::rewind()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 3
nc 2
nop 0
dl 0
loc 5
ccs 3
cts 3
cp 1
crap 2
rs 10
c 1
b 0
f 0
1
<?php
2
3
namespace Bdf\Collection\Stream;
4
5
use LimitIterator;
6
use OutOfBoundsException;
7
8
/**
9
 * Implementation of StreamInterface::limit() and StreamInterface::skip() return value
10
 *
11
 * @internal
12
 */
13
final class LimitStream extends LimitIterator implements StreamInterface
14
{
15
    use StreamTrait;
16
17
    /**
18
     * {@inheritdoc}
19
     */
20 45
    public function rewind(): void
21
    {
22
        try {
23 45
            parent::rewind();
24 4
        } catch (OutOfBoundsException $e) {
25
            // Ignore OutOfBound exception (raised when offset > count)
26
        }
27 45
    }
28
}
29