SchemaStorage   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
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 16
ccs 5
cts 5
cp 1
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A getSchemas() 0 3 1
1
<?php
2
/**
3
 * Copyright (c) 2020.
4
 * @author Paweł Antosiak <[email protected]>
5
 */
6
7
declare(strict_types=1);
8
9
namespace Gorynych\Util;
10
11
use Cake\Collection\Collection;
12
use OpenApi\Annotations\Schema;
13
14
final class SchemaStorage
15
{
16
    /** @var Collection<int, Schema> */
17
    private Collection $schemas;
18
19 1
    public function __construct(OAReader $oaReader)
20
    {
21 1
        $this->schemas = new Collection($oaReader->read()->components->schemas);
22 1
    }
23
24
    /**
25
     * @return Collection<int, Schema>
26
     */
27 1
    public function getSchemas(): Collection
28
    {
29 1
        return $this->schemas;
30
    }
31
}
32