Passed
Push — master ( 13a161...a58ba9 )
by Paweł
02:46
created

SchemaStorage::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
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
    public function __construct(OAReader $oaReader)
20
    {
21
        $this->schemas = new Collection($oaReader->read()->components->schemas);
22
    }
23
24
    /**
25
     * @return Collection<int, Schema>
26
     */
27
    public function getSchemas(): Collection
28
    {
29
        return $this->schemas;
30
    }
31
}
32