Completed
Push — master ( 8e8eee...0073f8 )
by wen
12:40
created

Scopes   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 19
c 0
b 0
f 0
wmc 3
lcom 0
cbo 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A add() 0 9 2
A apply() 0 6 1
1
<?php
2
3
namespace Sco\Admin\View\Extensions;
4
5
use Illuminate\Database\Eloquent\Builder;
6
7
class Scopes extends Extension
8
{
9
    public function add($value)
10
    {
11
        if (!is_array($value)) {
12
            $value = func_get_args();
13
        }
14
15
        $this->push($value);
16
        return $this;
17
    }
18
19
    public function apply(Builder $query)
20
    {
21
        $this->each(function ($scope) use ($query) {
0 ignored issues
show
Unused Code introduced by
The parameter $scope is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
22
23
        });
24
    }
25
}
26