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

HistoryController   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A index() 0 5 1
A show() 0 6 1
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