HistoryController   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 3
dl 0
loc 27
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A index() 0 6 1
A show() 0 7 1
1
<?php
2
3
namespace Iferas93\HistoriableModel\Http\Controllers;
4
5
use Iferas93\HistoriableModel\Models\History;
6
7
class HistoryController extends Controller
8
{
9
    /**
10
     * Show History of changes column.
11
     *
12
     * @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\View\View
13
     */
14
    public function index()
15
    {
16
        $changelog = History::query()->orderByDesc('id')->paginate();
17
18
        return view('historiable::index', compact(['changelog']));
19
    }
20
21
    /**
22
     * Show specific item by ID.
23
     * @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...
24
     * @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\View\View
25
     */
26
    public function show($id)
27
    {
28
        //return $id;
29
        $changelogById = History::query()->where('id', $id)->first();
30
31
        return view('historiable::show', compact(['changelogById']));
32
    }
33
}
34