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

QueryScope::scopeWhereIsVisible()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
ccs 0
cts 2
cp 0
rs 10
cc 1
nc 1
nop 2
crap 2
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