Completed
Push — master ( 8e9c64...20353b )
by Florent
04:07
created

SignerFactory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A createSigner() 0 4 1
1
<?php
2
3
/*
4
 * The MIT License (MIT)
5
 *
6
 * Copyright (c) 2014-2015 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 SpomkyLabs\JoseBundle\Factory;
13
14
15
use Jose\Algorithm\JWAManagerInterface;
16
use Jose\Payload\PayloadConverterManagerInterface;
17
use Jose\Signer;
18
19
final class SignerFactory
20
{
21
    /**
22
     * @var \Jose\Payload\PayloadConverterManagerInterface
23
     */
24
    private $payload_converter;
25
26
    /**
27
     * DecrypterFactory constructor.
28
     *
29
     * @param \Jose\Payload\PayloadConverterManagerInterface $payload_converter
30
     */
31
    public function __construct(PayloadConverterManagerInterface $payload_converter)
32
    {
33
        $this->payload_converter = $payload_converter;
34
    }
35
36
    /**
37
     * @param \Jose\Algorithm\JWAManagerInterface $jwa_manager
38
     *
39
     * @return \Jose\Signer
40
     */
41
    public function createSigner(JWAManagerInterface $jwa_manager)
42
    {
43
        return new Signer($jwa_manager, $this->payload_converter);
44
    }
45
}
46