PostTypeScope   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 15
ccs 0
cts 3
cp 0
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A apply() 0 4 1
1
<?php
2
3
namespace CodexShaper\WP\Database\Eloquent\Scopes;
4
5
use Illuminate\Database\Eloquent\Builder;
6
use Illuminate\Database\Eloquent\Model;
7
use Illuminate\Database\Eloquent\Scope;
8
9
class PostTypeScope implements Scope
10
{
11
    /**
12
     * Apply the scope to a given Eloquent query builder.
13
     *
14
     * @param \Illuminate\Database\Eloquent\Builder $builder
15
     * @param \Illuminate\Database\Eloquent\Model   $model
16
     *
17
     * @return void
18
     */
19
    public function apply(Builder $builder, Model $model)
20
    {
21
        $builder->where('post_type', '=', 'post');
22
    }
23
}
24