| @@ -75,7 +75,7 @@ discard block | ||
| 75 | 75 | */ | 
| 76 | 76 | public function getCategoryBySlug($urlSlug) | 
| 77 | 77 |      { | 
| 78 | - return $this->categoryMapper->select(['slug' => $urlSlug])->current(); | |
| 78 | + return $this->categoryMapper->select([ 'slug' => $urlSlug ])->current(); | |
| 79 | 79 | } | 
| 80 | 80 | |
| 81 | 81 | /** | 
| @@ -93,9 +93,9 @@ discard block | ||
| 93 | 93 | } | 
| 94 | 94 | |
| 95 | 95 | $values = $filter->getValues(); | 
| 96 | - $values['category_id'] = Uuid::uuid1()->toString(); | |
| 97 | - $values['category_uuid'] = (new MysqlUuid($values['category_id']))->toFormat(new Binary); | |
| 98 | - $values['main_img'] = $this->upload->uploadImage($data, 'main_img'); | |
| 96 | + $values[ 'category_id' ] = Uuid::uuid1()->toString(); | |
| 97 | + $values[ 'category_uuid' ] = (new MysqlUuid($values[ 'category_id' ]))->toFormat(new Binary); | |
| 98 | + $values[ 'main_img' ] = $this->upload->uploadImage($data, 'main_img'); | |
| 99 | 99 | |
| 100 | 100 | $this->categoryMapper->insert($values); | 
| 101 | 101 | } | 
| @@ -125,13 +125,13 @@ discard block | ||
| 125 | 125 | ]; | 
| 126 | 126 | |
| 127 | 127 | // We don't want to force user to re-upload image on edit | 
| 128 | -        if (!$values['main_img']) { | |
| 129 | - unset($values['main_img']); | |
| 128 | +        if (!$values[ 'main_img' ]) { | |
| 129 | + unset($values[ 'main_img' ]); | |
| 130 | 130 |          } else { | 
| 131 | 131 | $this->upload->deleteFile($oldCategory->main_img); | 
| 132 | 132 | } | 
| 133 | 133 | |
| 134 | - $this->categoryMapper->update($values, ['category_id' => $categoryId]); | |
| 134 | + $this->categoryMapper->update($values, [ 'category_id' => $categoryId ]); | |
| 135 | 135 | } | 
| 136 | 136 | |
| 137 | 137 | /** | 
| @@ -146,7 +146,7 @@ discard block | ||
| 146 | 146 | |
| 147 | 147 | $this->upload->deleteFile($category->main_img); | 
| 148 | 148 | |
| 149 | - return (bool)$this->categoryMapper->delete(['category_id' => $categoryId]); | |
| 149 | + return (bool) $this->categoryMapper->delete([ 'category_id' => $categoryId ]); | |
| 150 | 150 | } | 
| 151 | 151 | |
| 152 | 152 | /** | 
| @@ -157,7 +157,7 @@ discard block | ||
| 157 | 157 | public function getAll($type = null) | 
| 158 | 158 |      { | 
| 159 | 159 |          if ($type) { | 
| 160 | - return $this->categoryMapper->select(['type' => $type]); | |
| 160 | + return $this->categoryMapper->select([ 'type' => $type ]); | |
| 161 | 161 | } | 
| 162 | 162 | |
| 163 | 163 | return $this->categoryMapper->select(); | 
| @@ -175,9 +175,9 @@ discard block | ||
| 175 | 175 | $categories = $this->categoryMapper->getWeb(7, null, $inHomepage, $inCategoryList)->toArray(); | 
| 176 | 176 | |
| 177 | 177 |          foreach ($categories as $ctn => $category) { | 
| 178 | - $select = $this->categoryMapper->getCategoryPostsSelect($category['category_id'], 4); | |
| 178 | + $select = $this->categoryMapper->getCategoryPostsSelect($category[ 'category_id' ], 4); | |
| 179 | 179 | $posts = $this->categoryMapper->selectWith($select)->toArray(); | 
| 180 | - $categories[$ctn]['posts'] = $posts; | |
| 180 | + $categories[ $ctn ][ 'posts' ] = $posts; | |
| 181 | 181 | } | 
| 182 | 182 | |
| 183 | 183 | return $categories; | 
| @@ -191,7 +191,7 @@ discard block | ||
| 191 | 191 | */ | 
| 192 | 192 | public function getCategories($inCategoryList = null) | 
| 193 | 193 |      { | 
| 194 | - return $this->categoryMapper->getWeb(null, ['name' => 'asc'], null, $inCategoryList); | |
| 194 | + return $this->categoryMapper->getWeb(null, [ 'name' => 'asc' ], null, $inCategoryList); | |
| 195 | 195 | } | 
| 196 | 196 | |
| 197 | 197 | /** |