diff --git a/src/Controllers/CommentController.php b/src/Controllers/CommentController.php index a66b4872..c09d22bf 100644 --- a/src/Controllers/CommentController.php +++ b/src/Controllers/CommentController.php @@ -84,7 +84,8 @@ class CommentController if (InputHelper::get('sender') != 'preview') { CommentModel::save($comment); - LogHelper::log('{user} edited comment in {post}', ['post' => TextHelper::reprPost($comment->getPost())]); + LogHelper::log('{user} edited comment in {post}', [ + 'post' => TextHelper::reprPost($comment->getPost())]); } $context->transport->textPreview = $comment->getText(); StatusHelper::success(); @@ -101,7 +102,8 @@ class CommentController CommentModel::remove($comment); - LogHelper::log('{user} removed comment from {post}', ['post' => TextHelper::reprPost($comment->getPost())]); + LogHelper::log('{user} removed comment from {post}', [ + 'post' => TextHelper::reprPost($comment->getPost())]); StatusHelper::success(); } } diff --git a/src/Controllers/PostController.php b/src/Controllers/PostController.php index e6db8fdd..14a77d77 100644 --- a/src/Controllers/PostController.php +++ b/src/Controllers/PostController.php @@ -502,7 +502,11 @@ class PostController $newSafety = $post->safety; if ($oldSafety != $newSafety) - LogHelper::log('{user} changed safety of {post} to {safety}', ['post' => TextHelper::reprPost($post), 'safety' => PostSafety::toString($post->safety)]); + { + LogHelper::log('{user} changed safety of {post} to {safety}', [ + 'post' => TextHelper::reprPost($post), + 'safety' => PostSafety::toString($post->safety)]); + } } /* tags */ @@ -517,10 +521,18 @@ class PostController $newTags = array_map(function($tag) { return $tag->name; }, $post->getTags()); foreach (array_diff($oldTags, $newTags) as $tag) - LogHelper::log('{user} untagged {post} with {tag}', ['post' => TextHelper::reprPost($post), 'tag' => TextHelper::reprTag($tag)]); + { + LogHelper::log('{user} untagged {post} with {tag}', [ + 'post' => TextHelper::reprPost($post), + 'tag' => TextHelper::reprTag($tag)]); + } foreach (array_diff($newTags, $oldTags) as $tag) - LogHelper::log('{user} tagged {post} with {tag}', ['post' => TextHelper::reprPost($post), 'tag' => TextHelper::reprTag($tag)]); + { + LogHelper::log('{user} tagged {post} with {tag}', [ + 'post' => TextHelper::reprPost($post), + 'tag' => TextHelper::reprTag($tag)]); + } } /* source */ @@ -535,7 +547,11 @@ class PostController $newSource = $post->source; if ($oldSource != $newSource) - LogHelper::log('{user} changed source of {post} to {source}', ['post' => TextHelper::reprPost($post), 'source' => $post->source]); + { + LogHelper::log('{user} changed source of {post} to {source}', [ + 'post' => TextHelper::reprPost($post), + 'source' => $post->source]); + } } /* relations */ @@ -550,10 +566,18 @@ class PostController $newRelatedIds = array_map(function($post) { return $post->id; }, $post->getRelations()); foreach (array_diff($oldRelatedIds, $newRelatedIds) as $post2id) - LogHelper::log('{user} removed relation between {post} and {post2}', ['post' => TextHelper::reprPost($post), 'post2' => TextHelper::reprPost($post2id)]); + { + LogHelper::log('{user} removed relation between {post} and {post2}', [ + 'post' => TextHelper::reprPost($post), + 'post2' => TextHelper::reprPost($post2id)]); + } foreach (array_diff($newRelatedIds, $oldRelatedIds) as $post2id) - LogHelper::log('{user} added relation between {post} and {post2}', ['post' => TextHelper::reprPost($post), 'post2' => TextHelper::reprPost($post2id)]); + { + LogHelper::log('{user} added relation between {post} and {post2}', [ + 'post' => TextHelper::reprPost($post), + 'post2' => TextHelper::reprPost($post2id)]); + } } /* thumbnail */ diff --git a/src/Models/Entities/PostEntity.php b/src/Models/Entities/PostEntity.php index acd58898..cf5b7b1c 100644 --- a/src/Models/Entities/PostEntity.php +++ b/src/Models/Entities/PostEntity.php @@ -108,7 +108,11 @@ class PostEntity extends AbstractEntity continue; if (count($relatedPosts) > $config->browsing->maxRelatedPosts) - throw new SimpleException('Too many related posts (maximum: %d)', $config->browsing->maxRelatedPosts); + { + throw new SimpleException( + 'Too many related posts (maximum: %d)', + $config->browsing->maxRelatedPosts); + } $relatedPosts []= PostModel::findById($relatedId); } @@ -372,7 +376,11 @@ class PostEntity extends AbstractEntity $duplicatedPost = PostModel::findByHash($this->fileHash, false); if ($duplicatedPost !== null and (!$this->id or $this->id != $duplicatedPost->id)) - throw new SimpleException('Duplicate upload: %s', TextHelper::reprPost($duplicatedPost)); + { + throw new SimpleException( + 'Duplicate upload: %s', + TextHelper::reprPost($duplicatedPost)); + } $dstPath = $this->getFullPath(); @@ -407,7 +415,11 @@ class PostEntity extends AbstractEntity $duplicatedPost = PostModel::findByHash($youtubeId, false); if ($duplicatedPost !== null and (!$this->id or $this->id != $duplicatedPost->id)) - throw new SimpleException('Duplicate upload: %s' . TextHelper::reprPost($duplicatedPost)); + { + throw new SimpleException( + 'Duplicate upload: %s', + TextHelper::reprPost($duplicatedPost)); + } return; } @@ -436,7 +448,11 @@ class PostEntity extends AbstractEntity throw new SimpleException('Cannot write into file'); fflush($srcFP); if (ftell($srcFP) > $maxBytes) - throw new SimpleException('File is too big (maximum size: %s)', TextHelper::useBytesUnits($maxBytes)); + { + throw new SimpleException( + 'File is too big (maximum size: %s)', + TextHelper::useBytesUnits($maxBytes)); + } } } finally diff --git a/src/Views/auth-login.phtml b/src/Views/auth-login.phtml index cb827168..45dd31ef 100644 --- a/src/Views/auth-login.phtml +++ b/src/Views/auth-login.phtml @@ -3,7 +3,12 @@ Assets::setSubTitle('authentication form'); Assets::addStylesheet('auth.css'); ?> -