Code Duplication    Length = 10-10 lines in 2 locations

app/Http/ApiControllers/RepliesController.php 1 location

@@ 76-85 (lines=10) @@
73
     *
74
     * @return \Illuminate\Http\Response
75
     */
76
    public function store(Request $request)
77
    {
78
        try {
79
            $reply = $this->replies->store($request->all());
80
81
            return $this->response()->item($reply, new ReplyTransformer());
82
        } catch (ValidatorException $e) {
83
            throw new StoreResourceFailedException('Could not create new topic.', $e->getMessageBag()->all());
84
        }
85
    }
86
87
    /**
88
     * 更新回复.

app/Http/ApiControllers/TopicsController.php 1 location

@@ 114-123 (lines=10) @@
111
     *
112
     * @return \Illuminate\Http\Response
113
     */
114
    public function store(Request $request)
115
    {
116
        try {
117
            $topic = $this->topics->create($request->all());
118
119
            return $this->response()->item($topic, new TopicTransformer());
120
        } catch (ValidatorException $e) {
121
            throw new StoreResourceFailedException('Could not create new topic.', $e->getMessageBag()->all());
122
        }
123
    }
124
125
    /**
126
     * 获取指定帖子的详细.