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

OptionalSummary   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 0
dl 0
loc 19
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getSummary() 0 4 1
A hasSummary() 0 4 1
A getNormalizedSummary() 0 4 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Aweapi\Openapi\Objects\Properties;
6
7
trait OptionalSummary
8
{
9
    private $summary;
10
11 6
    public function getSummary(): string
12
    {
13 6
        return $this->summary;
14
    }
15
16 12
    public function hasSummary(): bool
17
    {
18 12
        return isset($this->summary);
19
    }
20
21 12
    private function getNormalizedSummary(): ?string
22
    {
23 12
        return $this->hasSummary() ? $this->getSummary() : null;
24
    }
25
}
26