Failed Conditions
Push — v7 ( 79e5af...524357 )
by Florent
02:58
created

JWSBuilderFactory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 2
dl 0
loc 26
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A create() 0 6 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * The MIT License (MIT)
7
 *
8
 * Copyright (c) 2014-2017 Spomky-Labs
9
 *
10
 * This software may be modified and distributed under the terms
11
 * of the MIT license.  See the LICENSE file for details.
12
 */
13
14
namespace Jose\Component\Signature;
15
16
use Jose\Component\Core\JWAManagerFactory;
17
18
final class JWSBuilderFactory
19
{
20
    private $signatureAlgorithmManagerFactory;
21
22
    /**
23
     * JWSBuilderFactory constructor.
24
     *
25
     * @param JWAManagerFactory $signatureAlgorithmManagerFactory
26
     */
27
    public function __construct(JWAManagerFactory $signatureAlgorithmManagerFactory)
28
    {
29
        $this->signatureAlgorithmManagerFactory = $signatureAlgorithmManagerFactory;
30
    }
31
32
    /**
33
     * @param string[] $algorithms
34
     *
35
     * @return JWSBuilder
36
     */
37
    public function create(array $algorithms): JWSBuilder
38
    {
39
        $algorithmManager = $this->signatureAlgorithmManagerFactory->create($algorithms);
40
41
        return new JWSBuilder($algorithmManager);
42
    }
43
}
44