Completed
Pull Request — master (#557)
by Adrien
03:10
created

ReaderOptions::shouldPreserveEmptyRows()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 1
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
3
namespace Box\Spout\Reader\Common;
4
5
/**
6
 * Class ReaderOptions
7
 * Readers' common options
8
 */
9
class ReaderOptions
10
{
11
    /** @var bool Whether date/time values should be returned as PHP objects or be formatted as strings */
12
    protected $shouldFormatDates = false;
13
14
    /** @var bool Whether empty rows should be returned or skipped */
15
    protected $shouldPreserveEmptyRows = false;
16
17
    /**
18
     * @return bool Whether date/time values should be returned as PHP objects or be formatted as strings.
19
     */
20
    public function shouldFormatDates()
21
    {
22
        return $this->shouldFormatDates;
23
    }
24
25
    /**
26
     * Sets whether date/time values should be returned as PHP objects or be formatted as strings.
27
     *
28
     * @param bool $shouldFormatDates
29
     * @return ReaderOptions
30
     */
31
    public function setShouldFormatDates($shouldFormatDates)
32
    {
33
        $this->shouldFormatDates = $shouldFormatDates;
34
35
        return $this;
36
    }
37
38
    /**
39
     * @return bool Whether empty rows should be returned or skipped.
40
     */
41
    public function shouldPreserveEmptyRows()
42
    {
43
        return $this->shouldPreserveEmptyRows;
44
    }
45
46
    /**
47
     * Sets whether empty rows should be returned or skipped.
48
     *
49
     * @param bool $shouldPreserveEmptyRows
50
     * @return ReaderOptions
51
     */
52
    public function setShouldPreserveEmptyRows($shouldPreserveEmptyRows)
53
    {
54
        $this->shouldPreserveEmptyRows = $shouldPreserveEmptyRows;
55
56
        return $this;
57
    }
58
}
59