OrderBy::orderBy()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1
Metric Value
dl 0
loc 6
ccs 3
cts 3
cp 1
rs 9.4286
cc 1
eloc 3
nc 1
nop 2
crap 1
1
<?php
2
3
namespace Muffin\Queries\Snippets\Builders;
4
5
use Muffin\Queries\Snippets;
6
7
trait OrderBy
8
{
9
    protected
10
        $orderBy;
11
12 4
    public function orderBy($column, $directrion = Snippets\OrderBy::ASC)
0 ignored issues
show
Best Practice introduced by
Using PHP4-style constructors that are named like the class is not recommend; better use the more explicit __construct method.
Loading history...
13
    {
14 4
        $this->orderBy->addOrderBy($column, $directrion);
15
16 4
        return $this;
17
    }
18
19 30
    private function buildOrderBy()
20
    {
21 30
        return $this->orderBy->toString();
22
    }
23
}
24