We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.
Common duplication problems, and corresponding solutions are:
1 | <?php |
||
5 | trait Update |
||
6 | { |
||
7 | /** |
||
8 | * Show the form for editing the specified resource. |
||
9 | * |
||
10 | * @param int $id |
||
11 | * |
||
12 | * @return Response |
||
|
|||
13 | */ |
||
14 | public function edit($id) |
||
33 | |||
34 | /** |
||
35 | * Update the specified resource in the database. |
||
36 | * |
||
37 | * @param UpdateRequest $request - type injection used for validation using Requests |
||
38 | * |
||
39 | * @return \Illuminate\Http\RedirectResponse |
||
40 | */ |
||
41 | public function updateCrud(UpdateRequest $request = null) |
||
70 | } |
||
71 |
This check compares the return type specified in the
@return
annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.