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

PluginRepository::allWhereDisabled()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: Mark
5
 * Date: 05/03/2016
6
 * Time: 17:16.
7
 */
8
9
namespace App\Classes\Repositories;
10
11
use App\Model\Plugin;
12
use Illuminate\Support\Collection;
13
use Illuminate\Database\Eloquent\Model;
14
use Illuminate\Database\Eloquent\Builder;
15
16
/**
17
 * Class PluginRepository.
18
 */
19
class PluginRepository extends BaseRepository
20
{
21
    /**
22
     * @var Plugin|Builder|Collection
23
     */
24
    protected $model;
25
26
    /**
27
     * PageRepository constructor.
28
     *
29
     * @param Plugin $model
30
     */
31
    public function __construct(Plugin $model)
32
    {
33
        $this->model = $model;
34
    }
35
36
    /**
37
     * @return mixed
38
     */
39
    public function allWhereActive() : Collection
40
    {
41
        return $this->model->where('enabled', true)->get();
0 ignored issues
show
Bug introduced by
The call to Illuminate\Support\Collection::get() has too few arguments starting with key. ( Ignorable by Annotation )

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

41
        return $this->model->where('enabled', true)->/** @scrutinizer ignore-call */ get();

This check compares calls to functions or methods with their respective definitions. If the call has less arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.

Loading history...
42
    }
43
44
    /**
45
     * @return mixed
46
     */
47
    public function allWhereViewable() : Collection
48
    {
49
        return $this->model->where('enabled', true)->whereNull('hidden')->get();
0 ignored issues
show
Bug introduced by
The call to Illuminate\Support\Collection::get() has too few arguments starting with key. ( Ignorable by Annotation )

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

49
        return $this->model->where('enabled', true)->whereNull('hidden')->/** @scrutinizer ignore-call */ get();

This check compares calls to functions or methods with their respective definitions. If the call has less arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.

Loading history...
50
    }
51
52
    /**
53
     * @return mixed
54
     */
55
    public function allWhereDisabled() : Collection
56
    {
57
        return $this->model->where('enabled', false)->get();
0 ignored issues
show
Bug introduced by
The call to Illuminate\Support\Collection::get() has too few arguments starting with key. ( Ignorable by Annotation )

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

57
        return $this->model->where('enabled', false)->/** @scrutinizer ignore-call */ get();

This check compares calls to functions or methods with their respective definitions. If the call has less arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.

Loading history...
58
    }
59
60
    /**
61
     * Return the model based on the input name.
62
     *
63
     * @param $plugin_name
64
     * @return Plugin|array|\stdClass
65
     */
66
    public function whereName($plugin_name)
67
    {
68
        return $this->model->where('name', $plugin_name)->first();
69
    }
70
}
71