@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | // return unique contents |
104 | 104 | $section = $this->repository->getSectionService()->loadSection($sectionId); |
105 | 105 | $sections[$section->id] = $section; |
106 | - } catch(NotFoundException $e) { |
|
106 | + } catch (NotFoundException $e) { |
|
107 | 107 | if (!$tolerateMisses) { |
108 | 108 | throw $e; |
109 | 109 | } |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | // return unique contents |
129 | 129 | $section = $this->repository->getSectionService()->loadSectionByIdentifier($sectionIdentifier); |
130 | 130 | $sections[$section->id] = $section; |
131 | - } catch(NotFoundException $e) { |
|
131 | + } catch (NotFoundException $e) { |
|
132 | 132 | if (!$tolerateMisses) { |
133 | 133 | throw $e; |
134 | 134 | } |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | $userGroup = $this->repository->getUserService()->loadUserGroup($userGroupId); |
107 | 107 | |
108 | 108 | $userGroups[$userGroup->id] = $userGroup; |
109 | - } catch(NotFoundException $e) { |
|
109 | + } catch (NotFoundException $e) { |
|
110 | 110 | if (!$tolerateMisses) { |
111 | 111 | throw $e; |
112 | 112 | } |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | $userGroup = $this->repository->getUserService()->loadUserGroup($content->id); |
137 | 137 | |
138 | 138 | $userGroups[$userGroup->id] = $userGroup; |
139 | - } catch(NotFoundException $e) { |
|
139 | + } catch (NotFoundException $e) { |
|
140 | 140 | if (!$tolerateMisses) { |
141 | 141 | throw $e; |
142 | 142 | } |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | // return unique contents |
100 | 100 | $language = $this->repository->getContentLanguageService()->loadLanguageById($languageId); |
101 | 101 | $languages[$language->id] = $language; |
102 | - } catch(NotFoundException $e) { |
|
102 | + } catch (NotFoundException $e) { |
|
103 | 103 | if (!$tolerateMisses) { |
104 | 104 | throw $e; |
105 | 105 | } |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | // return unique contents |
125 | 125 | $language = $this->repository->getContentLanguageService()->loadLanguage($languageIdentifier); |
126 | 126 | $languages[$language->id] = $language; |
127 | - } catch(NotFoundException $e) { |
|
127 | + } catch (NotFoundException $e) { |
|
128 | 128 | if (!$tolerateMisses) { |
129 | 129 | throw $e; |
130 | 130 | } |
@@ -100,7 +100,7 @@ |
||
100 | 100 | // return unique contents |
101 | 101 | $objectState = $this->repository->getObjectStateService()->loadObjectState($objectStateId); |
102 | 102 | $objectStates[$objectState->id] = $objectState; |
103 | - } catch(NotFoundException $e) { |
|
103 | + } catch (NotFoundException $e) { |
|
104 | 104 | if (!$tolerateMisses) { |
105 | 105 | throw $e; |
106 | 106 | } |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | // return unique contents |
101 | 101 | $contentTypeGroup = $this->repository->getContentTypeService()->loadContentTypeGroup($contentTypeGroupId); |
102 | 102 | $contentTypeGroups[$contentTypeGroup->id] = $contentTypeGroup; |
103 | - } catch(NotFoundException $e) { |
|
103 | + } catch (NotFoundException $e) { |
|
104 | 104 | if (!$tolerateMisses) { |
105 | 105 | throw $e; |
106 | 106 | } |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | // return unique contents |
126 | 126 | $contentTypeGroup = $this->repository->getContentTypeService()->loadContentTypeGroupByIdentifier($contentTypeGroupIdentifier); |
127 | 127 | $contentTypeGroups[$contentTypeGroup->id] = $contentTypeGroup; |
128 | - } catch(NotFoundException $e) { |
|
128 | + } catch (NotFoundException $e) { |
|
129 | 129 | if (!$tolerateMisses) { |
130 | 130 | throw $e; |
131 | 131 | } |
@@ -37,11 +37,11 @@ discard block |
||
37 | 37 | $contents = array(); |
38 | 38 | switch ($key) { |
39 | 39 | case self::MATCH_CONTENT_ID: |
40 | - foreach($match as $contentId) { |
|
40 | + foreach ($match as $contentId) { |
|
41 | 41 | try { |
42 | 42 | $content = $this->repository->getContentService()->loadContent($contentId); |
43 | 43 | $contents[$content->id] = $content; |
44 | - } catch(NotFoundException $e) { |
|
44 | + } catch (NotFoundException $e) { |
|
45 | 45 | if (!$tolerateMisses) { |
46 | 46 | throw $e; |
47 | 47 | } |
@@ -49,11 +49,11 @@ discard block |
||
49 | 49 | } |
50 | 50 | break; |
51 | 51 | case self::MATCH_CONTENT_REMOTE_ID: |
52 | - foreach($match as $contentRemoteId) { |
|
52 | + foreach ($match as $contentRemoteId) { |
|
53 | 53 | try { |
54 | 54 | $content = $this->repository->getContentService()->loadContentByRemoteId($contentRemoteId); |
55 | 55 | $contents[$content->id] = $content; |
56 | - } catch(NotFoundException $e) { |
|
56 | + } catch (NotFoundException $e) { |
|
57 | 57 | if (!$tolerateMisses) { |
58 | 58 | throw $e; |
59 | 59 | } |
@@ -2,7 +2,7 @@ discard block |
||
2 | 2 | |
3 | 3 | namespace Kaliop\eZMigrationBundle\Core\Matcher; |
4 | 4 | |
5 | -use eZ\Publish\API\Repository\Exceptions\UnauthorizedException ; |
|
5 | +use eZ\Publish\API\Repository\Exceptions\UnauthorizedException; |
|
6 | 6 | use eZ\Publish\API\Repository\Repository; |
7 | 7 | use eZ\Publish\API\Repository\Values\Content\Content; |
8 | 8 | use \eZ\Publish\API\Repository\Values\Content\VersionInfo; |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | $versions = array(); |
58 | 58 | |
59 | 59 | $contentCollection = $this->contentMatcher->match($contentConditions, $sort, $offset, $limit, $tolerateMisses); |
60 | - foreach($contentCollection as $content) { |
|
60 | + foreach ($contentCollection as $content) { |
|
61 | 61 | $versions = array_merge($versions, $this->matchContentVersions($versionConditions, $content)); |
62 | 62 | } |
63 | 63 | |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | { |
180 | 180 | $versions = array(); |
181 | 181 | foreach ($this->findAllContentVersions($content) as $versionKey => $versionInfo) { |
182 | - foreach($values as $acceptedStatus) { |
|
182 | + foreach ($values as $acceptedStatus) { |
|
183 | 183 | if ($versionInfo->status == self::STATUS_MAP[$acceptedStatus]) { |
184 | 184 | $versions[$versionKey] = $versionInfo; |
185 | 185 | break; |
@@ -203,15 +203,15 @@ discard block |
||
203 | 203 | $contentVersionsCount = count($contentVersions); |
204 | 204 | $i = 0; |
205 | 205 | foreach ($contentVersions as $versionKey => $versionInfo) { |
206 | - foreach($values as $acceptedVersionNo) { |
|
207 | - if ($acceptedVersionNo > 0 ) { |
|
206 | + foreach ($values as $acceptedVersionNo) { |
|
207 | + if ($acceptedVersionNo > 0) { |
|
208 | 208 | if ($acceptedVersionNo == $versionInfo->versionNo) { |
209 | 209 | $versions[$versionKey] = $versionInfo; |
210 | 210 | break; |
211 | 211 | } |
212 | 212 | } else { |
213 | 213 | // negative $acceptedVersionNo means 'leave the last X versions', eg: -1 = leave the last version |
214 | - if ($i < $contentVersionsCount + $acceptedVersionNo) { |
|
214 | + if ($i < $contentVersionsCount + $acceptedVersionNo) { |
|
215 | 215 | $versions[$versionKey] = $versionInfo; |
216 | 216 | break; |
217 | 217 | |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | $contentVersions = $this->repository->getContentService()->loadVersions($content->contentInfo); |
234 | 234 | // different eZ kernels apparently sort versions in different order... |
235 | 235 | $sortedVersions = array(); |
236 | - foreach($contentVersions as $versionInfo) { |
|
236 | + foreach ($contentVersions as $versionInfo) { |
|
237 | 237 | $sortedVersions[$content->contentInfo->id . '/' . $versionInfo->versionNo] = $versionInfo; |
238 | 238 | } |
239 | 239 | ksort($sortedVersions); |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | // return unique contents |
109 | 109 | $contentType = $this->repository->getContentTypeService()->loadContentType($contentTypeId); |
110 | 110 | $contentTypes[$contentType->id] = $contentType; |
111 | - } catch(NotFoundException $e) { |
|
111 | + } catch (NotFoundException $e) { |
|
112 | 112 | if (!$tolerateMisses) { |
113 | 113 | throw $e; |
114 | 114 | } |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | // return unique contents |
134 | 134 | $contentType = $this->repository->getContentTypeService()->loadContentTypeByIdentifier($contentTypeIdentifier); |
135 | 135 | $contentTypes[$contentType->id] = $contentType; |
136 | - } catch(NotFoundException $e) { |
|
136 | + } catch (NotFoundException $e) { |
|
137 | 137 | if (!$tolerateMisses) { |
138 | 138 | throw $e; |
139 | 139 | } |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | // return unique contents |
158 | 158 | $contentType = $this->repository->getContentTypeService()->loadContentTypeByRemoteId($contentTypeRemoteId); |
159 | 159 | $contentTypes[$contentType->id] = $contentType; |
160 | - } catch(NotFoundException $e) { |
|
160 | + } catch (NotFoundException $e) { |
|
161 | 161 | if (!$tolerateMisses) { |
162 | 162 | throw $e; |
163 | 163 | } |
@@ -117,13 +117,13 @@ discard block |
||
117 | 117 | $dsl['mode'] = 'load'; |
118 | 118 | // be kind to users and allow them not to specify this explicitly |
119 | 119 | if (isset($dsl['references'])) { |
120 | - foreach($dsl['references'] as &$refDef) { |
|
120 | + foreach ($dsl['references'] as &$refDef) { |
|
121 | 121 | $refDef['overwrite'] = true; |
122 | 122 | } |
123 | 123 | } |
124 | 124 | $step = new MigrationStep($dsl['type'], $dsl, $context); |
125 | 125 | |
126 | - switch($dsl['type']) { |
|
126 | + switch ($dsl['type']) { |
|
127 | 127 | case 'content': |
128 | 128 | return $this->contentManager->execute($step); |
129 | 129 | case 'location': |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | return $this->matchConditions($values); |
155 | 155 | |
156 | 156 | default: |
157 | - throw new InvalidStepDefinitionException("Unknown until condition: '$key' when suspending a migration ".var_export($conditions, true)); |
|
157 | + throw new InvalidStepDefinitionException("Unknown until condition: '$key' when suspending a migration " . var_export($conditions, true)); |
|
158 | 158 | } |
159 | 159 | } |
160 | 160 | } |