@@ -63,7 +63,7 @@ |
||
| 63 | 63 | $builderArgs = array($this->referenceResolver->resolveReference($dsl['command'])); |
| 64 | 64 | |
| 65 | 65 | if (isset($dsl['arguments'])) { |
| 66 | - foreach($dsl['arguments'] as $arg) { |
|
| 66 | + foreach ($dsl['arguments'] as $arg) { |
|
| 67 | 67 | $builderArgs[] = $this->referenceResolver->resolveReference($arg); |
| 68 | 68 | } |
| 69 | 69 | } |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | $executed = 0; |
| 94 | 94 | $failed = 0; |
| 95 | 95 | |
| 96 | - foreach($suspendedMigrations as $suspendedMigration) { |
|
| 96 | + foreach ($suspendedMigrations as $suspendedMigration) { |
|
| 97 | 97 | $output->writeln("<info>Resuming {$suspendedMigration->name}</info>"); |
| 98 | 98 | |
| 99 | 99 | try { |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | |
| 114 | 114 | $time = microtime(true) - $start; |
| 115 | 115 | $output->writeln("Resumed $executed migrations, failed $failed"); |
| 116 | - $output->writeln("Time taken: ".sprintf('%.2f', $time)." secs, memory: ".sprintf('%.2f', (memory_get_peak_usage(true) / 1000000)). ' MB'); |
|
| 116 | + $output->writeln("Time taken: " . sprintf('%.2f', $time) . " secs, memory: " . sprintf('%.2f', (memory_get_peak_usage(true) / 1000000)) . ' MB'); |
|
| 117 | 117 | |
| 118 | 118 | if ($failed) { |
| 119 | 119 | return 2; |
@@ -46,15 +46,15 @@ discard block |
||
| 46 | 46 | |
| 47 | 47 | foreach ($conditions as $key => $values) { |
| 48 | 48 | |
| 49 | - switch($key) { |
|
| 49 | + switch ($key) { |
|
| 50 | 50 | |
| 51 | 51 | case self::MATCH_RELATES_TO: |
| 52 | 52 | $contentService = $this->repository->getContentService(); |
| 53 | 53 | $contents = array(); |
| 54 | 54 | // allow to specify the objects to relate to using different ways |
| 55 | 55 | $relatedContents = $this->match($values); |
| 56 | - foreach($relatedContents as $relatedContent) { |
|
| 57 | - foreach($contentService->loadReverseRelations($relatedContent->contentInfo) as $relatingContent) { |
|
| 56 | + foreach ($relatedContents as $relatedContent) { |
|
| 57 | + foreach ($contentService->loadReverseRelations($relatedContent->contentInfo) as $relatingContent) { |
|
| 58 | 58 | $contents[$relatingContent->contentInfo->id] = $relatingContent; |
| 59 | 59 | } |
| 60 | 60 | } |
@@ -65,8 +65,8 @@ discard block |
||
| 65 | 65 | $contents = array(); |
| 66 | 66 | // allow to specify the objects we relate to using different ways |
| 67 | 67 | $relatingContents = $this->match($values); |
| 68 | - foreach($relatingContents as $relatingContent) { |
|
| 69 | - foreach($contentService->loadRelations($relatingContent->contentInfo) as $relatedContent) { |
|
| 68 | + foreach ($relatingContents as $relatingContent) { |
|
| 69 | + foreach ($contentService->loadRelations($relatingContent->contentInfo) as $relatedContent) { |
|
| 70 | 70 | $contents[$relatedContent->contentInfo->id] = $relatedContent; |
| 71 | 71 | } |
| 72 | 72 | } |
@@ -85,7 +85,9 @@ discard block |
||
| 85 | 85 | |
| 86 | 86 | $query = new Query(); |
| 87 | 87 | $query->limit = self::INT_MAX_16BIT; |
| 88 | - if (isset($query->performCount)) $query->performCount = false; |
|
| 88 | + if (isset($query->performCount)) { |
|
| 89 | + $query->performCount = false; |
|
| 90 | + } |
|
| 89 | 91 | $query->filter = $this->getQueryCriterion($key, $values); |
| 90 | 92 | switch ($key) { |
| 91 | 93 | case 'content_type_id': |
@@ -206,7 +208,9 @@ discard block |
||
| 206 | 208 | { |
| 207 | 209 | $query = new Query(); |
| 208 | 210 | $query->limit = self::INT_MAX_16BIT; |
| 209 | - if (isset($query->performCount)) $query->performCount = false; |
|
| 211 | + if (isset($query->performCount)) { |
|
| 212 | + $query->performCount = false; |
|
| 213 | + } |
|
| 210 | 214 | $query->filter = new Query\Criterion\ParentLocationId($parentLocationIds); |
| 211 | 215 | $results = $this->repository->getSearchService()->findContent($query); |
| 212 | 216 | |
@@ -246,7 +250,9 @@ discard block |
||
| 246 | 250 | { |
| 247 | 251 | $query = new Query(); |
| 248 | 252 | $query->limit = self::INT_MAX_16BIT; |
| 249 | - if (isset($query->performCount)) $query->performCount = false; |
|
| 253 | + if (isset($query->performCount)) { |
|
| 254 | + $query->performCount = false; |
|
| 255 | + } |
|
| 250 | 256 | $query->filter = new Query\Criterion\ContentTypeIdentifier($contentTypeIdentifiers); |
| 251 | 257 | // sort objects by depth, lower to higher, so that deleting them has less chances of failure |
| 252 | 258 | // NB: we only do this in eZP versions that allow depth sorting on content queries |
@@ -274,7 +280,9 @@ discard block |
||
| 274 | 280 | { |
| 275 | 281 | $query = new Query(); |
| 276 | 282 | $query->limit = self::INT_MAX_16BIT; |
| 277 | - if (isset($query->performCount)) $query->performCount = false; |
|
| 283 | + if (isset($query->performCount)) { |
|
| 284 | + $query->performCount = false; |
|
| 285 | + } |
|
| 278 | 286 | $query->filter = new Query\Criterion\ContentTypeId($contentTypeIds); |
| 279 | 287 | // sort objects by depth, lower to higher, so that deleting them has less chances of failure |
| 280 | 288 | // NB: we only do this in eZP versions that allow depth sorting on content queries |
@@ -58,26 +58,26 @@ |
||
| 58 | 58 | { |
| 59 | 59 | $format = array(); |
| 60 | 60 | if (0 != $dateInterval->y) { |
| 61 | - $format[] = $dateInterval->y.' years'; |
|
| 61 | + $format[] = $dateInterval->y . ' years'; |
|
| 62 | 62 | } |
| 63 | 63 | if (0 != $dateInterval->m) { |
| 64 | - $format[] = $dateInterval->m.' months'; |
|
| 64 | + $format[] = $dateInterval->m . ' months'; |
|
| 65 | 65 | } |
| 66 | 66 | if (0 != $dateInterval->d) { |
| 67 | - $format[] = $dateInterval->d.' days'; |
|
| 67 | + $format[] = $dateInterval->d . ' days'; |
|
| 68 | 68 | } |
| 69 | 69 | //if (0 < $dateInterval->h || 0 < $dateInterval->i || 0 < $dateInterval->s) { |
| 70 | 70 | // $format .= 'T'; |
| 71 | 71 | //} |
| 72 | 72 | if (0 != $dateInterval->h) { |
| 73 | - $format[] = $dateInterval->h.' hours'; |
|
| 73 | + $format[] = $dateInterval->h . ' hours'; |
|
| 74 | 74 | } |
| 75 | 75 | if (0 != $dateInterval->i) { |
| 76 | - $format[] = $dateInterval->i.' minutes'; |
|
| 76 | + $format[] = $dateInterval->i . ' minutes'; |
|
| 77 | 77 | } |
| 78 | 78 | if (0 != $dateInterval->s) { |
| 79 | - $format[] = $dateInterval->s.' seconds'; |
|
| 79 | + $format[] = $dateInterval->s . ' seconds'; |
|
| 80 | 80 | } |
| 81 | - return implode( ', ', $format); |
|
| 81 | + return implode(', ', $format); |
|
| 82 | 82 | } |
| 83 | 83 | } |
@@ -29,18 +29,18 @@ |
||
| 29 | 29 | $versions = (array)$step->dsl['versions']; |
| 30 | 30 | |
| 31 | 31 | foreach ($contentCollection as $content) { |
| 32 | - foreach($versions as $versionId) { |
|
| 32 | + foreach ($versions as $versionId) { |
|
| 33 | 33 | try { |
| 34 | 34 | if ($versionId < 0) { |
| 35 | 35 | $contentVersions = $contentService->loadVersions($content->contentInfo); |
| 36 | 36 | // different eZ kernels apparently sort versions in different order... |
| 37 | 37 | $sortedVersions = array(); |
| 38 | - foreach($contentVersions as $versionInfo) { |
|
| 38 | + foreach ($contentVersions as $versionInfo) { |
|
| 39 | 39 | $sortedVersions[$versionInfo->versionNo] = $versionInfo; |
| 40 | 40 | } |
| 41 | 41 | ksort($sortedVersions); |
| 42 | 42 | $sortedVersions = array_slice($sortedVersions, 0, $versionId); |
| 43 | - foreach($sortedVersions as $versionInfo) { |
|
| 43 | + foreach ($sortedVersions as $versionInfo) { |
|
| 44 | 44 | $contentService->deleteVersion($versionInfo); |
| 45 | 45 | } |
| 46 | 46 | } else { |
@@ -4,7 +4,6 @@ |
||
| 4 | 4 | |
| 5 | 5 | use eZ\Publish\API\Repository\Values\ContentType\ContentType; |
| 6 | 6 | use eZ\Publish\API\Repository\Values\ContentType\FieldDefinition; |
| 7 | -use eZ\Publish\API\Repository\Values\Content\Location; |
|
| 8 | 7 | use eZ\Publish\API\Repository\Values\Content\Content; |
| 9 | 8 | use eZ\Publish\API\Repository\Values\Content\ContentCreateStruct; |
| 10 | 9 | use eZ\Publish\API\Repository\Values\Content\ContentUpdateStruct; |
@@ -520,7 +520,7 @@ discard block |
||
| 520 | 520 | $locations = $locationService->loadLocations($content->contentInfo); |
| 521 | 521 | if (count($locations) > 1) { |
| 522 | 522 | $otherParentLocations = array(); |
| 523 | - foreach($locations as $otherLocation) { |
|
| 523 | + foreach ($locations as $otherLocation) { |
|
| 524 | 524 | if ($otherLocation->id != $location->id) { |
| 525 | 525 | $otherParentLocations[] = $otherLocation->parentLocationId; |
| 526 | 526 | } |
@@ -608,21 +608,21 @@ discard block |
||
| 608 | 608 | $fieldIdentifier = key($field); |
| 609 | 609 | $fieldValue = $field[$fieldIdentifier]; |
| 610 | 610 | if (is_array($fieldValue) && $this->hasLanguageCodesAsKeys($fieldValue)) { |
| 611 | - foreach($fieldValue as $languageCode => $value) { |
|
| 611 | + foreach ($fieldValue as $languageCode => $value) { |
|
| 612 | 612 | $fieldsList[] = [$fieldIdentifier, $value, $languageCode]; |
| 613 | 613 | } |
| 614 | 614 | } else { |
| 615 | 615 | $fieldsList[] = [$fieldIdentifier, $fieldValue, $this->getLanguageCode($step)]; |
| 616 | 616 | } |
| 617 | 617 | } else if (is_array($field) && $this->hasLanguageCodesAsKeys($field)) { |
| 618 | - foreach($field as $languageCode => $value) { |
|
| 618 | + foreach ($field as $languageCode => $value) { |
|
| 619 | 619 | $fieldsList[] = [$key, $value, $languageCode]; |
| 620 | 620 | } |
| 621 | 621 | } else { |
| 622 | 622 | $fieldsList[] = [$key, $field, $this->getLanguageCode($step)]; |
| 623 | 623 | } |
| 624 | 624 | |
| 625 | - foreach($fieldsList as list($fieldIdentifier, $fieldValue, $language)) { |
|
| 625 | + foreach ($fieldsList as list($fieldIdentifier, $fieldValue, $language)) { |
|
| 626 | 626 | if (!isset($contentType->fieldDefinitionsByIdentifier[$fieldIdentifier])) { |
| 627 | 627 | throw new \Exception("Field '$fieldIdentifier' is not present in content type '{$contentType->identifier}'"); |
| 628 | 628 | } |
@@ -658,7 +658,7 @@ discard block |
||
| 658 | 658 | }, |
| 659 | 659 | array_filter( |
| 660 | 660 | $this->repository->getContentLanguageService()->loadLanguages(), |
| 661 | - function ($language) { |
|
| 661 | + function($language) { |
|
| 662 | 662 | return $language->enabled; |
| 663 | 663 | } |
| 664 | 664 | ) |
@@ -36,7 +36,9 @@ |
||
| 36 | 36 | |
| 37 | 37 | $query = new Query(); |
| 38 | 38 | $query->limit = self::INT_MAX_16BIT; |
| 39 | - if (isset($query->performCount)) $query->performCount = false; |
|
| 39 | + if (isset($query->performCount)) { |
|
| 40 | + $query->performCount = false; |
|
| 41 | + } |
|
| 40 | 42 | $query->filter = $this->getQueryCriterion($key, $values); |
| 41 | 43 | $results = $this->repository->getTrashService()->findTrashItems($query); |
| 42 | 44 | |
@@ -22,13 +22,13 @@ |
||
| 22 | 22 | $contents = array(); |
| 23 | 23 | switch ($key) { |
| 24 | 24 | case self::MATCH_CONTENT_ID: |
| 25 | - foreach($match as $contentId) { |
|
| 25 | + foreach ($match as $contentId) { |
|
| 26 | 26 | $content = $this->repository->getContentService()->loadContent($contentId); |
| 27 | 27 | $contents[$content->id] = $content; |
| 28 | 28 | } |
| 29 | 29 | break; |
| 30 | 30 | case self::MATCH_CONTENT_REMOTE_ID: |
| 31 | - foreach($match as $contentRemoteId) { |
|
| 31 | + foreach ($match as $contentRemoteId) { |
|
| 32 | 32 | $content = $this->repository->getContentService()->loadContentByRemoteId($contentRemoteId); |
| 33 | 33 | $contents[$content->id] = $content; |
| 34 | 34 | } |
@@ -24,13 +24,13 @@ |
||
| 24 | 24 | $locations = array(); |
| 25 | 25 | switch ($key) { |
| 26 | 26 | case self::MATCH_LOCATION_ID: |
| 27 | - foreach($match as $locationId) { |
|
| 27 | + foreach ($match as $locationId) { |
|
| 28 | 28 | $location = $this->repository->getLocationService()->loadLocation($locationId); |
| 29 | 29 | $locations[$location->id] = $location; |
| 30 | 30 | } |
| 31 | 31 | break; |
| 32 | 32 | case self::MATCH_LOCATION_REMOTE_ID: |
| 33 | - foreach($match as $locationRemoteId) { |
|
| 33 | + foreach ($match as $locationRemoteId) { |
|
| 34 | 34 | $location = $this->repository->getLocationService()->loadLocationByRemoteId($locationRemoteId); |
| 35 | 35 | $locations[$location->id] = $location; |
| 36 | 36 | } |