Completed
Push — master ( 51084e...d852c9 )
by Yaro
07:57
created

Orderable   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A orderable() 0 7 1
A isOrderable() 0 4 1
A getOverridedOrderCallback() 0 4 1
1
<?php
2
3
namespace Yaro\Jarboe\Table\Fields\Traits;
4
5
use Closure;
6
7
trait Orderable
8
{
9
    protected $orderable = false;
10
    protected $overridedOrderCallback;
11
12 22
    public function orderable(bool $orderable = true, Closure $overridedOrderCallback = null)
13
    {
14 22
        $this->orderable = $orderable;
15 22
        $this->overridedOrderCallback = $overridedOrderCallback;
16
17 22
        return $this;
18
    }
19
20 33
    public function isOrderable()
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
21
    {
22 33
        return $this->orderable;
23
    }
24
25 22
    public function getOverridedOrderCallback()
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
26
    {
27 22
        return $this->overridedOrderCallback;
28
    }
29
}
30