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

Builder::getModel()   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 0
dl 0
loc 4
rs 10
1
<?php
2
3
namespace Silk\Query;
4
5
use Silk\Type\Model;
0 ignored issues
show
introduced by
Use classes must be in alphabetical order.
Loading history...
6
use Silk\Contracts\BuildsQueries;
7
8
abstract class Builder implements BuildsQueries
9
{
0 ignored issues
show
introduced by
Opening brace of a class must be on the same line as the definition
Loading history...
10
    /**
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
11
     * Set the model for this query.
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
12
     *
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
13
     * @param Model $model
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
introduced by
Model => \Silk\Type\Model
Loading history...
14
     *
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
15
     * @return $this
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
16
     */
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
17
    public function setModel(Model $model)
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
18
    {
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...
19
        $this->model = $model;
0 ignored issues
show
Bug introduced by
The property model does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
introduced by
8 spaces found, expected 2 tabs
Loading history...
20
21
        return $this;
0 ignored issues
show
introduced by
8 spaces found, expected 2 tabs
Loading history...
22
    }
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
23
24
    /**
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
25
     * Get the model
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
26
     *
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
27
     * @return Model
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
introduced by
Model => \Silk\Type\Model
Loading history...
28
     */
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
29
    public function getModel()
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
30
    {
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...
31
        return $this->model;
0 ignored issues
show
introduced by
8 spaces found, expected 2 tabs
Loading history...
32
    }
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
33
}
0 ignored issues
show
introduced by
Closing brace of a class must have a new line between itself and the last content.
Loading history...
34