@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | $jsonLD->address = $placeCreated->getAddress()->toJsonLd(); |
| 185 | 185 | |
| 186 | 186 | $calendarJsonLD = $placeCreated->getCalendar()->toJsonLd(); |
| 187 | - $jsonLD = (object) array_merge((array) $jsonLD, $calendarJsonLD); |
|
| 187 | + $jsonLD = (object)array_merge((array)$jsonLD, $calendarJsonLD); |
|
| 188 | 188 | |
| 189 | 189 | $availableTo = AvailableTo::createFromCalendar($placeCreated->getCalendar()); |
| 190 | 190 | $jsonLD->availableTo = (string)$availableTo; |
@@ -246,8 +246,8 @@ discard block |
||
| 246 | 246 | $jsonLD->availableTo = (string)$availableTo; |
| 247 | 247 | |
| 248 | 248 | // Remove old theme and event type. |
| 249 | - $jsonLD->terms = array_filter($jsonLD->terms, function ($term) { |
|
| 250 | - return $term->domain !== EventType::DOMAIN && $term->domain !== Theme::DOMAIN; |
|
| 249 | + $jsonLD->terms = array_filter($jsonLD->terms, function($term) { |
|
| 250 | + return $term->domain !== EventType::DOMAIN && $term->domain !== Theme::DOMAIN; |
|
| 251 | 251 | }); |
| 252 | 252 | |
| 253 | 253 | $eventType = $majorInfoUpdated->getEventType(); |
@@ -279,7 +279,7 @@ discard block |
||
| 279 | 279 | // Remove all old facilities + get numeric keys. |
| 280 | 280 | $terms = array_values(array_filter( |
| 281 | 281 | $terms, |
| 282 | - function ($term) { |
|
| 282 | + function($term) { |
|
| 283 | 283 | return $term->domain !== Facility::DOMAIN; |
| 284 | 284 | } |
| 285 | 285 | )); |
@@ -303,7 +303,7 @@ discard block |
||
| 303 | 303 | |
| 304 | 304 | $placeLd = $document->getBody(); |
| 305 | 305 | |
| 306 | - $placeLd->geo = (object) [ |
|
| 306 | + $placeLd->geo = (object)[ |
|
| 307 | 307 | 'latitude' => $geoCoordinatesUpdated->getCoordinates()->getLatitude()->toDouble(), |
| 308 | 308 | 'longitude' => $geoCoordinatesUpdated->getCoordinates()->getLongitude()->toDouble(), |
| 309 | 309 | ]; |
@@ -28,12 +28,12 @@ |
||
| 28 | 28 | |
| 29 | 29 | if (count($missingFields) > 0) { |
| 30 | 30 | $keys = implode(', ', $missingFields); |
| 31 | - throw new \InvalidArgumentException('The given cdbxml address is missing a ' . $keys); |
|
| 31 | + throw new \InvalidArgumentException('The given cdbxml address is missing a '.$keys); |
|
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | |
| 35 | 35 | return new Address( |
| 36 | - new Street($cdbAddress->getStreet() . ' ' . $cdbAddress->getHouseNumber()), |
|
| 36 | + new Street($cdbAddress->getStreet().' '.$cdbAddress->getHouseNumber()), |
|
| 37 | 37 | new PostalCode($cdbAddress->getZip()), |
| 38 | 38 | new Locality($cdbAddress->getCity()), |
| 39 | 39 | Country::fromNative($cdbAddress->getCountry()) |
@@ -38,7 +38,7 @@ |
||
| 38 | 38 | public function serialize() |
| 39 | 39 | { |
| 40 | 40 | return parent::serialize() + [ |
| 41 | - 'website' => (string) $this->getWebsite() |
|
| 41 | + 'website' => (string)$this->getWebsite() |
|
| 42 | 42 | ]; |
| 43 | 43 | } |
| 44 | 44 | |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | $organizerCreated->getOrganizerId() |
| 135 | 135 | ); |
| 136 | 136 | |
| 137 | - $jsonLD->url = (string) $organizerCreated->getWebsite(); |
|
| 137 | + $jsonLD->url = (string)$organizerCreated->getWebsite(); |
|
| 138 | 138 | $jsonLD->name = $organizerCreated->getTitle(); |
| 139 | 139 | |
| 140 | 140 | $recordedOn = $domainMessage->getRecordedOn()->toString(); |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | $document = $this->repository->get($organizerId); |
| 162 | 162 | |
| 163 | 163 | $jsonLD = $document->getBody(); |
| 164 | - $jsonLD->url = (string) $websiteUpdated->getWebsite(); |
|
| 164 | + $jsonLD->url = (string)$websiteUpdated->getWebsite(); |
|
| 165 | 165 | |
| 166 | 166 | $this->repository->save($document->withBody($jsonLD)); |
| 167 | 167 | } |
@@ -257,7 +257,7 @@ discard block |
||
| 257 | 257 | $labelsProperty = $labelAdded->getLabel()->isVisible() ? 'labels' : 'hiddenLabels'; |
| 258 | 258 | |
| 259 | 259 | $labels = isset($jsonLD->{$labelsProperty}) ? $jsonLD->{$labelsProperty} : []; |
| 260 | - $label = (string) $labelAdded->getLabel(); |
|
| 260 | + $label = (string)$labelAdded->getLabel(); |
|
| 261 | 261 | |
| 262 | 262 | $labels[] = $label; |
| 263 | 263 | $jsonLD->{$labelsProperty} = array_unique($labels); |
@@ -281,7 +281,7 @@ discard block |
||
| 281 | 281 | if (isset($jsonLD->{$labelsProperty}) && is_array($jsonLD->{$labelsProperty})) { |
| 282 | 282 | $jsonLD->{$labelsProperty} = array_filter( |
| 283 | 283 | $jsonLD->{$labelsProperty}, |
| 284 | - function ($label) use ($labelRemoved) { |
|
| 284 | + function($label) use ($labelRemoved) { |
|
| 285 | 285 | return !$labelRemoved->getLabel()->equals( |
| 286 | 286 | new Label($label) |
| 287 | 287 | ); |
@@ -28,6 +28,6 @@ |
||
| 28 | 28 | |
| 29 | 29 | /* @var OrganizerCreatedWithUniqueWebsite|WebsiteUpdated $payload */ |
| 30 | 30 | $payload = $domainMessage->getPayload(); |
| 31 | - return new StringLiteral((string) $payload->getWebsite()); |
|
| 31 | + return new StringLiteral((string)$payload->getWebsite()); |
|
| 32 | 32 | } |
| 33 | 33 | } |
@@ -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 | /** |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | $this->labelName = $labelName; |
| 46 | 46 | $this->relationType = $relationType; |
| 47 | 47 | $this->relationId = $relationId; |
| 48 | - $this->imported = (bool) $imported; |
|
| 48 | + $this->imported = (bool)$imported; |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | /** |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | new LabelName($relation[SchemaConfigurator::LABEL_NAME]), |
| 104 | 104 | RelationType::fromNative($relation[SchemaConfigurator::RELATION_TYPE]), |
| 105 | 105 | new StringLiteral($relation[SchemaConfigurator::RELATION_ID]), |
| 106 | - (bool) $relation[SchemaConfigurator::IMPORTED] |
|
| 106 | + (bool)$relation[SchemaConfigurator::IMPORTED] |
|
| 107 | 107 | ); |
| 108 | 108 | } |
| 109 | 109 | } |