Completed
Pull Request — master (#6)
by Veaceslav
11:19
created

SchemaBuilder::createSchema()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Aweapi\Openapi\Builders;
6
7
use Aweapi\Openapi\Objects;
8
9
final class SchemaBuilder implements Objects\SchemaFactory
10
{
11
    use Properties\OptionalExtensions;
12
13
    private $attributes = [];
14
15
    public function createSchema(): Objects\Schema
16
    {
17
        return new Objects\Schema(
18
            $this->getAttributes(),
19
            $this->getExtensions()
20
        );
21
    }
22
23
    public function createSchemaAggregate(): Objects\SchemaAggregate
24
    {
25
        return $this->createSchema();
26
    }
27
28
    public function setAttributes(array $attributes): self
29
    {
30
        $this->attributes = $attributes;
31
32
        return $this;
33
    }
34
35
    private function getAttributes(): array
36
    {
37
        return $this->attributes;
38
    }
39
}
40