SchemaList   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

Changes 2
Bugs 1 Features 1
Metric Value
eloc 7
c 2
b 1
f 1
dl 0
loc 11
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A getWantedType() 0 7 1
1
<?php
2
3
4
namespace Apie\OpenapiSchema\Map;
5
6
use Apie\CompositeValueObjects\ValueObjectListInterface;
7
use Apie\CompositeValueObjects\ValueObjectListTrait;
8
use Apie\OpenapiSchema\Contract\SchemaContract;
9
use Apie\OpenapiSchema\Spec\Reference;
10
use Apie\OpenapiSchema\Spec\Schema;
11
use Apie\TypeJuggling\AnotherValueObject;
12
use Apie\TypeJuggling\Compound;
13
use Apie\TypeJuggling\TypeUtilInterface;
14
15
class SchemaList implements ValueObjectListInterface
16
{
17
    use ValueObjectListTrait;
18
19
    protected static function getWantedType(string $fieldName): TypeUtilInterface
20
    {
21
        return new Compound(
22
            $fieldName,
23
            new AnotherValueObject($fieldName, SchemaContract::class),
24
            new AnotherValueObject($fieldName, Schema::class),
25
            new AnotherValueObject($fieldName, Reference::class)
26
        );
27
    }
28
}
29