|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace CultuurNet\UDB3\Place; |
|
4
|
|
|
|
|
5
|
|
|
use CultuurNet\UDB3\Event\EventType; |
|
6
|
|
|
use CultuurNet\UDB3\Offer\TypeResolverInterface; |
|
7
|
|
|
use ValueObjects\StringLiteral\StringLiteral; |
|
8
|
|
|
|
|
9
|
|
|
class PlaceTypeResolver implements TypeResolverInterface |
|
10
|
|
|
{ |
|
11
|
|
|
/** |
|
12
|
|
|
* @var EventType[] |
|
13
|
|
|
*/ |
|
14
|
|
|
private $types; |
|
15
|
|
|
|
|
16
|
|
|
public function __construct() |
|
17
|
|
|
{ |
|
18
|
|
|
$this->types = [ |
|
|
|
|
|
|
19
|
|
|
"0.14.0.0.0" => new EventType("0.14.0.0.0", "Monument"), |
|
20
|
|
|
"0.15.0.0.0" => new EventType("0.15.0.0.0", "Natuur, park of tuin"), |
|
21
|
|
|
"3CuHvenJ" => new EventType("3CuHvenJ", "Archeologische Site"), |
|
22
|
|
|
"GnPFp9uvOUyqhOckIFMKmg" => new EventType("GnPFp9uvOUyqhOckIFMKmg", "Museum of galerij"), |
|
23
|
|
|
"kI7uAyn2uUu9VV6Z3uWZTA" => new EventType("kI7uAyn2uUu9VV6Z3uWZTA", "Bibliotheek of documentatiecentrum"), |
|
24
|
|
|
"0.53.0.0.0" => new EventType("0.53.0.0.0", "Recreatiedomein of centrum"), |
|
25
|
|
|
"0.41.0.0.0" => new EventType("0.41.0.0.0", "Thema of pretpark"), |
|
26
|
|
|
"rJRFUqmd6EiqTD4c7HS90w" => new EventType("rJRFUqmd6EiqTD4c7HS90w", "School of onderwijscentrum"), |
|
27
|
|
|
"eBwaUAAhw0ur0Z02i5ttnw" => new EventType("eBwaUAAhw0ur0Z02i5ttnw", "Sportcentrum"), |
|
28
|
|
|
"VRC6HX0Wa063sq98G5ciqw" => new EventType("VRC6HX0Wa063sq98G5ciqw", "Winkel"), |
|
29
|
|
|
"JCjA0i5COUmdjMwcyjNAFA" => new EventType("JCjA0i5COUmdjMwcyjNAFA", "Jeugdhuis of jeugdcentrum"), |
|
30
|
|
|
"Yf4aZBfsUEu2NsQqsprngw" => new EventType("Yf4aZBfsUEu2NsQqsprngw", "Cultuur- of ontmoetingscentrum"), |
|
31
|
|
|
"YVBc8KVdrU6XfTNvhMYUpg" => new EventType("YVBc8KVdrU6XfTNvhMYUpg", "Discotheek"), |
|
32
|
|
|
"BtVNd33sR0WntjALVbyp3w" => new EventType("BtVNd33sR0WntjALVbyp3w", "Bioscoop"), |
|
33
|
|
|
"ekdc4ATGoUitCa0e6me6xA" => new EventType("ekdc4ATGoUitCa0e6me6xA", "Horeca"), |
|
34
|
|
|
"OyaPaf64AEmEAYXHeLMAtA" => new EventType("OyaPaf64AEmEAYXHeLMAtA", "Zaal of expohal"), |
|
35
|
|
|
"0.8.0.0.0" => new EventType("0.8.0.0.0", "Openbare ruimte"), |
|
36
|
|
|
]; |
|
37
|
|
|
} |
|
38
|
|
|
|
|
39
|
|
|
/** |
|
40
|
|
|
* @inheritdoc |
|
41
|
|
|
*/ |
|
42
|
|
View Code Duplication |
public function byId(StringLiteral $typeId) |
|
|
|
|
|
|
43
|
|
|
{ |
|
44
|
|
|
if (!array_key_exists((string) $typeId, $this->types)) { |
|
45
|
|
|
throw new \Exception("Unknown place type id: " . $typeId); |
|
46
|
|
|
} |
|
47
|
|
|
return $this->types[(string) $typeId]; |
|
48
|
|
|
} |
|
49
|
|
|
} |
|
50
|
|
|
|
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..