Failed Conditions
Pull Request — master (#144)
by Florent
08:48 queued 04:12
created

JKUJWKSet   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A getKeys() 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\Object;
13
14
use Assert\Assertion;
15
16
/**
17
 * Class JKUJWKSet.
18
 */
19
final class JKUJWKSet extends DownloadedJWKSet
20
{
21
    /**
22
     * @return \Jose\Object\JWKInterface[]
23
     */
24
    public function getKeys()
25
    {
26
        $content = json_decode($this->getContent(), true);
27
        Assertion::isArray($content, 'Invalid content.');
28
        Assertion::keyExists($content, 'keys', 'Invalid content.');
29
30
        return (new JWKSet($content))->getKeys();
31
    }
32
}
33