Passed
Push — master ( 90ece2...a7cb98 )
by Fabrice
08:54 queued 05:47
created

NullExtractor::getExtracted()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
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;
11
12
/**
13
 * Class NullExtractor
14
 */
15
class NullExtractor extends ExtractorBatchLimitAbstract
16
{
17
    /**
18
     * Total number of records to fetch
19
     *
20
     * @var int
21
     */
22
    protected $limit = 50;
23
24
    /**
25
     * Triggers an extract
26
     *
27
     * @param mixed $param
28
     *
29
     * @return bool
30
     */
31
    public function extract($param = null): bool
32
    {
33
        if ($this->numRecords >= $this->limit) {
34
            return false;
35
        }
36
37
        return true;
38
    }
39
40
    /**
41
     * Return the dumbest Generator ever
42
     *
43
     * @return \Generator
44
     */
45
    public function getExtracted(): iterable
46
    {
47
        yield null;
48
    }
49
}
50