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

ServerVariableObjectList   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 12
rs 10
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getWantedType() 0 3 1
A isValidKey() 0 3 2
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
}