Completed
Push — master ( 8249d1...5994b5 )
by Hamidreza
01:39 queued 11s
created

FileFilters   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 1
dl 0
loc 27
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A owner_type() 0 4 1
A owner_id() 0 4 1
1
<?php
2
3
namespace Hamidrezaniazi\Upolo\Filters;
4
5
class FileFilters extends Filters
6
{
7
    /**
8
     * Registered filters to operate upon.
9
     *
10
     * @var array
11
     */
12
    protected $filters = ['owner_type', 'owner_id'];
13
14
    /**
15
     * @param string $ownerType
16
     * @return mixed
17
     */
18
    protected function owner_type(string $ownerType)
19
    {
20
        return $this->builder->whereOwnerTypeIs($ownerType);
21
    }
22
23
    /**
24
     * @param int $ownerId
25
     * @return mixed
26
     */
27
    protected function owner_id(int $ownerId)
28
    {
29
        return $this->builder->whereOwnerIdIs($ownerId);
30
    }
31
}
32