@@ -32,7 +32,7 @@ |
||
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | // build full path |
| 35 | - $path = '/content/read/' . $content->getPath() . '#comments-list'; |
|
| 35 | + $path = '/content/read/'.$content->getPath().'#comments-list'; |
|
| 36 | 36 | |
| 37 | 37 | // redirect to comment. todo: load all comments and scroll to target by id |
| 38 | 38 | $this->response->redirect($path); |
@@ -40,10 +40,10 @@ discard block |
||
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | // build sitemap items using iteration - 5000 rows per each one |
| 43 | - $iterations = (int)($contentCount / self::$contentRowsEachRun); |
|
| 43 | + $iterations = (int) ($contentCount / self::$contentRowsEachRun); |
|
| 44 | 44 | for ($i = 0; $i <= $iterations; $i++) { |
| 45 | 45 | // check if lifetime is expired for current sitemap index |
| 46 | - $xmlTime = File::mTime('/upload/sitemap/content.' . $i . '.' . $langs[0] . '.xml'); |
|
| 46 | + $xmlTime = File::mTime('/upload/sitemap/content.'.$i.'.'.$langs[0].'.xml'); |
|
| 47 | 47 | $updateDelay = self::$updateSitemapDelay * 60; |
| 48 | 48 | $updateDelay += mt_rand(0, 1800); // +- 0-30 rand min for caching update |
| 49 | 49 | // do not process if cache time is not expired |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | /** @var \Apps\ActiveRecord\Content $content */ |
| 64 | 64 | $uri = '/content/read/'; |
| 65 | 65 | if (!Str::likeEmpty($content->category->path)) { |
| 66 | - $uri .= $content->category->path . '/'; |
|
| 66 | + $uri .= $content->category->path.'/'; |
|
| 67 | 67 | } |
| 68 | 68 | $uri .= $content->path; |
| 69 | 69 | $sitemap->add($uri, $content->created_at, 'weekly', 0.7); |
@@ -71,13 +71,13 @@ discard block |
||
| 71 | 71 | // add categories |
| 72 | 72 | $categories = ContentCategory::all(); |
| 73 | 73 | foreach ($categories as $item) { |
| 74 | - if ((bool)$item->getProperty('showCategory')) { |
|
| 75 | - $uri = '/content/list/' . $item->path; |
|
| 74 | + if ((bool) $item->getProperty('showCategory')) { |
|
| 75 | + $uri = '/content/list/'.$item->path; |
|
| 76 | 76 | $sitemap->add($uri, date('c'), 'daily', 0.9); |
| 77 | 77 | } |
| 78 | 78 | } |
| 79 | 79 | // save data to xml file |
| 80 | - $sitemap->save('content.' . $i); |
|
| 80 | + $sitemap->save('content.'.$i); |
|
| 81 | 81 | } |
| 82 | 82 | } |
| 83 | 83 | } |
| 84 | 84 | \ No newline at end of file |
@@ -25,13 +25,13 @@ |
||
| 25 | 25 | */ |
| 26 | 26 | public function display(string $id): void |
| 27 | 27 | { |
| 28 | - $status = (bool)$this->request->query->get('status', 0); |
|
| 28 | + $status = (bool) $this->request->query->get('status', 0); |
|
| 29 | 29 | $content = \Apps\ActiveRecord\Content::find($id); |
| 30 | 30 | if (!$content) { |
| 31 | 31 | throw new NotFoundException(__('Content {%id%} are not exist', ['id' => $id])); |
| 32 | 32 | } |
| 33 | 33 | // make update query if status is different than required |
| 34 | - if ((bool)$content->display !== $status) { |
|
| 34 | + if ((bool) $content->display !== $status) { |
|
| 35 | 35 | $content->display = $status; |
| 36 | 36 | $content->save(); |
| 37 | 37 | } |
@@ -24,13 +24,13 @@ |
||
| 24 | 24 | */ |
| 25 | 25 | public function important(string $id): void |
| 26 | 26 | { |
| 27 | - $status = (bool)$this->request->query->get('status', 0); |
|
| 27 | + $status = (bool) $this->request->query->get('status', 0); |
|
| 28 | 28 | $content = \Apps\ActiveRecord\Content::find($id); |
| 29 | 29 | if (!$content) { |
| 30 | 30 | throw new NotFoundException(__('Content {%id%} are not exist', ['id' => $id])); |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | - if ((bool)$content->important !== $status) { |
|
| 33 | + if ((bool) $content->important !== $status) { |
|
| 34 | 34 | $content->important = $status; |
| 35 | 35 | $content->save(); |
| 36 | 36 | } |