Completed
Pull Request — develop_3.0 (#457)
by Adrien
02:34
created

HelperFactory   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 3
dl 0
loc 28
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A createGlobalFunctionsHelper() 0 4 1
A createFileSystemHelper() 0 4 1
A createEncodingHelper() 0 4 1
1
<?php
2
3
namespace Box\Spout\Common\Creator;
4
5
use Box\Spout\Common\Helper\EncodingHelper;
6
use Box\Spout\Common\Helper\FileSystemHelper;
7
use Box\Spout\Common\Helper\GlobalFunctionsHelper;
8
9
/**
10
 * Class HelperFactory
11
 * Factory to create helpers
12
 *
13
 * @package Box\Spout\Common\Creator
14
 */
15
class HelperFactory
16
{
17
    /**
18
     * @return GlobalFunctionsHelper
19
     */
20 79
    public function createGlobalFunctionsHelper()
21
    {
22 79
        return new GlobalFunctionsHelper();
23
    }
24
25
    /**
26
     * @param string $baseFolderPath The path of the base folder where all the I/O can occur
27
     * @return FileSystemHelper
28
     */
29 8
    public function createFileSystemHelper($baseFolderPath)
30
    {
31 8
        return new FileSystemHelper($baseFolderPath);
32
    }
33
34
    /**
35
     * @param GlobalFunctionsHelper $globalFunctionsHelper
36
     * @return EncodingHelper
37
     */
38 26
    public function createEncodingHelper(GlobalFunctionsHelper $globalFunctionsHelper)
39
    {
40 26
        return new EncodingHelper($globalFunctionsHelper);
41
    }
42
}
43