Passed
Push — dev ( c55b95...34fb50 )
by Darko
06:54
created

AdminPredbController   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 17
dl 0
loc 32
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A index() 0 25 2
1
<?php
2
3
namespace App\Http\Controllers\Admin;
4
5
use App\Http\Controllers\BasePageController;
6
use App\Models\Predb;
7
use Illuminate\Http\Request;
8
9
class AdminPredbController extends BasePageController
10
{
11
    /**
12
     * @param \Illuminate\Http\Request $request
13
     *
14
     * @throws \Exception
15
     */
16
    public function index(Request $request)
17
    {
18
        $this->setAdminPrefs();
19
20
        if ($request->has('presearch')) {
21
            $lastSearch = $request->input('presearch');
22
            $parr = Predb::getAll($request->input('presearch'));
23
        } else {
24
            $lastSearch = '';
25
            $parr = Predb::getAll();
26
        }
27
28
        $this->smarty->assign('lastSearch', $lastSearch);
0 ignored issues
show
Bug introduced by
The method assign() does not exist on Illuminate\Foundation\Application. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

28
        $this->smarty->/** @scrutinizer ignore-call */ 
29
                       assign('lastSearch', $lastSearch);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
29
30
        $this->smarty->assign('results', $parr);
31
32
        $title = 'Browse PreDb';
33
        $meta_title = 'View PreDb info';
34
        $meta_keywords = 'view,predb,info,description,details';
35
        $meta_description = 'View PreDb info';
36
37
        $content = $this->smarty->fetch('predb.tpl');
0 ignored issues
show
Bug introduced by
The method fetch() does not exist on Illuminate\Foundation\Application. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

37
        /** @scrutinizer ignore-call */ 
38
        $content = $this->smarty->fetch('predb.tpl');

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
38
        $this->smarty->assign(compact('title', 'content', 'meta_title', 'meta_keywords', 'meta_description'));
39
40
        $this->adminrender();
41
    }
42
}
43