@@ -7,7 +7,7 @@ |
||
| 7 | 7 | |
| 8 | 8 | private function download(): void |
| 9 | 9 | { |
| 10 | - if(!file_exists($this->filename)) { |
|
| 10 | + if (!file_exists($this->filename)) { |
|
| 11 | 11 | $url = str_replace('%locale%', $this->getLocale(), $this->url); |
| 12 | 12 | copy($url, $this->filename); |
| 13 | 13 | } |
@@ -65,15 +65,15 @@ discard block |
||
| 65 | 65 | private function parse(): void |
| 66 | 66 | { |
| 67 | 67 | $parsedCategories = []; |
| 68 | - for ($depth=0; $depth<self::DEPTH; $depth++) { |
|
| 68 | + for ($depth = 0; $depth < self::DEPTH; $depth++) { |
|
| 69 | 69 | foreach ($this->categories as $id => $category) { |
| 70 | - if(count($category) !== $depth + 1) { |
|
| 70 | + if (count($category) !== $depth + 1) { |
|
| 71 | 71 | continue; |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | $parentId = 0; |
| 75 | - $parentCategoryDepth = $depth-1; |
|
| 76 | - if($parentCategoryDepth >= 0) { |
|
| 75 | + $parentCategoryDepth = $depth - 1; |
|
| 76 | + if ($parentCategoryDepth >= 0) { |
|
| 77 | 77 | foreach ($parsedCategories as $item) { |
| 78 | 78 | if ($item['name'] === $category[$parentCategoryDepth]) { |
| 79 | 79 | $parentId = $item['id']; |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | $parentId = $this->categories[$parentId]['parentId']; |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | - $item['parents'] = $parents; |
|
| 124 | + $item['parents'] = $parents; |
|
| 125 | 125 | } |
| 126 | 126 | } |
| 127 | 127 | |