Passed
Pull Request — master (#12)
by Laurens
01:24
created

Seats::getValue()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 4
c 1
b 0
f 0
nc 2
nop 0
dl 0
loc 9
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace LauLamanApps\ApplePassbook\MetaData\SemanticTag;
6
7
use LauLamanApps\ApplePassbook\MetaData\SemanticTag;
8
9
class Seats implements SemanticTag
10
{
11
    /** @var Seat[]  */
12
    private array $seats = [];
13
14
    public function addSeat(Seat $seat): void
15
    {
16
        $this->seats[] = $seat;
17
    }
18
19
    public function getKey(): string
20
    {
21
        return 'seats';
22
    }
23
    /**
24
     * @return array<array<string, string>>
25
     */
26
    public function getValue(): array
27
    {
28
        $seats = [];
29
30
        foreach ($this->seats as $seat) {
31
            $seats[] = $seat->getValue();
32
        }
33
34
        return $seats;
35
    }
36
}