@@ -21,7 +21,7 @@ |
||
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | $precision = 0; |
| 24 | - return new Price((int) round($value * 100, $precision)); |
|
| 24 | + return new Price((int)round($value * 100, $precision)); |
|
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | /** |
@@ -46,9 +46,9 @@ |
||
| 46 | 46 | StringLiteral $constraint, |
| 47 | 47 | StringLiteral $offerId |
| 48 | 48 | ) { |
| 49 | - $constraintStr = '(' . strtolower($constraint->toNative()) . ')'; |
|
| 49 | + $constraintStr = '('.strtolower($constraint->toNative()).')'; |
|
| 50 | 50 | $offerIdStr = $offerId->toNative(); |
| 51 | 51 | |
| 52 | - return '(' . $constraintStr . ' AND cdbid:' . $offerIdStr . ')'; |
|
| 52 | + return '('.$constraintStr.' AND cdbid:'.$offerIdStr.')'; |
|
| 53 | 53 | } |
| 54 | 54 | } |
@@ -62,7 +62,7 @@ |
||
| 62 | 62 | |
| 63 | 63 | if ($address) { |
| 64 | 64 | $address = new Address( |
| 65 | - new Street($address->getStreet() . ' ' . $address->getHouseNumber()), |
|
| 65 | + new Street($address->getStreet().' '.$address->getHouseNumber()), |
|
| 66 | 66 | new PostalCode($address->getZip()), |
| 67 | 67 | new Locality($address->getCity()), |
| 68 | 68 | Country::fromNative($address->getCountry()) |
@@ -29,6 +29,6 @@ |
||
| 29 | 29 | |
| 30 | 30 | /* @var OrganizerCreatedWithUniqueWebsite $payload */ |
| 31 | 31 | $payload = $domainMessage->getPayload(); |
| 32 | - return new StringLiteral((string) $payload->getWebsite()); |
|
| 32 | + return new StringLiteral((string)$payload->getWebsite()); |
|
| 33 | 33 | } |
| 34 | 34 | } |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | public function getCdbId($externalId) |
| 26 | 26 | { |
| 27 | 27 | if (isset($this->externalIdMapping[$externalId])) { |
| 28 | - return (string) $this->externalIdMapping[$externalId]; |
|
| 28 | + return (string)$this->externalIdMapping[$externalId]; |
|
| 29 | 29 | } else { |
| 30 | 30 | return null; |
| 31 | 31 | } |
@@ -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 | ); |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | $organizerCreated->getOrganizerId() |
| 134 | 134 | ); |
| 135 | 135 | |
| 136 | - $jsonLD->url = (string) $organizerCreated->getWebsite(); |
|
| 136 | + $jsonLD->url = (string)$organizerCreated->getWebsite(); |
|
| 137 | 137 | $jsonLD->name = $organizerCreated->getTitle(); |
| 138 | 138 | |
| 139 | 139 | $recordedOn = $domainMessage->getRecordedOn()->toString(); |
@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | $labelsProperty = $labelAdded->getLabel()->isVisible() ? 'labels' : 'hiddenLabels'; |
| 227 | 227 | |
| 228 | 228 | $labels = isset($jsonLD->{$labelsProperty}) ? $jsonLD->{$labelsProperty} : []; |
| 229 | - $label = (string) $labelAdded->getLabel(); |
|
| 229 | + $label = (string)$labelAdded->getLabel(); |
|
| 230 | 230 | |
| 231 | 231 | $labels[] = $label; |
| 232 | 232 | $jsonLD->{$labelsProperty} = array_unique($labels); |
@@ -248,7 +248,7 @@ discard block |
||
| 248 | 248 | if (isset($jsonLD->{$labelsProperty}) && is_array($jsonLD->{$labelsProperty})) { |
| 249 | 249 | $jsonLD->{$labelsProperty} = array_filter( |
| 250 | 250 | $jsonLD->{$labelsProperty}, |
| 251 | - function ($label) use ($labelRemoved) { |
|
| 251 | + function($label) use ($labelRemoved) { |
|
| 252 | 252 | return !$labelRemoved->getLabel()->equals( |
| 253 | 253 | new Label($label) |
| 254 | 254 | ); |