Apply fixes from StyleCI

This commit is contained in:
StyleCI Bot
2023-01-07 19:48:16 +00:00
parent 774eed8b0e
commit 5055b443fc
235 changed files with 14833 additions and 14446 deletions

View File

@@ -31,13 +31,14 @@ class UserController extends Controller
/**
* @param
*
* @return response
*/
public function getArticle(Article $article, Category $category, Settings $settings)
{
$setting = $settings->first();
$pagination = $setting->pagination;
if (! Auth::check() || \Auth::user()->role == 'user') {
if (!Auth::check() || \Auth::user()->role == 'user') {
$article = $article->where('status', '1');
}
$article = $article->where('type', '1');
@@ -53,9 +54,10 @@ class UserController extends Controller
/**
* Get excerpt from string.
*
* @param string $str String to get an excerpt from
* @param int $startPos Position int string to start excerpt from
* @param int $maxLength Maximum length the excerpt may be
* @param string $str String to get an excerpt from
* @param int $startPos Position int string to start excerpt from
* @param int $maxLength Maximum length the excerpt may be
*
* @return string excerpt
*/
public static function getExcerpt($str, $startPos = 0, $maxLength = 50)
@@ -75,10 +77,11 @@ class UserController extends Controller
/**
* function to search an article.
*
* @param \App\Http\Requests\kb\SearchRequest $request
* @param \App\Model\kb\Category $category
* @param \App\Model\kb\Article $article
* @param \App\Model\kb\Settings $settings
* @param \App\Http\Requests\kb\SearchRequest $request
* @param \App\Model\kb\Category $category
* @param \App\Model\kb\Article $article
* @param \App\Model\kb\Settings $settings
*
* @return type view
*/
public function search(SearchRequest $request, Category $category, Article $article, Settings $settings)
@@ -110,7 +113,7 @@ class UserController extends Controller
$date = \Carbon\Carbon::now()->toDateTimeString();
$arti = $article->where('slug', $slug);
if (! Auth::check() || \Auth::user()->role == 'user') {
if (!Auth::check() || \Auth::user()->role == 'user') {
$arti = $arti->where('status', '1');
$arti = $arti->where('publish_time', '<', $date);
}
@@ -130,7 +133,7 @@ class UserController extends Controller
{
/* get the article_id where category_id == current category */
$catid = $category->where('slug', $slug)->first();
if (! $catid) {
if (!$catid) {
return redirect()->back()->with('fails', Lang::get('lang.we_are_sorry_but_the_page_you_are_looking_for_can_not_be_found'));
}
$id = $catid->id;
@@ -222,12 +225,13 @@ class UserController extends Controller
* @param type Request $request
* @param type Comment $comment
* @param type Id $id
*
* @return type response
*/
public function postComment($slug, Article $article, CommentRequest $request, Comment $comment)
{
$article = $article->where('slug', $slug)->first();
if (! $article) {
if (!$article) {
return Redirect::back()->with('fails', Lang::get('lang.sorry_not_processed'));
}
$id = $article->id;