Completed
Push — master ( b9975d...05326a )
by Florent
06:18 queued 51s
created

JWKSetFactory::createFromKey()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 9
rs 9.6666
cc 2
eloc 5
nc 2
nop 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 SpomkyLabs\JoseBundle\Service;
13
14
use Jose\Object\JWKSet;
15
16
final class JWKSetFactory
17
{
18
    /**
19
     * @param \Jose\Object\JWKInterface[] $keys
20
     *
21
     * @return \Jose\Object\JWKSetInterface
22
     */
23
    public static function createFromKey(array $keys)
24
    {
25
        $jwk_set = new JWKSet();
26
        foreach ($keys as $key) {
27
            $jwk_set = $jwk_set->addKey($key);
28
        }
29
30
        return $jwk_set;
31
    }
32
}
33