HelperFactory   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Test Coverage

Coverage 75%

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 4
dl 0
loc 36
ccs 6
cts 8
cp 0.75
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A createGlobalFunctionsHelper() 0 4 1
A createFileSystemHelper() 0 4 1
A createEncodingHelper() 0 4 1
A createStringHelper() 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
use Box\Spout\Common\Helper\StringHelper;
9
10
/**
11
 * Class HelperFactory
12
 * Factory to create helpers
13
 */
14
class HelperFactory
15
{
16
    /**
17
     * @return GlobalFunctionsHelper
18
     */
19 97
    public function createGlobalFunctionsHelper()
20
    {
21 97
        return new GlobalFunctionsHelper();
22
    }
23
24
    /**
25
     * @param string $baseFolderPath The path of the base folder where all the I/O can occur
26
     * @return FileSystemHelper
27
     */
28 14
    public function createFileSystemHelper($baseFolderPath)
29
    {
30 14
        return new FileSystemHelper($baseFolderPath);
31
    }
32
33
    /**
34
     * @param GlobalFunctionsHelper $globalFunctionsHelper
35
     * @return EncodingHelper
36
     */
37 27
    public function createEncodingHelper(GlobalFunctionsHelper $globalFunctionsHelper)
38
    {
39 27
        return new EncodingHelper($globalFunctionsHelper);
40
    }
41
42
    /**
43
     * @return StringHelper
44
     */
45
    public function createStringHelper()
46
    {
47
        return new StringHelper();
48
    }
49
}
50