@@ -2,7 +2,6 @@ |
||
2 | 2 | |
3 | 3 | namespace GinoPane\BlogTaxonomy\Components; |
4 | 4 | |
5 | -use DB; |
|
6 | 5 | use Cms\Classes\Page; |
7 | 6 | use Cms\Classes\ComponentBase; |
8 | 7 | use GinoPane\BlogTaxonomy\Plugin; |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | /** |
20 | 20 | * @var Collection | array |
21 | 21 | */ |
22 | - public $tags = []; |
|
22 | + public $tags = [ ]; |
|
23 | 23 | |
24 | 24 | /** |
25 | 25 | * Reference to the page name for linking to tags page |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | $this->tagsPage = $this->property('tagsPage', ''); |
136 | 136 | $this->sortOrder = $this->property('sortOrder', 'title asc'); |
137 | 137 | $this->displayEmpty = $this->property('displayEmpty', false); |
138 | - $this->limit = $this->property('limit', 0); |
|
138 | + $this->limit = $this->property('limit', 0); |
|
139 | 139 | |
140 | 140 | $this->tags = $this->listTags(); |
141 | 141 | } |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | /** |
81 | 81 | * @var array |
82 | 82 | */ |
83 | - protected $slugs = ['slug' => 'title']; |
|
83 | + protected $slugs = [ 'slug' => 'title' ]; |
|
84 | 84 | |
85 | 85 | /** |
86 | 86 | * @return mixed |
@@ -114,22 +114,22 @@ discard block |
||
114 | 114 | */ |
115 | 115 | public function scopeListFrontend($query, $options) |
116 | 116 | { |
117 | - if (in_array($options['sort'], array_keys(self::$sortingOptions))) { |
|
118 | - if ($options['sort'] == 'random') { |
|
117 | + if (in_array($options[ 'sort' ], array_keys(self::$sortingOptions))) { |
|
118 | + if ($options[ 'sort' ] == 'random') { |
|
119 | 119 | $query->inRandomOrder(); |
120 | 120 | } else { |
121 | - list($sortField, $sortDirection) = explode(' ', $options['sort']); |
|
121 | + list($sortField, $sortDirection) = explode(' ', $options[ 'sort' ]); |
|
122 | 122 | |
123 | 123 | $query->orderBy($sortField, $sortDirection); |
124 | 124 | } |
125 | 125 | } |
126 | 126 | |
127 | - if (empty($options['displayEmpty'])) { |
|
127 | + if (empty($options[ 'displayEmpty' ])) { |
|
128 | 128 | $query->has('posts'); |
129 | 129 | } |
130 | 130 | |
131 | 131 | return $query->with([ |
132 | - 'posts' => function ($query) { |
|
132 | + 'posts' => function($query) { |
|
133 | 133 | $query->isPublished(); |
134 | 134 | } |
135 | 135 | ] |