@@ -18,6 +18,7 @@ discard block |
||
18 | 18 | * |
19 | 19 | * @param string $id |
20 | 20 | * @param string $description |
21 | + * @return string |
|
21 | 22 | */ |
22 | 23 | public function updateDescription($id, $description); |
23 | 24 | |
@@ -26,6 +27,7 @@ discard block |
||
26 | 27 | * |
27 | 28 | * @param string $id |
28 | 29 | * @param AgeRange $ageRange |
30 | + * @return string |
|
29 | 31 | */ |
30 | 32 | public function updateTypicalAgeRange($id, AgeRange $ageRange); |
31 | 33 | |
@@ -33,6 +35,7 @@ discard block |
||
33 | 35 | * Delete the typical age range of a place. |
34 | 36 | * |
35 | 37 | * @param string $id |
38 | + * @return string |
|
36 | 39 | */ |
37 | 40 | public function deleteTypicalAgeRange($id); |
38 | 41 | |
@@ -41,6 +44,7 @@ discard block |
||
41 | 44 | * |
42 | 45 | * @param string $id |
43 | 46 | * @param string $organizerId |
47 | + * @return string |
|
44 | 48 | */ |
45 | 49 | public function updateOrganizer($id, $organizerId); |
46 | 50 | |
@@ -49,6 +53,7 @@ discard block |
||
49 | 53 | * |
50 | 54 | * @param string $id |
51 | 55 | * @param string $organizerId |
56 | + * @return string |
|
52 | 57 | */ |
53 | 58 | public function deleteOrganizer($id, $organizerId); |
54 | 59 | |
@@ -57,6 +62,7 @@ discard block |
||
57 | 62 | * |
58 | 63 | * @param string $id |
59 | 64 | * @param ContactPoint $contactPoint |
65 | + * @return string |
|
60 | 66 | */ |
61 | 67 | public function updateContactPoint($id, ContactPoint $contactPoint); |
62 | 68 | |
@@ -65,6 +71,7 @@ discard block |
||
65 | 71 | * |
66 | 72 | * @param string $id |
67 | 73 | * @param Image $image |
74 | + * @return string |
|
68 | 75 | */ |
69 | 76 | public function addImage($id, Image $image); |
70 | 77 | |
@@ -91,6 +98,7 @@ discard block |
||
91 | 98 | * |
92 | 99 | * @param string $id |
93 | 100 | * @param Image $image |
101 | + * @return string |
|
94 | 102 | */ |
95 | 103 | public function removeImage($id, Image $image); |
96 | 104 |
@@ -36,7 +36,7 @@ |
||
36 | 36 | public function serialize() |
37 | 37 | { |
38 | 38 | return parent::serialize() + array( |
39 | - 'typicalAgeRange' => (string) $this->typicalAgeRange, |
|
39 | + 'typicalAgeRange' => (string)$this->typicalAgeRange, |
|
40 | 40 | ); |
41 | 41 | } |
42 | 42 |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | |
126 | 126 | if (preg_match('/^apply(.+)$/', $method, $matches)) { |
127 | 127 | $event = $matches[1]; |
128 | - $classNameMethod = 'get' . $event . 'ClassName'; |
|
128 | + $classNameMethod = 'get'.$event.'ClassName'; |
|
129 | 129 | |
130 | 130 | if (method_exists($this, $classNameMethod)) { |
131 | 131 | $eventFullClassName = call_user_func(array($this, $classNameMethod)); |
@@ -265,7 +265,7 @@ discard block |
||
265 | 265 | $labelsProperty = $labelAdded->getLabel()->isVisible() ? 'labels' : 'hiddenLabels'; |
266 | 266 | |
267 | 267 | $labels = isset($offerLd->{$labelsProperty}) ? $offerLd->{$labelsProperty} : []; |
268 | - $label = (string) $labelAdded->getLabel(); |
|
268 | + $label = (string)$labelAdded->getLabel(); |
|
269 | 269 | |
270 | 270 | $labels[] = $label; |
271 | 271 | $offerLd->{$labelsProperty} = array_unique($labels); |
@@ -290,7 +290,7 @@ discard block |
||
290 | 290 | if (isset($offerLd->{$labelsProperty}) && is_array($offerLd->{$labelsProperty})) { |
291 | 291 | $offerLd->{$labelsProperty} = array_filter( |
292 | 292 | $offerLd->{$labelsProperty}, |
293 | - function ($label) use ($labelRemoved) { |
|
293 | + function($label) use ($labelRemoved) { |
|
294 | 294 | return !$labelRemoved->getLabel()->equals( |
295 | 295 | new Label($label) |
296 | 296 | ); |
@@ -387,7 +387,7 @@ discard block |
||
387 | 387 | return; |
388 | 388 | } |
389 | 389 | |
390 | - $imageId = (string) $imageRemoved->getImage()->getMediaObjectId(); |
|
390 | + $imageId = (string)$imageRemoved->getImage()->getMediaObjectId(); |
|
391 | 391 | |
392 | 392 | /** |
393 | 393 | * Matches any object that is not the removed image. |
@@ -398,7 +398,7 @@ discard block |
||
398 | 398 | * @return bool |
399 | 399 | * Returns true when the media object does not match the image to remove. |
400 | 400 | */ |
401 | - $shouldNotBeRemoved = function ($mediaObject) use ($imageId) { |
|
401 | + $shouldNotBeRemoved = function($mediaObject) use ($imageId) { |
|
402 | 402 | $containsId = !!strpos($mediaObject->{'@id'}, $imageId); |
403 | 403 | return !$containsId; |
404 | 404 | }; |
@@ -436,7 +436,7 @@ discard block |
||
436 | 436 | $document = $this->loadDocumentFromRepository($mainImageSelected); |
437 | 437 | $offerLd = $document->getBody(); |
438 | 438 | $imageId = $mainImageSelected->getImage()->getMediaObjectId(); |
439 | - $mediaObjectMatcher = function ($matchingMediaObject, $currentMediaObject) use ($imageId) { |
|
439 | + $mediaObjectMatcher = function($matchingMediaObject, $currentMediaObject) use ($imageId) { |
|
440 | 440 | if (!$matchingMediaObject && $this->mediaObjectMatchesId($currentMediaObject, $imageId)) { |
441 | 441 | $matchingMediaObject = $currentMediaObject; |
442 | 442 | } |
@@ -461,7 +461,7 @@ discard block |
||
461 | 461 | */ |
462 | 462 | protected function mediaObjectMatchesId($mediaObject, UUID $mediaObjectId) |
463 | 463 | { |
464 | - return strpos($mediaObject->{'@id'}, (string) $mediaObjectId) > 0; |
|
464 | + return strpos($mediaObject->{'@id'}, (string)$mediaObjectId) > 0; |
|
465 | 465 | } |
466 | 466 | |
467 | 467 | /** |
@@ -616,7 +616,7 @@ discard block |
||
616 | 616 | $document = $this->loadDocumentFromRepository($typicalAgeRangeUpdated); |
617 | 617 | |
618 | 618 | $offerLd = $document->getBody(); |
619 | - $offerLd->typicalAgeRange = (string) $typicalAgeRangeUpdated->getTypicalAgeRange(); |
|
619 | + $offerLd->typicalAgeRange = (string)$typicalAgeRangeUpdated->getTypicalAgeRange(); |
|
620 | 620 | |
621 | 621 | $this->repository->save($document->withBody($offerLd)); |
622 | 622 | } |
@@ -642,7 +642,7 @@ discard block |
||
642 | 642 | */ |
643 | 643 | protected function applyPublished(AbstractPublished $published) |
644 | 644 | { |
645 | - $this->applyEventTransformation($published, function ($offerLd) use ($published) { |
|
645 | + $this->applyEventTransformation($published, function($offerLd) use ($published) { |
|
646 | 646 | $offerLd->workflowStatus = WorkflowStatus::READY_FOR_VALIDATION()->getName(); |
647 | 647 | |
648 | 648 | $publicationDate = $published->getPublicationDate(); |
@@ -655,7 +655,7 @@ discard block |
||
655 | 655 | */ |
656 | 656 | protected function applyApproved(AbstractApproved $approved) |
657 | 657 | { |
658 | - $this->applyEventTransformation($approved, function ($offerLd) { |
|
658 | + $this->applyEventTransformation($approved, function($offerLd) { |
|
659 | 659 | $offerLd->workflowStatus = WorkflowStatus::APPROVED()->getName(); |
660 | 660 | }); |
661 | 661 | } |
@@ -691,7 +691,7 @@ discard block |
||
691 | 691 | */ |
692 | 692 | private function reject() |
693 | 693 | { |
694 | - return function ($offerLd) { |
|
694 | + return function($offerLd) { |
|
695 | 695 | $offerLd->workflowStatus = WorkflowStatus::REJECTED()->getName(); |
696 | 696 | }; |
697 | 697 | } |
@@ -738,7 +738,7 @@ discard block |
||
738 | 738 | { |
739 | 739 | $images = $imagesEvent->getImages(); |
740 | 740 | $jsonMediaObjects = array_map( |
741 | - function (Image $image) { |
|
741 | + function(Image $image) { |
|
742 | 742 | return $this->mediaObjectSerializer->serialize($image, 'json-ld'); |
743 | 743 | }, |
744 | 744 | $images->toArray() |
@@ -752,7 +752,7 @@ discard block |
||
752 | 752 | } |
753 | 753 | |
754 | 754 | if (isset($mainImage)) { |
755 | - $offerLd->image = (string) $mainImage->getSourceLocation(); |
|
755 | + $offerLd->image = (string)$mainImage->getSourceLocation(); |
|
756 | 756 | } |
757 | 757 | } |
758 | 758 |
@@ -63,10 +63,10 @@ |
||
63 | 63 | */ |
64 | 64 | public function __toString() |
65 | 65 | { |
66 | - $from = $this->from ? (string) $this->from : ''; |
|
67 | - $to = $this->to ? (string) $this->to : ''; |
|
66 | + $from = $this->from ? (string)$this->from : ''; |
|
67 | + $to = $this->to ? (string)$this->to : ''; |
|
68 | 68 | |
69 | - return $from . '-' . $to; |
|
69 | + return $from.'-'.$to; |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | /** |