Completed
Push — v2.0.x ( 2b2b8e...21aa40 )
by Florent
03:32
created

DecrypterFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 5
Bugs 2 Features 1
Metric Value
wmc 1
c 5
b 2
f 1
lcom 0
cbo 4
dl 0
loc 18
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A createDecrypter() 0 8 1
1
<?php
2
3
/*
4
 * The MIT License (MIT)
5
 *
6
 * Copyright (c) 2014-2016 Spomky-Labs
7
 *
8
 * This software may be modified and distributed under the terms
9
 * of the MIT license.  See the LICENSE file for details.
10
 */
11
12
namespace Jose\Factory;
13
14
use Jose\Decrypter;
15
16
final class DecrypterFactory
17
{
18
    /**
19
     * @param string[]                         $algorithms
20
     * @param string[]                         $compression_methods
21
     * @param \Jose\Checker\CheckerInterface[] $checker_managers
22
     *
23
     * @return \Jose\DecrypterInterface
24
     */
25
    public static function createDecrypter(array $algorithms, array $compression_methods = ['DEF'], array $checker_managers = [])
26
    {
27
        $algorithm_manager = AlgorithmManagerFactory::createAlgorithmManager($algorithms);
28
        $compression_manager = CompressionManagerFactory::createCompressionManager($compression_methods);
29
        $checker_manager = CheckerManagerFactory::createCheckerManager($checker_managers);
30
31
        return new Decrypter($algorithm_manager, $compression_manager, $checker_manager);
32
    }
33
}
34