Completed
Pull Request — master (#178)
by ignace nyamagana
02:51
created

Reader::each()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 17
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 13
CRAP Score 3

Importance

Changes 5
Bugs 0 Features 0
Metric Value
c 5
b 0
f 0
dl 0
loc 17
ccs 13
cts 13
cp 1
rs 9.4285
cc 3
eloc 12
nc 2
nop 1
crap 3
1
<?php
2
/**
3
* This file is part of the League.csv library
4
*
5
* @license http://opensource.org/licenses/MIT
6
* @link https://github.com/thephpleague/csv/
7
* @version 9.0.0
8
* @package League.csv
9
*
10
* For the full copyright and license information, please view the LICENSE
11
* file that was distributed with this source code.
12
*/
13
namespace League\Csv;
14
15
/**
16
 * A class to interact with a CSV document without overriding it
17
 *
18
 * @package League.csv
19
 * @since  3.0.0
20
 *
21
 */
22
class Reader extends AbstractCsv
23
{
24
    /**
25
     * @inheritdoc
26
     */
27
    protected $stream_filter_mode = STREAM_FILTER_READ;
28
29
    /**
30
     * Returns the Record object
31
     *
32
     * @param Statement|null $stmt
33
     *
34
     * @return RecordSet
35
     */
36
    public function select(Statement $stmt = null)
37
    {
38
        $stmt = $stmt ?: new Statement();
39
40
        return $stmt->process($this);
41
    }
42
}
43