@@ -197,7 +197,7 @@ |
||
197 | 197 | { |
198 | 198 | |
199 | 199 | // explode the path of the root category |
200 | - list ($rootCategoryPath, ) = explode('/', $path); |
|
200 | + list ($rootCategoryPath,) = explode('/', $path); |
|
201 | 201 | |
202 | 202 | // query whether or not a root category with the given path exists |
203 | 203 | if ($rootCategory = $this->getCategoryByPath($rootCategoryPath)) { |
@@ -303,7 +303,7 @@ |
||
303 | 303 | |
304 | 304 | // load the global data we've prepared initially |
305 | 305 | $this->taxClasses = $status[RegistryKeys::GLOBAL_DATA][RegistryKeys::TAX_CLASSES]; |
306 | - $this->storeWebsites = $status[RegistryKeys::GLOBAL_DATA][RegistryKeys::STORE_WEBSITES]; |
|
306 | + $this->storeWebsites = $status[RegistryKeys::GLOBAL_DATA][RegistryKeys::STORE_WEBSITES]; |
|
307 | 307 | |
308 | 308 | // load the categories for the admin store view from the global data |
309 | 309 | $this->categories = $status[RegistryKeys::GLOBAL_DATA][RegistryKeys::CATEGORIES][StoreViewCodes::ADMIN]; |
@@ -86,8 +86,8 @@ |
||
86 | 86 | // load the columns from the metadata |
87 | 87 | $columns = array_filter( |
88 | 88 | $columnMetadataLoader->load($entityType), |
89 | - function ($value) { |
|
90 | - return $value['Key'] !== 'PRI' && $value['Null'] === 'NO' ; |
|
89 | + function($value) { |
|
90 | + return $value['Key'] !== 'PRI' && $value['Null'] === 'NO'; |
|
91 | 91 | } |
92 | 92 | ); |
93 | 93 | // initialize the raw entities and their default values, if available |
@@ -99,7 +99,7 @@ |
||
99 | 99 | |
100 | 100 | // skip update of URL rewrite, if nothing to change |
101 | 101 | if ($targetPath === $existingUrlRewrite[MemberNames::TARGET_PATH] && |
102 | - 301 === (int)$existingUrlRewrite[MemberNames::REDIRECT_TYPE]) { |
|
102 | + 301 === (int) $existingUrlRewrite[MemberNames::REDIRECT_TYPE]) { |
|
103 | 103 | // stop processing the URL rewrite |
104 | 104 | continue; |
105 | 105 | } |
@@ -123,7 +123,7 @@ |
||
123 | 123 | public function findAllByPath($path) |
124 | 124 | { |
125 | 125 | // load and return the categories with the passed path |
126 | - $this->categoryByPathChildrenStmt->execute(array(MemberNames::PATH => $path.'/%')); |
|
126 | + $this->categoryByPathChildrenStmt->execute(array(MemberNames::PATH => $path . '/%')); |
|
127 | 127 | $result = $this->categoryByPathChildrenStmt->fetchAll(\PDO::FETCH_ASSOC); |
128 | 128 | return $result ? $result : []; |
129 | 129 | } |
@@ -94,7 +94,7 @@ |
||
94 | 94 | */ |
95 | 95 | protected function process() |
96 | 96 | { |
97 | - $this->setValue(ColumnKeys::PATH, $this->getValue(ColumnKeys::PATH, null, function ($value) { |
|
97 | + $this->setValue(ColumnKeys::PATH, $this->getValue(ColumnKeys::PATH, null, function($value) { |
|
98 | 98 | return $this->serializer->normalize($value); |
99 | 99 | })); |
100 | 100 | } |
@@ -173,11 +173,9 @@ discard block |
||
173 | 173 | |
174 | 174 | // sort the main rows by the path, store_view_code and position |
175 | 175 | // ATTENTION: we use uasort, because we NEED to preserve the keys |
176 | - uasort($this->mainRows, function ($a, $b) { |
|
176 | + uasort($this->mainRows, function($a, $b) { |
|
177 | 177 | return |
178 | - strcmp($a[ColumnKeys::PATH], $b[ColumnKeys::PATH]) ?: |
|
179 | - strcmp($a[ColumnKeys::STORE_VIEW_CODE], $b[ColumnKeys::STORE_VIEW_CODE]) ?: |
|
180 | - strcmp($a[ColumnKeys::POSITION], $b[ColumnKeys::POSITION]); |
|
178 | + strcmp($a[ColumnKeys::PATH], $b[ColumnKeys::PATH]) ?: strcmp($a[ColumnKeys::STORE_VIEW_CODE], $b[ColumnKeys::STORE_VIEW_CODE]) ?: strcmp($a[ColumnKeys::POSITION], $b[ColumnKeys::POSITION]); |
|
181 | 179 | }); |
182 | 180 | |
183 | 181 | // update the position of the categories and the categories on the same level |
@@ -190,11 +188,9 @@ discard block |
||
190 | 188 | $this->artefacts = array_merge(array_values($this->artefacts), $this->storeViewRows); |
191 | 189 | |
192 | 190 | // sort the artefacts again, because we want to export them in the expected order |
193 | - usort($this->artefacts, function ($a, $b) { |
|
191 | + usort($this->artefacts, function($a, $b) { |
|
194 | 192 | return |
195 | - strcmp($a[ColumnKeys::PATH], $b[ColumnKeys::PATH]) ?: |
|
196 | - strcmp($a[ColumnKeys::STORE_VIEW_CODE], $b[ColumnKeys::STORE_VIEW_CODE]) ?: |
|
197 | - strcmp($a[ColumnKeys::POSITION], $b[ColumnKeys::POSITION]); |
|
193 | + strcmp($a[ColumnKeys::PATH], $b[ColumnKeys::PATH]) ?: strcmp($a[ColumnKeys::STORE_VIEW_CODE], $b[ColumnKeys::STORE_VIEW_CODE]) ?: strcmp($a[ColumnKeys::POSITION], $b[ColumnKeys::POSITION]); |
|
198 | 194 | }); |
199 | 195 | |
200 | 196 | // replace the artefacts to be exported later |
@@ -294,7 +290,7 @@ discard block |
||
294 | 290 | } |
295 | 291 | |
296 | 292 | // sor the categories by their position and KEEP the keys |
297 | - uasort($categoriesOnSameLevel, function ($a, $b) { |
|
293 | + uasort($categoriesOnSameLevel, function($a, $b) { |
|
298 | 294 | // return 0 when the position is equal (should never happen) |
299 | 295 | if ($a[MemberNames::POSITION] == $b[MemberNames::POSITION]) { |
300 | 296 | return 0; |
@@ -442,7 +438,7 @@ discard block |
||
442 | 438 | // iterate over the IDs |
443 | 439 | foreach ($ids as $id) { |
444 | 440 | // load the category with the actual ID |
445 | - $existingCategories = array_filter($this->existingCategories, function ($existingCategory) use ($id) { |
|
441 | + $existingCategories = array_filter($this->existingCategories, function($existingCategory) use ($id) { |
|
446 | 442 | return (int) $existingCategory[MemberNames::ENTITY_ID] === (int) $id; |
447 | 443 | }); |
448 | 444 |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | $this->prepareStoreViewCode(); |
172 | 172 | |
173 | 173 | // explode the path into the category names |
174 | - if ($categories = $this->getValue(ColumnKeys::PATH, array(), function ($value) { |
|
174 | + if ($categories = $this->getValue(ColumnKeys::PATH, array(), function($value) { |
|
175 | 175 | return $this->serializer->explode($value); |
176 | 176 | })) { |
177 | 177 | // initialize the flag to query whether or not the category is a leaf |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | |
198 | 198 | // empty $category failed on persisting, of course |
199 | 199 | if (empty($category)) { |
200 | - $message = sprintf('Categorie "%s" can\'t prepare for saving',$this->categoryPath); |
|
200 | + $message = sprintf('Categorie "%s" can\'t prepare for saving', $this->categoryPath); |
|
201 | 201 | $this->getSubject()->getSystemLogger()->error($this->getSubject()->appendExceptionSuffix($message)); |
202 | 202 | if (!$this->getSubject()->isStrictMode()) { |
203 | 203 | $this->getSubject()->mergeStatus( |