Schema::normalizeOptionalProperties()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
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 28
    public function __construct(
17
        array $attributes,
18
        Extensions $extensions = null
19
    ) {
20 28
        $this->attributes = $attributes;
21 28
        $this->extensions = $extensions;
22
    }
23
24 26
    public function jsonSerialize(): ?array
25
    {
26 26
        return $this->extendedProperties(parent::jsonSerialize());
27
    }
28
29 26
    protected function normalizeOptionalProperties(): array
30
    {
31 26
        return $this->attributes;
32
    }
33
}
34