@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | array $openingHours = array() |
63 | 63 | ) { |
64 | 64 | if (($type->is(CalendarType::MULTIPLE()) || $type->is(CalendarType::SINGLE())) && empty($startDate)) { |
65 | - throw new \UnexpectedValueException('Start date can not be empty for calendar type: ' . $type . '.'); |
|
65 | + throw new \UnexpectedValueException('Start date can not be empty for calendar type: '.$type.'.'); |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | if ($type->is(CalendarType::PERIODIC()) && (empty($startDate) || empty($endDate))) { |
@@ -102,14 +102,14 @@ discard block |
||
102 | 102 | public function serialize() |
103 | 103 | { |
104 | 104 | $serializedTimestamps = array_map( |
105 | - function (Timestamp $timestamp) { |
|
105 | + function(Timestamp $timestamp) { |
|
106 | 106 | return $timestamp->serialize(); |
107 | 107 | }, |
108 | 108 | $this->timestamps |
109 | 109 | ); |
110 | 110 | |
111 | 111 | $serializedOpeningHours = array_map( |
112 | - function (OpeningHour $openingHour) { |
|
112 | + function(OpeningHour $openingHour) { |
|
113 | 113 | return $openingHour->serialize(); |
114 | 114 | }, |
115 | 115 | $this->openingHours |
@@ -137,13 +137,13 @@ discard block |
||
137 | 137 | !empty($data['startDate']) ? self::deserializeDateTime($data['startDate']) : null, |
138 | 138 | !empty($data['endDate']) ? self::deserializeDateTime($data['endDate']) : null, |
139 | 139 | !empty($data['timestamps']) ? array_map( |
140 | - function ($timestamp) { |
|
140 | + function($timestamp) { |
|
141 | 141 | return Timestamp::deserialize($timestamp); |
142 | 142 | }, |
143 | 143 | $data['timestamps'] |
144 | 144 | ) : [], |
145 | 145 | !empty($data['openingHours']) ? array_map( |
146 | - function ($openingHour) { |
|
146 | + function($openingHour) { |
|
147 | 147 | return OpeningHour::deserialize($openingHour); |
148 | 148 | }, |
149 | 149 | $data['openingHours'] |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | |
272 | 272 | if ($calendar instanceof CalendarWithSubEvents) { |
273 | 273 | $timestamps = array_map( |
274 | - function (DateRange $dateRange) { |
|
274 | + function(DateRange $dateRange) { |
|
275 | 275 | return Timestamp::fromUdb3ModelDateRange($dateRange); |
276 | 276 | }, |
277 | 277 | $calendar->getSubEvents()->toArray() |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | |
281 | 281 | if ($calendar instanceof CalendarWithOpeningHours) { |
282 | 282 | $openingHours = array_map( |
283 | - function (Udb3ModelOpeningHour $openingHour) { |
|
283 | + function(Udb3ModelOpeningHour $openingHour) { |
|
284 | 284 | return OpeningHour::fromUdb3ModelOpeningHour($openingHour); |
285 | 285 | }, |
286 | 286 | $calendar->getOpeningHours()->toArray() |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | public function getDaysOfWeek() |
53 | 53 | { |
54 | 54 | return array_map( |
55 | - function ($dayOfWeek) { |
|
55 | + function($dayOfWeek) { |
|
56 | 56 | return DayOfWeek::fromNative($dayOfWeek); |
57 | 57 | }, |
58 | 58 | $this->daysOfWeek |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | { |
67 | 67 | return array_reduce( |
68 | 68 | $data, |
69 | - function (DayOfWeekCollection $collection, $dayOfWeek) { |
|
69 | + function(DayOfWeekCollection $collection, $dayOfWeek) { |
|
70 | 70 | return $collection->addDayOfWeek(DayOfWeek::fromNative($dayOfWeek)); |
71 | 71 | }, |
72 | 72 | new DayOfWeekCollection() |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | public static function fromUdb3ModelDays(Days $days) |
89 | 89 | { |
90 | 90 | $days = array_map( |
91 | - function (Day $day) { |
|
91 | + function(Day $day) { |
|
92 | 92 | return DayOfWeek::fromUdb3ModelDay($day); |
93 | 93 | }, |
94 | 94 | $days->toArray() |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | $tableName |
28 | 28 | ) { |
29 | 29 | $this->connection = $connection; |
30 | - $this->tableName = (string) $tableName; |
|
30 | + $this->tableName = (string)$tableName; |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | /** |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | ->select(UniqueDBALEventStoreDecorator::UUID_COLUMN) |
42 | 42 | ->from($this->tableName) |
43 | 43 | ->where($expr->eq(UniqueDBALEventStoreDecorator::UNIQUE_COLUMN, ':url')) |
44 | - ->setParameter(':url', (string) $url) |
|
44 | + ->setParameter(':url', (string)$url) |
|
45 | 45 | ->execute(); |
46 | 46 | |
47 | 47 | $uuid = $results->fetchColumn(); |
@@ -25,11 +25,11 @@ |
||
25 | 25 | */ |
26 | 26 | public function byId(StringLiteral $facilityId) |
27 | 27 | { |
28 | - if (!array_key_exists((string) $facilityId, $this->facilities)) { |
|
28 | + if (!array_key_exists((string)$facilityId, $this->facilities)) { |
|
29 | 29 | throw new \Exception("Unknown facility id '{$facilityId}'"); |
30 | 30 | } |
31 | 31 | |
32 | - return $this->facilities[(string) $facilityId]; |
|
32 | + return $this->facilities[(string)$facilityId]; |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | /** |
@@ -49,7 +49,7 @@ |
||
49 | 49 | public function getNames() |
50 | 50 | { |
51 | 51 | return [ |
52 | - new StringLiteral((string) $this->label), |
|
52 | + new StringLiteral((string)$this->label), |
|
53 | 53 | ]; |
54 | 54 | } |
55 | 55 |
@@ -112,21 +112,21 @@ |
||
112 | 112 | public static function fromUdb3ModelContactPoint(Udb3ModelContactPoint $contactPoint) |
113 | 113 | { |
114 | 114 | $phones = array_map( |
115 | - function (TelephoneNumber $phone) { |
|
115 | + function(TelephoneNumber $phone) { |
|
116 | 116 | return $phone->toString(); |
117 | 117 | }, |
118 | 118 | $contactPoint->getTelephoneNumbers()->toArray() |
119 | 119 | ); |
120 | 120 | |
121 | 121 | $emails = array_map( |
122 | - function (EmailAddress $emailAddress) { |
|
122 | + function(EmailAddress $emailAddress) { |
|
123 | 123 | return $emailAddress->toString(); |
124 | 124 | }, |
125 | 125 | $contactPoint->getEmailAddresses()->toArray() |
126 | 126 | ); |
127 | 127 | |
128 | 128 | $urls = array_map( |
129 | - function (Url $url) { |
|
129 | + function(Url $url) { |
|
130 | 130 | return $url->toString(); |
131 | 131 | }, |
132 | 132 | $contactPoint->getUrls()->toArray() |
@@ -49,11 +49,11 @@ discard block |
||
49 | 49 | $normalizedData = [ |
50 | 50 | '@id' => $this->iriGenerator->iri($mediaObject->getMediaObjectId()), |
51 | 51 | '@type' => $type, |
52 | - 'contentUrl' => (string) $mediaObject->getSourceLocation(), |
|
53 | - 'thumbnailUrl' => (string) $mediaObject->getSourceLocation(), |
|
54 | - 'description' => (string) $mediaObject->getDescription(), |
|
55 | - 'copyrightHolder' => (string) $mediaObject->getCopyrightHolder(), |
|
56 | - 'inLanguage' => (string) $mediaObject->getLanguage(), |
|
52 | + 'contentUrl' => (string)$mediaObject->getSourceLocation(), |
|
53 | + 'thumbnailUrl' => (string)$mediaObject->getSourceLocation(), |
|
54 | + 'description' => (string)$mediaObject->getDescription(), |
|
55 | + 'copyrightHolder' => (string)$mediaObject->getCopyrightHolder(), |
|
56 | + 'inLanguage' => (string)$mediaObject->getLanguage(), |
|
57 | 57 | ]; |
58 | 58 | |
59 | 59 | return $normalizedData; |
@@ -61,18 +61,18 @@ discard block |
||
61 | 61 | |
62 | 62 | public function serializeMimeType(MIMEType $mimeType) |
63 | 63 | { |
64 | - $typeParts = explode('/', (string) $mimeType); |
|
64 | + $typeParts = explode('/', (string)$mimeType); |
|
65 | 65 | $type = array_shift($typeParts); |
66 | 66 | |
67 | 67 | if ($type === 'image') { |
68 | 68 | return 'schema:ImageObject'; |
69 | 69 | } |
70 | 70 | |
71 | - if ((string) $mimeType === 'application/octet-stream') { |
|
71 | + if ((string)$mimeType === 'application/octet-stream') { |
|
72 | 72 | return 'schema:mediaObject'; |
73 | 73 | } |
74 | 74 | |
75 | - throw new UnsupportedException('Unsupported MIME-type "'. $mimeType .'"'); |
|
75 | + throw new UnsupportedException('Unsupported MIME-type "'.$mimeType.'"'); |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | public function deserialize($data, $type, $format, array $context = array()) |
@@ -38,7 +38,7 @@ |
||
38 | 38 | $document = $this->documentRepository->get($cdbid); |
39 | 39 | |
40 | 40 | if (!$document) { |
41 | - throw new EntityNotFoundException('Could not load JSON-LD document for cdbid ' . $cdbid); |
|
41 | + throw new EntityNotFoundException('Could not load JSON-LD document for cdbid '.$cdbid); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | $json = $document->getBody(); |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | 'addressCountry' => $address->getCountry(), |
193 | 193 | 'addressLocality' => $address->getCity(), |
194 | 194 | 'postalCode' => $address->getZip(), |
195 | - 'streetAddress' => $address->getStreet() . ' ' . $address->getHouseNumber(), |
|
195 | + 'streetAddress' => $address->getStreet().' '.$address->getHouseNumber(), |
|
196 | 196 | ); |
197 | 197 | } |
198 | 198 | } |
@@ -351,7 +351,7 @@ discard block |
||
351 | 351 | $slug = ''; |
352 | 352 | } |
353 | 353 | |
354 | - $reference = 'http://www.uitinvlaanderen.be/agenda/e/' . $slug . '/' . $event->getCdbId(); |
|
354 | + $reference = 'http://www.uitinvlaanderen.be/agenda/e/'.$slug.'/'.$event->getCdbId(); |
|
355 | 355 | |
356 | 356 | |
357 | 357 | if (!property_exists($jsonLD, 'sameAs')) { |
@@ -369,7 +369,7 @@ discard block |
||
369 | 369 | */ |
370 | 370 | private function importAudience(\CultureFeed_Cdb_Item_Event $event, \stdClass $jsonLD) |
371 | 371 | { |
372 | - $eventIsPrivate = (bool) $event->isPrivate(); |
|
372 | + $eventIsPrivate = (bool)$event->isPrivate(); |
|
373 | 373 | $eventTargetsEducation = $eventIsPrivate && $event->getCategories()->hasCategory('2.1.3.0.0'); |
374 | 374 | |
375 | 375 | $audienceType = $eventTargetsEducation ? 'education' : ($eventIsPrivate ? 'members' : 'everyone'); |