ErrorController::index()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 17
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 2
eloc 9
c 1
b 0
f 1
nc 2
nop 1
dl 0
loc 17
rs 9.9666
1
<?php namespace App\Http\Controllers\Backend;
2
3
use App\Http\Controllers\Controller;
4
5
use Hideyo\Ecommerce\Framework\Services\Exception\ExceptionFacade as ExceptionService;
0 ignored issues
show
Bug introduced by
The type Hideyo\Ecommerce\Framewo...ception\ExceptionFacade was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
7
use Illuminate\Http\Request;
8
9
class ErrorController extends Controller
10
{
11
12
    public function index(Request $request)
13
    {
14
        if ($request->wantsJson()) {
15
16
            $query = ExceptionService::getModel();
17
            
18
            $datatables = \DataTables::of($query)->addColumn('action', function ($query) {
19
                $deleteLink = \Form::deleteajax('/admin/general-setting/'. $query->id, 'Delete', '', array('class'=>'btn btn-default btn-sm btn-danger'));
20
                $links = '<a href="/admin/general-setting/'.$query->id.'/edit" class="btn btn-default btn-sm btn-success"><i class="entypo-pencil"></i>Edit</a>  '.$deleteLink;
21
            
22
                return $links;
23
            });
24
25
            return $datatables->make(true);
26
27
        } else {
28
            return view('backend.error.index')->with('error', ExceptionService::selectAll());
29
        }
30
    }
31
}
32