@@ -218,8 +218,12 @@ |
||
218 | 218 | $this->lastPage = ceil($this->totalPosts / $this->resultsPerPage); |
219 | 219 | |
220 | 220 | // Prevent the current page from being one that doesn't exist |
221 | - if ($this->currentPage < 1) $this->currentPage = 1; |
|
222 | - if ($this->currentPage > $this->lastPage) $this->currentPage = $this->lastPage; |
|
221 | + if ($this->currentPage < 1) { |
|
222 | + $this->currentPage = 1; |
|
223 | + } |
|
224 | + if ($this->currentPage > $this->lastPage) { |
|
225 | + $this->currentPage = $this->lastPage; |
|
226 | + } |
|
223 | 227 | |
224 | 228 | // Calculate the previous page |
225 | 229 | $this->previousPage = $this->currentPage > 1 |
@@ -130,8 +130,9 @@ |
||
130 | 130 | $query->orderBy($key, $this->property('direction')); |
131 | 131 | |
132 | 132 | // Limit the number of results |
133 | - if ($take = intval($this->property('results'))) |
|
134 | - $query->take($take); |
|
133 | + if ($take = intval($this->property('results'))) { |
|
134 | + $query->take($take); |
|
135 | + } |
|
135 | 136 | |
136 | 137 | $tags = $query->get(); |
137 | 138 |
@@ -121,8 +121,9 @@ |
||
121 | 121 | ->first(); |
122 | 122 | |
123 | 123 | // Abort if there is no source, or it has no tags |
124 | - if (!$post || (!$tagIds = $post->tags->lists('id'))) |
|
125 | - return; |
|
124 | + if (!$post || (!$tagIds = $post->tags->lists('id'))) { |
|
125 | + return; |
|
126 | + } |
|
126 | 127 | |
127 | 128 | // Start building our query for related posts |
128 | 129 | $query = Post::isPublished() |