PerformerNames   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 getKey() 0 3 1
A getValue() 0 3 1
A addPerformer() 0 3 1
A __construct() 0 4 2
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 PerformerNames implements SemanticTag
10
{
11
    /** @var array<string> */
12
    private array $performerNames = [];
13
14
    public function __construct(string $performerName = null)
15
    {
16
        if (isset($performerName)) {
17
            $this->addPerformer($performerName);
18
        }
19
    }
20
21
    public function addPerformer(string $name): void
22
    {
23
        $this->performerNames[] = $name;
24
    }
25
26
    public function getKey(): string
27
    {
28
        return 'performerNames';
29
    }
30
31
    /**
32
     * @return array<string>
33
     */
34
    public function getValue(): array
35
    {
36
        return $this->performerNames;
37
    }
38
}
39