Scrutinizer GitHub App not installed

We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.

Install GitHub App

Completed
Push — master ( 85a862...11240b )
by Mark
02:23
created

MenuRepository::allGlobalMenusWithSubmenus()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: Mark
5
 * Date: 13/03/2016
6
 * Time: 19:52.
7
 */
8
9
namespace App\Classes\Repositories;
10
11
use App\Model\Menu;
12
use Illuminate\Database\Eloquent\SoftDeletes;
13
use Illuminate\Support\Collection;
14
use Illuminate\Database\Eloquent\Builder;
15
16
/**
17
 * Class MenuRepository.
18
 *
19
 * @method Menu withTrashed
20
 */
21
class MenuRepository extends Menu
22
{
23
24
    public function whereID(int $integer) : Menu
25
    {
26
        return $this->where('id', $integer)->first();
27
    }
28
29
    public function restoreTrashedPlugin($plugin_name)
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
30
    {
31
        return $this->withTrashed()->where('slug', $plugin_name)->restore();
32
    }
33
34
    public function allByPriorityOrder()
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
35
    {
36
        return $this->whereNull('menu_id')->orderBy('order_id', 'asc')->get();
37
    }
38
39
    public function allByRowOrder()
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
40
    {
41
        return $this->whereNull('menu_id')->orderBy('order_id', 'asc')->get();
42
    }
43
44
    public function listAllMenusNotRequired()
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
45
    {
46
        return $this->whereNull('required')->pluck('title', 'id');
47
    }
48
49
    public function makeList()
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
50
    {
51
        return $this->pluck('title', 'id');
52
    }
53
54
    public function listWhereInternal()
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
55
    {
56
        return $this->whereNotNull('page_id')->whereNull('menu_id')->pluck('title', 'id');
57
    }
58
59
    public function submenusWhereID($integer)
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
60
    {
61
        return $this->where('menu_id', $integer)->get();
62
    }
63
64
    public function allMenus()
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
65
    {
66
        return $this->whereNull('menu_id')->get();
67
    }
68
69
    public function allMenusWhereID($integer)
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
70
    {
71
        return $this->where('menu_id', $integer)->get();
72
    }
73
74
    public function allSubmenus()
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
75
    {
76
        return $this->whereNotNull('menu_id')->get();
77
    }
78
79
    public function allSubmenusByPriorityOrderAndGrouped()
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
80
    {
81
        return$this->whereNotNull('menu_id')->orderBy('order_id', 'asc')->get()->groupBy('menu_id');
82
    }
83
84
    /**
85
     * @param $string
86
     * @return Menu|array|\stdClass
87
     */
88
    public function whereName($string)
89
    {
90
        return $this->where('slug', $string)->first();
91
    }
92
93
    /**
94
     * This will return the menus in order, that will be displayed in the front end.
95
     */
96
    public function whereFrontEndMenu() : Collection
97
    {
98
        return $this->whereNull('menu_id')->where('enabled', true)->orderBy('order_id', 'asc')->with('submenus')->get();
99
    }
100
101
    /**
102
     * Return a menus set of submenus from the database.
103
     */
104
    public function allSubmenusOfMenuID(int $integer) : Collection
105
    {
106
        return $this->where('menu_id', $integer)->where('enabled', true)->orderBy('order_id', 'asc')->get();
107
    }
108
109
    /**
110
     * Return all the global menus with the submenus and pages.
111
     */
112
    public function allGlobalMenusWithSubmenus()
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
113
    {
114
        return $this->whereNull('menu_id')->where('enabled', true)->with('page')->orderBy('order_id', 'asc')->get();
115
    }
116
}
117