@@ -23,9 +23,9 @@ |
||
23 | 23 | */ |
24 | 24 | public function byId(StringLiteral $themeId) |
25 | 25 | { |
26 | - if (!array_key_exists((string) $themeId, $this->themes)) { |
|
27 | - throw new \Exception("Unknown place theme id: " . $themeId); |
|
26 | + if (!array_key_exists((string)$themeId, $this->themes)) { |
|
27 | + throw new \Exception("Unknown place theme id: ".$themeId); |
|
28 | 28 | } |
29 | - return $this->themes[(string) $themeId]; |
|
29 | + return $this->themes[(string)$themeId]; |
|
30 | 30 | } |
31 | 31 | } |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | |
160 | 160 | if (preg_match('/^apply(.+)$/', $method, $matches)) { |
161 | 161 | $event = $matches[1]; |
162 | - $classNameMethod = 'get' . $event . 'ClassName'; |
|
162 | + $classNameMethod = 'get'.$event.'ClassName'; |
|
163 | 163 | |
164 | 164 | if (method_exists($this, $classNameMethod)) { |
165 | 165 | $eventFullClassName = call_user_func(array($this, $classNameMethod)); |
@@ -344,11 +344,11 @@ discard block |
||
344 | 344 | $offerLD = $document->getBody(); |
345 | 345 | |
346 | 346 | $oldTerms = property_exists($offerLD, 'terms') ? $offerLD->terms : []; |
347 | - $newTerm = (object) $category->serialize(); |
|
347 | + $newTerm = (object)$category->serialize(); |
|
348 | 348 | |
349 | 349 | $newTerms = array_filter( |
350 | 350 | $oldTerms, |
351 | - function ($term) use ($category) { |
|
351 | + function($term) use ($category) { |
|
352 | 352 | return !property_exists($term, 'domain') || $term->domain !== $category->getDomain(); |
353 | 353 | } |
354 | 354 | ); |
@@ -375,7 +375,7 @@ discard block |
||
375 | 375 | // Remove all old facilities + get numeric keys. |
376 | 376 | $terms = array_values(array_filter( |
377 | 377 | $terms, |
378 | - function ($term) { |
|
378 | + function($term) { |
|
379 | 379 | return $term->domain !== Facility::DOMAIN; |
380 | 380 | } |
381 | 381 | )); |
@@ -404,7 +404,7 @@ discard block |
||
404 | 404 | $labelsProperty = $labelAdded->getLabel()->isVisible() ? 'labels' : 'hiddenLabels'; |
405 | 405 | |
406 | 406 | $labels = isset($offerLd->{$labelsProperty}) ? $offerLd->{$labelsProperty} : []; |
407 | - $label = (string) $labelAdded->getLabel(); |
|
407 | + $label = (string)$labelAdded->getLabel(); |
|
408 | 408 | |
409 | 409 | $labels[] = $label; |
410 | 410 | $offerLd->{$labelsProperty} = array_unique($labels); |
@@ -430,7 +430,7 @@ discard block |
||
430 | 430 | if (isset($offerLd->{$labelsProperty}) && is_array($offerLd->{$labelsProperty})) { |
431 | 431 | $offerLd->{$labelsProperty} = array_filter( |
432 | 432 | $offerLd->{$labelsProperty}, |
433 | - function ($label) use ($labelRemoved) { |
|
433 | + function($label) use ($labelRemoved) { |
|
434 | 434 | return !$labelRemoved->getLabel()->equals( |
435 | 435 | new Label($label) |
436 | 436 | ); |
@@ -530,7 +530,7 @@ discard block |
||
530 | 530 | return; |
531 | 531 | } |
532 | 532 | |
533 | - $imageId = (string) $imageRemoved->getImage()->getMediaObjectId(); |
|
533 | + $imageId = (string)$imageRemoved->getImage()->getMediaObjectId(); |
|
534 | 534 | |
535 | 535 | /** |
536 | 536 | * Matches any object that is not the removed image. |
@@ -541,7 +541,7 @@ discard block |
||
541 | 541 | * @return bool |
542 | 542 | * Returns true when the media object does not match the image to remove. |
543 | 543 | */ |
544 | - $shouldNotBeRemoved = function ($mediaObject) use ($imageId) { |
|
544 | + $shouldNotBeRemoved = function($mediaObject) use ($imageId) { |
|
545 | 545 | $containsId = !!strpos($mediaObject->{'@id'}, $imageId); |
546 | 546 | return !$containsId; |
547 | 547 | }; |
@@ -580,7 +580,7 @@ discard block |
||
580 | 580 | $document = $this->loadDocumentFromRepository($mainImageSelected); |
581 | 581 | $offerLd = $document->getBody(); |
582 | 582 | $imageId = $mainImageSelected->getImage()->getMediaObjectId(); |
583 | - $mediaObjectMatcher = function ($matchingMediaObject, $currentMediaObject) use ($imageId) { |
|
583 | + $mediaObjectMatcher = function($matchingMediaObject, $currentMediaObject) use ($imageId) { |
|
584 | 584 | if (!$matchingMediaObject && $this->mediaObjectMatchesId($currentMediaObject, $imageId)) { |
585 | 585 | $matchingMediaObject = $currentMediaObject; |
586 | 586 | } |
@@ -605,7 +605,7 @@ discard block |
||
605 | 605 | */ |
606 | 606 | protected function mediaObjectMatchesId($mediaObject, UUID $mediaObjectId) |
607 | 607 | { |
608 | - return strpos($mediaObject->{'@id'}, (string) $mediaObjectId) > 0; |
|
608 | + return strpos($mediaObject->{'@id'}, (string)$mediaObjectId) > 0; |
|
609 | 609 | } |
610 | 610 | |
611 | 611 | /** |
@@ -802,7 +802,7 @@ discard block |
||
802 | 802 | $document = $this->loadDocumentFromRepository($typicalAgeRangeUpdated); |
803 | 803 | |
804 | 804 | $offerLd = $document->getBody(); |
805 | - $offerLd->typicalAgeRange = (string) $typicalAgeRangeUpdated->getTypicalAgeRange(); |
|
805 | + $offerLd->typicalAgeRange = (string)$typicalAgeRangeUpdated->getTypicalAgeRange(); |
|
806 | 806 | |
807 | 807 | return $document->withBody($offerLd); |
808 | 808 | } |
@@ -930,14 +930,14 @@ discard block |
||
930 | 930 | $images = $imagesEvent->getImages(); |
931 | 931 | $currentMediaObjects = isset($offerLd->mediaObject) ? $offerLd->mediaObject : []; |
932 | 932 | $dutchMediaObjects = array_map( |
933 | - function (Image $image) { |
|
933 | + function(Image $image) { |
|
934 | 934 | return $this->mediaObjectSerializer->serialize($image, 'json-ld'); |
935 | 935 | }, |
936 | 936 | $images->toArray() |
937 | 937 | ); |
938 | 938 | $translatedMediaObjects = array_filter( |
939 | 939 | $currentMediaObjects, |
940 | - function ($image) { |
|
940 | + function($image) { |
|
941 | 941 | return $image->inLanguage !== 'nl'; |
942 | 942 | } |
943 | 943 | ); |
@@ -950,7 +950,7 @@ discard block |
||
950 | 950 | } |
951 | 951 | |
952 | 952 | if (isset($mainImage)) { |
953 | - $offerLd->image = (string) $mainImage->getSourceLocation(); |
|
953 | + $offerLd->image = (string)$mainImage->getSourceLocation(); |
|
954 | 954 | } |
955 | 955 | } |
956 | 956 |
@@ -9,8 +9,8 @@ |
||
9 | 9 | */ |
10 | 10 | public function format(Address $address) |
11 | 11 | { |
12 | - return $address->getPostalCode() . ' ' . |
|
13 | - $address->getLocality() . ', ' . |
|
12 | + return $address->getPostalCode().' '. |
|
13 | + $address->getLocality().', '. |
|
14 | 14 | $address->getCountry()->getCode(); |
15 | 15 | } |
16 | 16 | } |
@@ -154,7 +154,7 @@ |
||
154 | 154 | } |
155 | 155 | return parent::serialize() + array( |
156 | 156 | 'main_language' => $this->mainLanguage->getCode(), |
157 | - 'title' => (string) $this->getTitle(), |
|
157 | + 'title' => (string)$this->getTitle(), |
|
158 | 158 | 'event_type' => $this->getEventType()->serialize(), |
159 | 159 | 'theme' => $theme, |
160 | 160 | 'address' => $this->getAddress()->serialize(), |
@@ -73,8 +73,8 @@ |
||
73 | 73 | { |
74 | 74 | return parent::serialize() + array( |
75 | 75 | 'main_language' => $this->getMainLanguage()->getCode(), |
76 | - 'website' => (string) $this->getWebsite(), |
|
77 | - 'title' => (string) $this->getTitle(), |
|
76 | + 'website' => (string)$this->getWebsite(), |
|
77 | + 'title' => (string)$this->getTitle(), |
|
78 | 78 | ); |
79 | 79 | } |
80 | 80 |
@@ -19,7 +19,7 @@ |
||
19 | 19 | { |
20 | 20 | if (!is_string($itemId)) { |
21 | 21 | throw new \InvalidArgumentException( |
22 | - 'Expected itemId to be a string, received ' . gettype($itemId) |
|
22 | + 'Expected itemId to be a string, received '.gettype($itemId) |
|
23 | 23 | ); |
24 | 24 | } |
25 | 25 |
@@ -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() |
@@ -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 | /** |