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

ArtistIDs::getKey()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

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