Completed
Push — master ( 2da229...6c27e6 )
by Hamidreza
01:12
created

FileFilters   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 54
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 5
lcom 1
cbo 1
dl 0
loc 54
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A owner_type() 0 4 1
A owner_id() 0 4 1
A creator_id() 0 4 1
A type() 0 4 1
A flag() 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', 'creator_id', 'type', 'flag'];
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
    /**
33
     * @param int $creatorId
34
     * @return mixed
35
     */
36
    protected function creator_id(int $creatorId)
37
    {
38
        return $this->builder->whereCreatorIdIs($creatorId);
39
    }
40
41
    /**
42
     * @param string $type
43
     * @return mixed
44
     */
45
    protected function type(string $type)
46
    {
47
        return $this->builder->whereTypeIs($type);
48
    }
49
50
    /**
51
     * @param string $flag
52
     * @return mixed
53
     */
54
    protected function flag(string $flag)
55
    {
56
        return $this->builder->whereFlagIs($flag);
57
    }
58
}
59