Passed
Pull Request — 2.x (#6)
by Fabrice
03:18
created

LineExtractor::getTraversable()   A

Complexity

Conditions 4
Paths 4

Size

Total Lines 13
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 4
eloc 6
c 1
b 0
f 0
nc 4
nop 1
dl 0
loc 13
rs 10
1
<?php
2
3
/*
4
 * This file is part of YaEtl
5
 *     (c) Fabrice de Stefanis / https://github.com/fab2s/YaEtl
6
 * This source file is licensed under the MIT license which you will
7
 * find in the LICENSE file or at https://opensource.org/licenses/MIT
8
 */
9
10
namespace fab2s\YaEtl\Extractors\File;
11
12
/**
13
 * Class LineExtractor
14
 */
15
class LineExtractor extends FileExtractorAbstract
16
{
17
    /**
18
     * @return iterable
19
     */
20
    protected function getExtracted(): iterable
21
    {
22
        if (!$this->readBom()) {
23
            return;
24
        }
25
26
        while (null !== ($line = $this->getNextNonEmptyLine())) {
27
            yield $line;
28
        }
29
    }
30
}
31