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 Create |
||
6 | { |
||
7 | /** |
||
8 | * Show the form for creating inserting a new row. |
||
9 | * |
||
10 | * @return Response |
||
|
|||
11 | */ |
||
12 | public function create() |
||
25 | |||
26 | /** |
||
27 | * Store a newly created resource in the database. |
||
28 | * |
||
29 | * @param StoreRequest $request - type injection used for validation using Requests |
||
30 | * |
||
31 | * @return \Illuminate\Http\RedirectResponse |
||
32 | */ |
||
33 | public function storeCrud(StoreRequest $request = null) |
||
61 | } |
||
62 |
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.