Having   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A having() 0 6 1
A orHaving() 0 6 1
A resetHaving() 0 6 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Sirius\Sql\Clause;
5
6
use Sirius\Sql\Component\Conditions;
7
8
trait Having
9
{
10
    /**
11
     * @var Conditions
12
     */
13
    protected $having;
14
15 1
    public function having(string $condition, ...$bindInline)
16
    {
17 1
        $this->having->andSprintf($condition, ...$bindInline);
18
19 1
        return $this;
20
    }
21
22 1
    public function orHaving(string $condition, ...$bindInline)
23
    {
24 1
        $this->having->orSprintf($condition, ...$bindInline);
25
26 1
        return $this;
27
    }
28
29 17
    public function resetHaving()
30
    {
31 17
        $this->having = new Conditions($this->bindings, 'HAVING');
0 ignored issues
show
Bug introduced by
The property bindings 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...
32
33 17
        return $this;
34
    }
35
}
36