Completed
Push — master ( 436066...53a7e1 )
by Florent
02:50
created

JWKSetManager   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 6
Bugs 1 Features 1
Metric Value
wmc 3
c 6
b 1
f 1
lcom 0
cbo 3
dl 0
loc 20
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A createJWKSet() 0 12 3
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 Jose;
13
14
use Jose\Behaviour\HasJWKManager;
15
16
/**
17
 */
18
final class JWKSetManager implements JWKSetManagerInterface
19
{
20
    use HasJWKManager;
21
22
    /**
23
     * {@inheritdoc}
24
     */
25
    public function createJWKSet(array $values = [])
26
    {
27
        $key_set = new JWKSet();
28
        if (array_key_exists('keys', $values)) {
29
            foreach ($values['keys'] as $value) {
30
                $key = $this->getJWKManager()->createJWK($value);
31
                $key_set = $key_set->addKey($key);
32
            }
33
        }
34
35
        return $key_set;
36
    }
37
}
38