GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

SelectQueryBuilder   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 83
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 6
c 0
b 0
f 0
lcom 1
cbo 1
dl 0
loc 83
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A top() 0 6 1
A all() 0 5 1
A columns() 0 6 1
A from() 0 6 1
A innerJoin() 0 7 1
1
<?php declare (strict_types=1);
2
/**
3
 * @license MIT
4
 * @author Samuel Adeshina <[email protected]>
5
 */
6
namespace EmmetBlue\Core\Builder\QueryBuilder;
7
8
/**
9
 * class SelectQueryBuilder.
10
 * Builds an Select query.
11
 *
12
 * {@see QueryBuilder}
13
 *
14
 * @author Samuel Adeshina <[email protected]>
15
 *
16
 * @since 28/05/2016
17
 */
18
class SelectQueryBuilder extends QueryBuilder
19
{
20
    /**
21
     * @var \EmmetBlue\Core\Builder\QueryBuilder
22
     */
23
    protected $queryBuilder;
24
25
    /**
26
     * @param string|null $tableName
0 ignored issues
show
Bug introduced by
There is no parameter named $tableName. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
27
     */
28
    public function __construct()
29
    {
30
        $SelectKeyword = "SELECT";
31
        $this->queryBuilder = $this->build($SelectKeyword);
0 ignored issues
show
Documentation Bug introduced by
It seems like $this->build($SelectKeyword) of type object<EmmetBlue\Core\Bu...ryBuilder\QueryBuilder> is incompatible with the declared type object<EmmetBlue\Core\Builder\QueryBuilder> of property $queryBuilder.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
32
    }
33
34
    /**
35
     * {@inheritdoc}
36
     *
37
     * @param int $topValue
38
     *
39
     * @return \EmmetBlue\Core\Builder\SelectQueryBuilder
40
     */
41
    public function top(int $topValue)
42
    {
43
        $this->queryBuilder = $this->queryBuilder->build("TOP ".$topValue);
44
45
        return $this;
46
    }
47
    /**
48
    * This method handles situations that requires to
49
    * select all from the table.
50
    * @param *
51
    */
52
    public function all()
53
    {
54
        $this->queryBuilder = $this->queryBuilder->build("*");
55
        return $this;
56
    }
57
    /**
58
     * {@inheritdoc}
59
     *
60
     * @param string $columns
61
     *
62
     * @return \EmmetBlue\Core\Builder\SelectQueryBuilder
63
     */
64
    public function columns(string ...$columns)
65
    {
66
        $this->queryBuilder = $this->queryBuilder->build(self::getImplodedString($columns));
67
68
        return $this;
69
    }
70
71
     /**
72
     * {@inheritdoc}
73
     *
74
     * @param string $tableName
75
     *
76
     * @return \EmmetBlue\Core\Builder\SelectQueryBuilder
77
     */
78
    public function from(string $tableName)
79
    {
80
        $this->queryBuilder = $this->queryBuilder->build("FROM ".$tableName);
81
82
        return $this;
83
    }
84
85
    /**
86
     * {@inheritdoc}
87
     *
88
     * @param string $tableName
89
     * @param string $condition
90
     *
91
     * @return \EmmetBlue\Core\Builder\SelectQueryBuilder
92
     */
93
    public function innerJoin(string $tableName, string $condition)
94
    {
95
        $string = "INNER JOIN ".$tableName." ON ".$condition;
96
        $this->queryBuilder = $this->queryBuilder->build($string);
97
98
        return $this;
99
    }
100
}
101