Completed
Push — develop ( c52d7e...4c8faa )
by Evan
04:55
created

QueryBuilder::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 4
rs 10
1
<?php
2
3
namespace Silk\User;
4
5
use WP_User_Query;
0 ignored issues
show
introduced by
Use classes must be in alphabetical order.
Loading history...
6
use Silk\Query\Builder as BaseBuilder;
7
use Illuminate\Support\Collection;
8
9
class QueryBuilder extends BaseBuilder
10
{
0 ignored issues
show
introduced by
Opening brace of a class must be on the same line as the definition
Loading history...
11
    /**
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
12
     * The query instance
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
13
     * @var WP_User_Query
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
introduced by
WP_User_Query => \WP_User_Query
Loading history...
14
     */
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
15
    protected $query;
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
Coding Style introduced by
Expected 1 blank line before member var; 0 found
Loading history...
16
17
    /**
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
18
     * QueryBuilder Constructor.
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
19
     *
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
20
     * @param WP_User_Query $query
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
introduced by
WP_User_Query => \WP_User_Query
Loading history...
21
     */
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
22
    public function __construct(WP_User_Query $query)
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
23
    {
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
introduced by
Opening brace of a function must be on the same line as the definition
Loading history...
24
        $this->query = $query;
0 ignored issues
show
introduced by
8 spaces found, expected 2 tabs
Loading history...
25
    }
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
26
27
    /**
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
28
     * Create a new instance.
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
29
     *
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
30
     * @return static
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
31
     */
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
32
    public static function make()
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
33
    {
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
introduced by
Opening brace of a function must be on the same line as the definition
Loading history...
34
        return new static(new WP_User_Query);
0 ignored issues
show
introduced by
8 spaces found, expected 2 tabs
Loading history...
introduced by
Calling class constructors must always include parentheses
Loading history...
35
    }
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
36
37
    /**
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
38
     * Get the query results.
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
39
     *
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
40
     * @return Collection
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
introduced by
Collection => \Illuminate\Support\Collection
Loading history...
41
     */
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
42
    public function results()
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
43
    {
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
introduced by
Opening brace of a function must be on the same line as the definition
Loading history...
44
        return Collection::make($this->query->get_results());
0 ignored issues
show
introduced by
8 spaces found, expected 2 tabs
Loading history...
45
    }
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
46
}
0 ignored issues
show
introduced by
Closing brace of a class must have a new line between itself and the last content.
Loading history...
47