@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | $organizerCreated->getOrganizerId() |
143 | 143 | ); |
144 | 144 | |
145 | - $jsonLD->url = (string) $organizerCreated->getWebsite(); |
|
145 | + $jsonLD->url = (string)$organizerCreated->getWebsite(); |
|
146 | 146 | $jsonLD->name = $organizerCreated->getTitle(); |
147 | 147 | |
148 | 148 | $recordedOn = $domainMessage->getRecordedOn()->toString(); |
@@ -258,7 +258,7 @@ discard block |
||
258 | 258 | if (isset($jsonLD->labels)) { |
259 | 259 | $modifiedLabels = array_filter( |
260 | 260 | $jsonLD->labels, |
261 | - function ($label) use ($labelRemoved) { |
|
261 | + function($label) use ($labelRemoved) { |
|
262 | 262 | return $label->uuid !== $labelRemoved->getLabelId()->toNative(); |
263 | 263 | } |
264 | 264 | ); |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | array $openingHours = array() |
55 | 55 | ) { |
56 | 56 | if (($type->is(CalendarType::MULTIPLE()) || $type->is(CalendarType::SINGLE())) && empty($startDate)) { |
57 | - throw new \UnexpectedValueException('Start date can not be empty for calendar type: ' . $type . '.'); |
|
57 | + throw new \UnexpectedValueException('Start date can not be empty for calendar type: '.$type.'.'); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | if ($type->is(CalendarType::PERIODIC()) && (empty($startDate) || empty($endDate))) { |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | public function serialize() |
83 | 83 | { |
84 | 84 | $serializedTimestamps = array_map( |
85 | - function (Timestamp $timestamp) { |
|
85 | + function(Timestamp $timestamp) { |
|
86 | 86 | return $timestamp->serialize(); |
87 | 87 | }, |
88 | 88 | $this->timestamps |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | !empty($data['startDate']) ? self::deserializeDateTime($data['startDate']) : null, |
111 | 111 | !empty($data['endDate']) ? self::deserializeDateTime($data['endDate']) : null, |
112 | 112 | !empty($data['timestamps']) ? array_map( |
113 | - function ($timestamp) { |
|
113 | + function($timestamp) { |
|
114 | 114 | return Timestamp::deserialize($timestamp); |
115 | 115 | }, |
116 | 116 | $data['timestamps'] |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | // Permanent - with openingtimes |
211 | 211 | $openingHours = $this->getOpeningHours(); |
212 | 212 | if (!empty($openingHours)) { |
213 | - $jsonLd['openingHours'] = (array) $openingHours; |
|
213 | + $jsonLd['openingHours'] = (array)$openingHours; |
|
214 | 214 | } |
215 | 215 | |
216 | 216 | return $jsonLd; |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | |
131 | 131 | if (preg_match('/^apply(.+)$/', $method, $matches)) { |
132 | 132 | $event = $matches[1]; |
133 | - $classNameMethod = 'get' . $event . 'ClassName'; |
|
133 | + $classNameMethod = 'get'.$event.'ClassName'; |
|
134 | 134 | |
135 | 135 | if (method_exists($this, $classNameMethod)) { |
136 | 136 | $eventFullClassName = call_user_func(array($this, $classNameMethod)); |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | $labelsProperty = $labelAdded->getLabel()->isVisible() ? 'labels' : 'hiddenLabels'; |
261 | 261 | |
262 | 262 | $labels = isset($offerLd->{$labelsProperty}) ? $offerLd->{$labelsProperty} : []; |
263 | - $label = (string) $labelAdded->getLabel(); |
|
263 | + $label = (string)$labelAdded->getLabel(); |
|
264 | 264 | |
265 | 265 | $labels[] = $label; |
266 | 266 | $offerLd->{$labelsProperty} = array_unique($labels); |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | if (isset($offerLd->{$labelsProperty}) && is_array($offerLd->{$labelsProperty})) { |
284 | 284 | $offerLd->{$labelsProperty} = array_filter( |
285 | 285 | $offerLd->{$labelsProperty}, |
286 | - function ($label) use ($deleteLabel) { |
|
286 | + function($label) use ($deleteLabel) { |
|
287 | 287 | return !$deleteLabel->getLabel()->equals( |
288 | 288 | new Label($label) |
289 | 289 | ); |
@@ -379,7 +379,7 @@ discard block |
||
379 | 379 | return; |
380 | 380 | } |
381 | 381 | |
382 | - $imageId = (string) $imageRemoved->getImage()->getMediaObjectId(); |
|
382 | + $imageId = (string)$imageRemoved->getImage()->getMediaObjectId(); |
|
383 | 383 | |
384 | 384 | /** |
385 | 385 | * Matches any object that is not the removed image. |
@@ -390,7 +390,7 @@ discard block |
||
390 | 390 | * @return bool |
391 | 391 | * Returns true when the media object does not match the image to remove. |
392 | 392 | */ |
393 | - $shouldNotBeRemoved = function ($mediaObject) use ($imageId) { |
|
393 | + $shouldNotBeRemoved = function($mediaObject) use ($imageId) { |
|
394 | 394 | $containsId = !!strpos($mediaObject->{'@id'}, $imageId); |
395 | 395 | return !$containsId; |
396 | 396 | }; |
@@ -428,7 +428,7 @@ discard block |
||
428 | 428 | $document = $this->loadDocumentFromRepository($mainImageSelected); |
429 | 429 | $offerLd = $document->getBody(); |
430 | 430 | $imageId = $mainImageSelected->getImage()->getMediaObjectId(); |
431 | - $mediaObjectMatcher = function ($matchingMediaObject, $currentMediaObject) use ($imageId) { |
|
431 | + $mediaObjectMatcher = function($matchingMediaObject, $currentMediaObject) use ($imageId) { |
|
432 | 432 | if (!$matchingMediaObject && $this->mediaObjectMatchesId($currentMediaObject, $imageId)) { |
433 | 433 | $matchingMediaObject = $currentMediaObject; |
434 | 434 | } |
@@ -453,7 +453,7 @@ discard block |
||
453 | 453 | */ |
454 | 454 | protected function mediaObjectMatchesId($mediaObject, UUID $mediaObjectId) |
455 | 455 | { |
456 | - return strpos($mediaObject->{'@id'}, (string) $mediaObjectId) > 0; |
|
456 | + return strpos($mediaObject->{'@id'}, (string)$mediaObjectId) > 0; |
|
457 | 457 | } |
458 | 458 | |
459 | 459 | /** |
@@ -634,7 +634,7 @@ discard block |
||
634 | 634 | */ |
635 | 635 | protected function applyPublished(AbstractPublished $published) |
636 | 636 | { |
637 | - $this->applyEventTransformation($published, function ($offerLd) use ($published) { |
|
637 | + $this->applyEventTransformation($published, function($offerLd) use ($published) { |
|
638 | 638 | $offerLd->workflowStatus = WorkflowStatus::READY_FOR_VALIDATION()->getName(); |
639 | 639 | |
640 | 640 | $publicationDate = $published->getPublicationDate(); |
@@ -647,7 +647,7 @@ discard block |
||
647 | 647 | */ |
648 | 648 | protected function applyApproved(AbstractApproved $approved) |
649 | 649 | { |
650 | - $this->applyEventTransformation($approved, function ($offerLd) { |
|
650 | + $this->applyEventTransformation($approved, function($offerLd) { |
|
651 | 651 | $offerLd->workflowStatus = WorkflowStatus::APPROVED()->getName(); |
652 | 652 | }); |
653 | 653 | } |
@@ -683,7 +683,7 @@ discard block |
||
683 | 683 | */ |
684 | 684 | private function reject() |
685 | 685 | { |
686 | - return function ($offerLd) { |
|
686 | + return function($offerLd) { |
|
687 | 687 | $offerLd->workflowStatus = WorkflowStatus::REJECTED()->getName(); |
688 | 688 | }; |
689 | 689 | } |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | { |
17 | 17 | array_walk( |
18 | 18 | $labels, |
19 | - function ($item) { |
|
19 | + function($item) { |
|
20 | 20 | if (!$item instanceof Label) { |
21 | 21 | throw new \InvalidArgumentException( |
22 | 22 | 'Argument $labels should only contain members of type Label' |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | { |
52 | 52 | $labels = array_filter( |
53 | 53 | $this->labels, |
54 | - function (Label $existingLabel) use ($label) { |
|
54 | + function(Label $existingLabel) use ($label) { |
|
55 | 55 | return !$existingLabel->equals($label); |
56 | 56 | } |
57 | 57 | ); |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | { |
76 | 76 | $equalLabels = array_filter( |
77 | 77 | $this->labels, |
78 | - function (Label $existingLabel) use ($label) { |
|
78 | + function(Label $existingLabel) use ($label) { |
|
79 | 79 | return $label->equals($existingLabel); |
80 | 80 | } |
81 | 81 | ); |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | { |
123 | 123 | $intersectLabels = array_filter( |
124 | 124 | $this->labels, |
125 | - function ($label) use ($labelCollection) { |
|
125 | + function($label) use ($labelCollection) { |
|
126 | 126 | return $labelCollection->contains($label); |
127 | 127 | } |
128 | 128 | ); |
@@ -155,8 +155,8 @@ discard block |
||
155 | 155 | public function toStrings() |
156 | 156 | { |
157 | 157 | $labels = array_map( |
158 | - function (Label $label) { |
|
159 | - return (string) $label; |
|
158 | + function(Label $label) { |
|
159 | + return (string)$label; |
|
160 | 160 | }, |
161 | 161 | $this->labels |
162 | 162 | ); |
@@ -98,7 +98,7 @@ |
||
98 | 98 | { |
99 | 99 | array_walk( |
100 | 100 | $mergeLabels->getLabels()->asArray(), |
101 | - function (Label $label) { |
|
101 | + function(Label $label) { |
|
102 | 102 | $this->createLabel($label); |
103 | 103 | } |
104 | 104 | ); |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | private function dateFromUdb2UnixTime($unixTime) |
156 | 156 | { |
157 | 157 | $dateTime = new \DateTime( |
158 | - '@' . $unixTime, |
|
158 | + '@'.$unixTime, |
|
159 | 159 | new \DateTimeZone('Europe/Brussels') |
160 | 160 | ); |
161 | 161 | |
@@ -194,21 +194,21 @@ discard block |
||
194 | 194 | |
195 | 195 | $validKeywords = array_filter( |
196 | 196 | $keywords, |
197 | - function (CultureFeed_Cdb_Data_Keyword $keyword) { |
|
197 | + function(CultureFeed_Cdb_Data_Keyword $keyword) { |
|
198 | 198 | return strlen(trim($keyword->getValue())) > 0; |
199 | 199 | } |
200 | 200 | ); |
201 | 201 | |
202 | 202 | $visibleKeywords = array_filter( |
203 | 203 | $validKeywords, |
204 | - function (CultureFeed_Cdb_Data_Keyword $keyword) { |
|
204 | + function(CultureFeed_Cdb_Data_Keyword $keyword) { |
|
205 | 205 | return $keyword->isVisible(); |
206 | 206 | } |
207 | 207 | ); |
208 | 208 | |
209 | 209 | $hiddenKeywords = array_filter( |
210 | 210 | $validKeywords, |
211 | - function (CultureFeed_Cdb_Data_Keyword $keyword) { |
|
211 | + function(CultureFeed_Cdb_Data_Keyword $keyword) { |
|
212 | 212 | return !$keyword->isVisible(); |
213 | 213 | } |
214 | 214 | ); |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | private function addKeywordsAsLabelsProperty($jsonLD, $labelsPropertyName, array $keywords) |
227 | 227 | { |
228 | 228 | $labels = array_map( |
229 | - function ($keyword) { |
|
229 | + function($keyword) { |
|
230 | 230 | /** @var CultureFeed_Cdb_Data_Keyword $keyword */ |
231 | 231 | return $keyword->getValue(); |
232 | 232 | }, |
@@ -312,7 +312,7 @@ discard block |
||
312 | 312 | 'addressLocality' => $address->getCity(), |
313 | 313 | 'postalCode' => $address->getZip(), |
314 | 314 | 'streetAddress' => |
315 | - $address->getStreet() . ' ' . $address->getHouseNumber( |
|
315 | + $address->getStreet().' '.$address->getHouseNumber( |
|
316 | 316 | ), |
317 | 317 | ); |
318 | 318 | } |
@@ -493,7 +493,7 @@ discard block |
||
493 | 493 | ) { |
494 | 494 | $contactInfo = $event->getContactInfo(); |
495 | 495 | |
496 | - $notForReservations = function ($item) { |
|
496 | + $notForReservations = function($item) { |
|
497 | 497 | /** @var \CultureFeed_Cdb_Data_Url|\CultureFeed_Cdb_Data_Phone|\CultureFeed_Cdb_Data_Mail $item */ |
498 | 498 | return !$item->isForReservations(); |
499 | 499 | }; |
@@ -505,7 +505,7 @@ discard block |
||
505 | 505 | |
506 | 506 | if (!empty($emails)) { |
507 | 507 | $contactPoint['email'] = array_map( |
508 | - function (\CultureFeed_Cdb_Data_Mail $email) { |
|
508 | + function(\CultureFeed_Cdb_Data_Mail $email) { |
|
509 | 509 | return $email->getMailAddress(); |
510 | 510 | }, |
511 | 511 | $emails |
@@ -517,7 +517,7 @@ discard block |
||
517 | 517 | |
518 | 518 | if (!empty($phones)) { |
519 | 519 | $contactPoint['phone'] = array_map( |
520 | - function (\CultureFeed_Cdb_Data_phone $phone) { |
|
520 | + function(\CultureFeed_Cdb_Data_phone $phone) { |
|
521 | 521 | return $phone->getNumber(); |
522 | 522 | }, |
523 | 523 | $phones |
@@ -529,7 +529,7 @@ discard block |
||
529 | 529 | |
530 | 530 | if (!empty($urls)) { |
531 | 531 | $contactPoint['url'] = array_map( |
532 | - function (\CultureFeed_Cdb_Data_Url $url) { |
|
532 | + function(\CultureFeed_Cdb_Data_Url $url) { |
|
533 | 533 | return $url->getUrl(); |
534 | 534 | }, |
535 | 535 | $urls |
@@ -588,7 +588,7 @@ discard block |
||
588 | 588 | $calendarType = 'periodic'; |
589 | 589 | $calendar->rewind(); |
590 | 590 | $firstCalendarItem = $calendar->current(); |
591 | - $startDateString = $firstCalendarItem->getDateFrom() . 'T00:00:00'; |
|
591 | + $startDateString = $firstCalendarItem->getDateFrom().'T00:00:00'; |
|
592 | 592 | $startDate = DateTimeFactory::dateTimeFromDateString($startDateString); |
593 | 593 | |
594 | 594 | if (iterator_count($calendar) > 1) { |
@@ -598,7 +598,7 @@ discard block |
||
598 | 598 | $lastCalendarItem = $firstCalendarItem; |
599 | 599 | } |
600 | 600 | |
601 | - $endDateString = $lastCalendarItem->getDateTo() . 'T00:00:00'; |
|
601 | + $endDateString = $lastCalendarItem->getDateTo().'T00:00:00'; |
|
602 | 602 | $endDate = DateTimeFactory::dateTimeFromDateString($endDateString); |
603 | 603 | |
604 | 604 | $jsonLD->startDate = $startDate->format('c'); |
@@ -610,9 +610,9 @@ discard block |
||
610 | 610 | $firstCalendarItem = $calendar->current(); |
611 | 611 | if ($firstCalendarItem->getStartTime()) { |
612 | 612 | $dateString = |
613 | - $firstCalendarItem->getDate() . 'T' . $firstCalendarItem->getStartTime(); |
|
613 | + $firstCalendarItem->getDate().'T'.$firstCalendarItem->getStartTime(); |
|
614 | 614 | } else { |
615 | - $dateString = $firstCalendarItem->getDate() . 'T00:00:00'; |
|
615 | + $dateString = $firstCalendarItem->getDate().'T00:00:00'; |
|
616 | 616 | } |
617 | 617 | |
618 | 618 | $startDate = DateTimeFactory::dateTimeFromDateString($dateString); |
@@ -627,10 +627,10 @@ discard block |
||
627 | 627 | $endDateString = null; |
628 | 628 | if ($lastCalendarItem->getEndTime()) { |
629 | 629 | $endDateString = |
630 | - $lastCalendarItem->getDate() . 'T' . $lastCalendarItem->getEndTime(); |
|
630 | + $lastCalendarItem->getDate().'T'.$lastCalendarItem->getEndTime(); |
|
631 | 631 | } else { |
632 | 632 | if (iterator_count($calendar) > 1) { |
633 | - $endDateString = $lastCalendarItem->getDate() . 'T00:00:00'; |
|
633 | + $endDateString = $lastCalendarItem->getDate().'T00:00:00'; |
|
634 | 634 | } |
635 | 635 | } |
636 | 636 | |
@@ -744,7 +744,7 @@ discard block |
||
744 | 744 | $slug = ''; |
745 | 745 | } |
746 | 746 | |
747 | - $reference = 'http://www.uitinvlaanderen.be/agenda/e/' . $slug . '/' . $event->getCdbId(); |
|
747 | + $reference = 'http://www.uitinvlaanderen.be/agenda/e/'.$slug.'/'.$event->getCdbId(); |
|
748 | 748 | |
749 | 749 | |
750 | 750 | if (!property_exists($jsonLD, 'sameAs')) { |