Преглед изворни кода

style: pint 格式化 RelatedParagraphController

纯风格调整,无行为变化:单引号、# 注释改 //、! 后加空格、import 排序、
去掉冗余 phpdoc 类型。单独成一个提交,是为了让下一个功能修复的 diff
只剩它自己那几行,便于 review。
visuddhinanda пре 1 недеља
родитељ
комит
ea13d26d6b
1 измењених фајлова са 12 додато и 14 уклоњено
  1. 12 14
      api-v13/app/Http/Controllers/RelatedParagraphController.php

+ 12 - 14
api-v13/app/Http/Controllers/RelatedParagraphController.php

@@ -1,4 +1,5 @@
 <?php
+
 /*
  *查询相关联的书
  *mula->attakhata->tika
@@ -31,16 +32,17 @@
 
 namespace App\Http\Controllers;
 
+use App\Http\Resources\RelatedParagraphResource;
 use App\Models\RelatedParagraph;
 use Illuminate\Http\Request;
-use App\Http\Resources\RelatedParagraphResource;
+use Illuminate\Http\Response;
 
 class RelatedParagraphController extends Controller
 {
     /**
      * Display a listing of the resource.
      *
-     * @return \Illuminate\Http\Response
+     * @return Response
      */
     public function index(Request $request)
     {
@@ -56,22 +58,22 @@ class RelatedParagraphController extends Controller
             ->get();
         $books = [];
         foreach ($result as $value) {
-            # 把段落整合成书。有几本书就有几条输出纪录
-            if (!isset($books[$value->book_id])) {
+            // 把段落整合成书。有几本书就有几条输出纪录
+            if (! isset($books[$value->book_id])) {
                 $books[$value->book_id]['book'] = $value->book;
                 $books[$value->book_id]['book_id'] = $value->book_id;
                 $books[$value->book_id]['cs6_para'] = $value->cs_para;
             }
             $books[$value->book_id]['para'][] = $value->para;
         }
-        return $this->ok(["rows" => RelatedParagraphResource::collection($books), "count" => count($books)]);
+
+        return $this->ok(['rows' => RelatedParagraphResource::collection($books), 'count' => count($books)]);
     }
 
     /**
      * Store a newly created resource in storage.
      *
-     * @param  \Illuminate\Http\Request  $request
-     * @return \Illuminate\Http\Response
+     * @return Response
      */
     public function store(Request $request)
     {
@@ -81,8 +83,7 @@ class RelatedParagraphController extends Controller
     /**
      * Display the specified resource.
      *
-     * @param  \App\Models\RelatedParagraph  $relatedParagraph
-     * @return \Illuminate\Http\Response
+     * @return Response
      */
     public function show(RelatedParagraph $relatedParagraph)
     {
@@ -92,9 +93,7 @@ class RelatedParagraphController extends Controller
     /**
      * Update the specified resource in storage.
      *
-     * @param  \Illuminate\Http\Request  $request
-     * @param  \App\Models\RelatedParagraph  $relatedParagraph
-     * @return \Illuminate\Http\Response
+     * @return Response
      */
     public function update(Request $request, RelatedParagraph $relatedParagraph)
     {
@@ -104,8 +103,7 @@ class RelatedParagraphController extends Controller
     /**
      * Remove the specified resource from storage.
      *
-     * @param  \App\Models\RelatedParagraph  $relatedParagraph
-     * @return \Illuminate\Http\Response
+     * @return Response
      */
     public function destroy(RelatedParagraph $relatedParagraph)
     {