@@ -63,34 +63,34 @@ |
||
| 63 | 63 | $userRolesSubQuery = $this->connection->createQueryBuilder() |
| 64 | 64 | ->select(PermissionsSchemaConfigurator::ROLE_ID_COLUMN) |
| 65 | 65 | ->from($this->userRolesTableName->toNative()) |
| 66 | - ->where(PermissionsSchemaConfigurator::USER_ID_COLUMN . ' = :userId'); |
|
| 66 | + ->where(PermissionsSchemaConfigurator::USER_ID_COLUMN.' = :userId'); |
|
| 67 | 67 | |
| 68 | 68 | $queryBuilder = $this->connection->createQueryBuilder(); |
| 69 | 69 | $userConstraintsQuery = $queryBuilder |
| 70 | - ->select('rs.' . SearchSchemaConfigurator::CONSTRAINT_COLUMN) |
|
| 70 | + ->select('rs.'.SearchSchemaConfigurator::CONSTRAINT_COLUMN) |
|
| 71 | 71 | ->from($this->rolesSearchTableName, 'rs') |
| 72 | 72 | ->innerJoin( |
| 73 | 73 | 'rs', |
| 74 | 74 | sprintf('(%s)', $userRolesSubQuery->getSQL()), |
| 75 | 75 | 'ur', |
| 76 | - 'rs.' . SearchSchemaConfigurator::UUID_COLUMN . ' = ur.' . PermissionsSchemaConfigurator::ROLE_ID_COLUMN |
|
| 76 | + 'rs.'.SearchSchemaConfigurator::UUID_COLUMN.' = ur.'.PermissionsSchemaConfigurator::ROLE_ID_COLUMN |
|
| 77 | 77 | ) |
| 78 | 78 | ->innerJoin( |
| 79 | 79 | 'rs', |
| 80 | 80 | $this->rolePermissionsTableName->toNative(), |
| 81 | 81 | 'rp', |
| 82 | - 'rs.' . SearchSchemaConfigurator::UUID_COLUMN . ' = rp.' . PermissionsSchemaConfigurator::ROLE_ID_COLUMN |
|
| 82 | + 'rs.'.SearchSchemaConfigurator::UUID_COLUMN.' = rp.'.PermissionsSchemaConfigurator::ROLE_ID_COLUMN |
|
| 83 | 83 | ) |
| 84 | - ->where(PermissionsSchemaConfigurator::PERMISSION_COLUMN . ' = :permission') |
|
| 84 | + ->where(PermissionsSchemaConfigurator::PERMISSION_COLUMN.' = :permission') |
|
| 85 | 85 | ->andWhere($queryBuilder->expr()->isNotNull( |
| 86 | - 'rs.' . SearchSchemaConfigurator::CONSTRAINT_COLUMN |
|
| 86 | + 'rs.'.SearchSchemaConfigurator::CONSTRAINT_COLUMN |
|
| 87 | 87 | )) |
| 88 | 88 | ->setParameter('userId', $userId->toNative()) |
| 89 | 89 | ->setParameter('permission', $permission->toNative()); |
| 90 | 90 | |
| 91 | 91 | $results = $userConstraintsQuery->execute()->fetchAll(\PDO::FETCH_COLUMN); |
| 92 | 92 | |
| 93 | - return array_map(function ($constraint) { |
|
| 93 | + return array_map(function($constraint) { |
|
| 94 | 94 | return new StringLiteral($constraint); |
| 95 | 95 | }, $results); |
| 96 | 96 | } |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | /** |
| 27 | - * @return StringLiteral |
|
| 27 | + * @return string |
|
| 28 | 28 | */ |
| 29 | 29 | public function getTitle() |
| 30 | 30 | { |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | /** |
| 27 | - * @return StringLiteral |
|
| 27 | + * @return string |
|
| 28 | 28 | */ |
| 29 | 29 | public function getTitle() |
| 30 | 30 | { |
@@ -624,7 +624,7 @@ |
||
| 624 | 624 | } |
| 625 | 625 | |
| 626 | 626 | /** |
| 627 | - * @return callable |
|
| 627 | + * @return \Closure |
|
| 628 | 628 | */ |
| 629 | 629 | private function reject() |
| 630 | 630 | { |
@@ -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 | /** |
@@ -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 | } |
@@ -728,7 +728,7 @@ discard block |
||
| 728 | 728 | { |
| 729 | 729 | $images = $imagesEvent->getImages(); |
| 730 | 730 | $jsonMediaObjects = array_map( |
| 731 | - function (Image $image) { |
|
| 731 | + function(Image $image) { |
|
| 732 | 732 | return $this->mediaObjectSerializer->serialize($image, 'json-ld'); |
| 733 | 733 | }, |
| 734 | 734 | $images->toArray() |
@@ -742,7 +742,7 @@ discard block |
||
| 742 | 742 | } |
| 743 | 743 | |
| 744 | 744 | if (isset($mainImage)) { |
| 745 | - $offerLd->image = (string) $mainImage->getSourceLocation(); |
|
| 745 | + $offerLd->image = (string)$mainImage->getSourceLocation(); |
|
| 746 | 746 | } |
| 747 | 747 | } |
| 748 | 748 | |
@@ -26,10 +26,10 @@ |
||
| 26 | 26 | StringLiteral $userId, |
| 27 | 27 | AuthorizableCommandInterface $command |
| 28 | 28 | ) { |
| 29 | - parent::__construct('User with id: ' . $userId->toNative() . |
|
| 30 | - ' has no permission: "' . $command->getPermission()->toNative() . |
|
| 31 | - '" on item: ' . $command->getItemId() . |
|
| 32 | - ' when executing command: ' . get_class($command)); |
|
| 29 | + parent::__construct('User with id: '.$userId->toNative(). |
|
| 30 | + ' has no permission: "'.$command->getPermission()->toNative(). |
|
| 31 | + '" on item: '.$command->getItemId(). |
|
| 32 | + ' when executing command: '.get_class($command)); |
|
| 33 | 33 | |
| 34 | 34 | $this->userId = $userId; |
| 35 | 35 | $this->command = $command; |
@@ -66,9 +66,9 @@ |
||
| 66 | 66 | public function serialize() |
| 67 | 67 | { |
| 68 | 68 | return [ |
| 69 | - 'cdbid' => $this->cdbid, |
|
| 70 | - 'name' => $this->name->toNative(), |
|
| 71 | - 'address' => $this->address->serialize() |
|
| 69 | + 'cdbid' => $this->cdbid, |
|
| 70 | + 'name' => $this->name->toNative(), |
|
| 71 | + 'address' => $this->address->serialize() |
|
| 72 | 72 | ]; |
| 73 | 73 | } |
| 74 | 74 | |
@@ -20,6 +20,7 @@ discard block |
||
| 20 | 20 | * |
| 21 | 21 | * @param string $id |
| 22 | 22 | * @param string $description |
| 23 | + * @return string |
|
| 23 | 24 | */ |
| 24 | 25 | public function updateDescription($id, $description); |
| 25 | 26 | |
@@ -28,6 +29,7 @@ discard block |
||
| 28 | 29 | * |
| 29 | 30 | * @param string $id |
| 30 | 31 | * @param string $ageRange |
| 32 | + * @return string |
|
| 31 | 33 | */ |
| 32 | 34 | public function updateTypicalAgeRange($id, $ageRange); |
| 33 | 35 | |
@@ -35,6 +37,7 @@ discard block |
||
| 35 | 37 | * Delete the typical age range of a place. |
| 36 | 38 | * |
| 37 | 39 | * @param string $id |
| 40 | + * @return string |
|
| 38 | 41 | */ |
| 39 | 42 | public function deleteTypicalAgeRange($id); |
| 40 | 43 | |
@@ -43,6 +46,7 @@ discard block |
||
| 43 | 46 | * |
| 44 | 47 | * @param string $id |
| 45 | 48 | * @param string $organizerId |
| 49 | + * @return string |
|
| 46 | 50 | */ |
| 47 | 51 | public function updateOrganizer($id, $organizerId); |
| 48 | 52 | |
@@ -51,6 +55,7 @@ discard block |
||
| 51 | 55 | * |
| 52 | 56 | * @param string $id |
| 53 | 57 | * @param string $organizerId |
| 58 | + * @return string |
|
| 54 | 59 | */ |
| 55 | 60 | public function deleteOrganizer($id, $organizerId); |
| 56 | 61 | |
@@ -59,6 +64,7 @@ discard block |
||
| 59 | 64 | * |
| 60 | 65 | * @param string $id |
| 61 | 66 | * @param ContactPoint $contactPoint |
| 67 | + * @return string |
|
| 62 | 68 | */ |
| 63 | 69 | public function updateContactPoint($id, ContactPoint $contactPoint); |
| 64 | 70 | |
@@ -67,6 +73,7 @@ discard block |
||
| 67 | 73 | * |
| 68 | 74 | * @param string $id |
| 69 | 75 | * @param Image $image |
| 76 | + * @return string |
|
| 70 | 77 | */ |
| 71 | 78 | public function addImage($id, Image $image); |
| 72 | 79 | |
@@ -93,6 +100,7 @@ discard block |
||
| 93 | 100 | * |
| 94 | 101 | * @param string $id |
| 95 | 102 | * @param Image $image |
| 103 | + * @return string |
|
| 96 | 104 | */ |
| 97 | 105 | public function removeImage($id, Image $image); |
| 98 | 106 | |
@@ -148,8 +148,8 @@ |
||
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | return parent::serialize() + array( |
| 151 | - 'website' => (string) $this->getWebsite(), |
|
| 152 | - 'title' => (string) $this->getTitle(), |
|
| 151 | + 'website' => (string)$this->getWebsite(), |
|
| 152 | + 'title' => (string)$this->getTitle(), |
|
| 153 | 153 | 'addresses' => $addresses, |
| 154 | 154 | 'phones' => $this->getPhones(), |
| 155 | 155 | 'emails' => $this->getEmails(), |
@@ -81,10 +81,10 @@ |
||
| 81 | 81 | public function serialize() |
| 82 | 82 | { |
| 83 | 83 | return [ |
| 84 | - 'streetAddress' => $this->streetAddress->toNative(), |
|
| 85 | - 'postalCode' => $this->postalCode->toNative(), |
|
| 86 | - 'addressLocality' => $this->locality->toNative(), |
|
| 87 | - 'addressCountry' => $this->countryCode, |
|
| 84 | + 'streetAddress' => $this->streetAddress->toNative(), |
|
| 85 | + 'postalCode' => $this->postalCode->toNative(), |
|
| 86 | + 'addressLocality' => $this->locality->toNative(), |
|
| 87 | + 'addressCountry' => $this->countryCode, |
|
| 88 | 88 | ]; |
| 89 | 89 | } |
| 90 | 90 | |