Passed
Push — main ( ef112d...d39948 )
by Pieter
03:42
created

ServerVariableObjectList::jsonSerialize()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 4
c 1
b 0
f 0
nc 2
nop 0
dl 0
loc 7
rs 10
1
<?php
2
3
4
namespace Apie\OpenapiSchema\Map;
5
6
use Apie\CompositeValueObjects\Factory\ReflectionTypeFactory;
7
use Apie\CompositeValueObjects\ValueObjectHashmapTrait;
8
use Apie\CompositeValueObjects\ValueObjectListInterface;
9
use Apie\OpenapiSchema\Constants;
10
use Apie\OpenapiSchema\Spec\ServerVariable;
11
use ReflectionType;
12
13
final class ServerVariableObjectList implements ValueObjectListInterface
14
{
15
    use ValueObjectHashmapTrait;
16
17
    protected static function getWantedType(): ReflectionType
18
    {
19
        return ReflectionTypeFactory::createForClass(ServerVariable::class);
20
    }
21
22
    protected function isValidKey(string $key): bool
23
    {
24
        return preg_match(Constants::VALID_KEY_REGEX, $key) ? true : false;
25
    }
26
}