Completed
Push — master ( d88042...0c5536 )
by Nicolas
02:25 queued 48s
created

AbstractFileLoader::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
nc 1
cc 1
nop 2
crap 1
1
<?php
2
3
namespace Smart\EtlBundle\Loader;
4
5
/**
6
 * Nicolas Bastien <[email protected]>
7
 */
8
abstract class AbstractFileLoader
9
{
10
    /**
11
     * @var string
12
     */
13
    protected $folderToLoad;
14
15
    /**
16
     * @var string
17
     */
18
    protected $fileExtension;
19
20 2
    public function __construct($folderToLoad, $fileExtension)
21
    {
22 2
        $this->folderToLoad = $folderToLoad;
23 2
        $this->fileExtension = $fileExtension;
24 2
    }
25
26
    /**
27
     * @return string
28
     */
29 2
    public function getFolderToLoad()
30
    {
31 2
        return $this->folderToLoad;
32
    }
33
34
    /**
35
     * @param string $folderToLoad
36
     */
37
    public function setFolderToLoad($folderToLoad)
38
    {
39
        $this->folderToLoad = $folderToLoad;
40
    }
41
42
    protected function check()
43
    {
44
        if (!is_dir($this->folderToLoad)) {
45
            throw new \BadMethodCallException('Invalid folder to load');
46
        }
47
    }
48
}
49