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

AbstractDictionary   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 13
ccs 4
cts 4
cp 1
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A removeNullValues() 0 4 1
A getJsonData() 0 3 1
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