Passed
Push — master ( 3fa4e6...76ee2f )
by Laurens
01:35
created

CompilerFactory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 13
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A getCompiler() 0 11 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace LauLamanApps\ApplePassbook\Build;
6
7
use ZipArchive;
8
9
class CompilerFactory
10
{
11
    public function getCompiler(
12
        string $certificateFilePath,
13
        string $certificatePassword,
14
        string $appleWWDRCAFile = null
15
    ): Compiler {
16
        $signer = new Signer($certificateFilePath, $certificatePassword);
17
        if ($appleWWDRCAFile !== null) {
18
            $signer->setAppleWWDRCA($appleWWDRCAFile);
19
        }
20
21
        return new Compiler(new ManifestGenerator(), $signer, new Compressor(new ZipArchive()));
22
    }
23
}
24