Completed
Push — master ( 935a4f...80b369 )
by Veaceslav
01:53
created

Schema::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 7
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Aweapi\Openapi\Objects;
6
7
use Aweapi\Openapi\Extensions;
8
use Aweapi\Openapi\ValueObject;
9
10
final class Schema extends ValueObject implements SchemaAggregate
11
{
12
    use Properties\OptionalExtensions;
13
14
    private $attributes;
15
16 15
    public function __construct(
17
        array $attributes,
18
        Extensions $extensions = null
19
    ) {
20 15
        $this->attributes = $attributes;
21 15
        $this->extensions = $extensions;
22
    }
23
24 13
    public function jsonSerialize(): ?array
25
    {
26 13
        return $this->extendedProperties(parent::jsonSerialize());
27
    }
28
29 13
    protected function normalizeOptionalProperties(): array
30
    {
31 13
        return $this->attributes;
32
    }
33
}
34