Passed
Pull Request — master (#18)
by
unknown
08:11
created

AbstractDictionary::getJsonData()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
3
namespace MadWizard\WebAuthn\Dom;
4
5
use MadWizard\WebAuthn\Json\JsonConverter;
6
7
abstract class AbstractDictionary implements DictionaryInterface
8
{
9
    abstract public function getAsArray(): array;
10
11 5
    public function getJsonData(): array
12
    {
13 5
        return JsonConverter::encodeDictionary($this);
14
    }
15
16 9
    protected static function removeNullValues(array $map): array
17
    {
18
        return array_filter($map, static function ($value) {
19 9
            return $value !== null;
20 9
        });
21
    }
22
}
23