ArtistIDs   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
dl 0
loc 28
rs 10
c 1
b 0
f 0
wmc 5

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 2
A addArtistId() 0 3 1
A getKey() 0 3 1
A getValue() 0 3 1
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
}
39