@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | use Core\Controller; |
9 | 9 | use Core\Container; |
10 | 10 | |
11 | -class Post extends Controller{ |
|
11 | +class Post extends Controller { |
|
12 | 12 | |
13 | 13 | protected $siteConfig; |
14 | 14 | |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | * @throws \Twig_Error_Runtime |
27 | 27 | * @throws \Twig_Error_Syntax |
28 | 28 | */ |
29 | - public function viewPost(string $slug){ |
|
29 | + public function viewPost(string $slug) { |
|
30 | 30 | |
31 | 31 | $tagModel = new TagModel($this->container); |
32 | 32 | $postModel = new PostModel($this->container); |
@@ -38,9 +38,9 @@ discard block |
||
38 | 38 | $posts = $postModel->getSinglePost($postId); |
39 | 39 | |
40 | 40 | //only admins can view unpublished posts |
41 | - if(!$posts->published) |
|
41 | + if (!$posts->published) |
|
42 | 42 | { |
43 | - if(!$this->auth->isAdmin()) |
|
43 | + if (!$this->auth->isAdmin()) |
|
44 | 44 | { |
45 | 45 | throw new \Exception("File does not exist", "404"); |
46 | 46 | } |