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

ServerVariableObjectList::offsetSet()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 3
eloc 6
c 1
b 0
f 0
nc 3
nop 2
dl 0
loc 9
rs 10

1 Method

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