Schema   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 2
dl 0
loc 24
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A jsonSerialize() 0 4 1
A normalizeOptionalProperties() 0 4 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