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

LineExtractor   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 13
rs 10
wmc 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A getExtracted() 0 8 3
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