Completed
Push — master ( 72b995...b71f1c )
by Feras
09:46
created

HistoryController::index()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Iferas93\HistoriableModel\Http\Controllers;
4
5
6
use Iferas93\HistoriableModel\Models\History;
7
use Illuminate\Http\Request;
8
9
class HistoryController extends Controller
10
{
11
12
    /**
13
     * Show History of changes column
14
     *
15
     * @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\View\View
16
     */
17
    public function index()
18
    {
19
        $changelog = History::query()->orderByDesc('id')->paginate();
20
        return view('historiable::index', compact(['changelog']));
21
    }
22
23
    /**
24
     * Show specific item by ID
25
     * @param History $history
0 ignored issues
show
Bug introduced by
There is no parameter named $history. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
26
     * @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\View\View
27
     */
28
    public function show($id)
29
    {
30
        //return $id;
31
        $changelogById = History::query()->where('id', $id)->first();
32
        return view('historiable::show', compact(['changelogById']));
33
    }
34
}
35