Passed
Push — develop ( 37402c...c02995 )
by Septianata
07:07
created

QueryScope   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 2
c 1
b 0
f 0
dl 0
loc 12
ccs 0
cts 2
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A scopeWhereIsVisible() 0 3 1
1
<?php
2
3
namespace App\Models\Concerns\Denomination;
4
5
use Illuminate\Database\Eloquent\Builder;
6
7
/**
8
 * @method static \Illuminate\Database\Eloquent\Builder|static whereIsVisible(bool $visible = true)
9
 *
10
 * @see \App\Models\Denomination
11
 * @see \Illuminate\Database\Eloquent\Builder @callScope()
12
 */
13
trait QueryScope
14
{
15
    /**
16
     * Scope a query to find where has specified denomination.
17
     *
18
     * @param  \Illuminate\Database\Eloquent\Builder  $query
19
     * @param  bool  $visible
20
     * @return \Illuminate\Database\Eloquent\Builder
21
     */
22
    public function scopeWhereIsVisible(Builder $query, bool $visible = true)
23
    {
24
        return $query->where('is_visible', $visible);
25
    }
26
}
27