Completed
Push — master ( 5af20f...a965fa )
by Jonas
17s queued 10s
created

LocationId::setDummyPlaceForEducationIds()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace CultuurNet\UDB3\Event\ValueObjects;
4
5
use ValueObjects\StringLiteral\StringLiteral;
6
7
class LocationId extends StringLiteral
8
{
9
    private static $dummyPlaceForEducationIds = [];
10
11
    public function __construct($value)
12
    {
13
        parent::__construct($value);
14
15
        if (empty($value)) {
16
            throw new \InvalidArgumentException('LocationId can\'t have an empty value.');
17
        }
18
    }
19
20
    public function isDummyPlaceForEducation(): bool
21
    {
22
        return in_array($this->value, self::$dummyPlaceForEducationIds);
23
    }
24
25
    public static function setDummyPlaceForEducationIds(array $dummyPlaceForEducationIds): void
26
    {
27
        self::$dummyPlaceForEducationIds = $dummyPlaceForEducationIds;
28
    }
29
}
30