Failed Conditions
Push — UrlJWKSet ( 7ceb40...22eb3b )
by Florent
02:53
created

JKUJWKSet::getKeys()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
dl 0
loc 8
rs 9.4285
c 1
b 0
f 1
cc 1
eloc 5
nc 1
nop 0
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
/**
18
 * Class JKUJWKSet
19
 */
20
final class JKUJWKSet extends DownloadedJWKSet
21
{
22
    /**
23
     * @return \Jose\Object\JWKInterface[]
24
     */
25
    public function getKeys()
26
    {
27
        $content = json_decode($this->getContent(), true);
28
        Assertion::isArray($content, 'Invalid content.');
29
        Assertion::keyExists($content, 'keys', 'Invalid content.');
30
31
        return (new JWKSet($content))->getKeys();
32
    }
33
}
34