NormalizesTypeFunctions   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 13
c 2
b 0
f 0
dl 0
loc 33
ccs 16
cts 16
cp 1
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A normalizeToArray() 0 5 1
A normalizeToNumber() 0 5 1
A normalizeToString() 0 5 1
A normalizeToBool() 0 5 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace LaravelFreelancerNL\FluentAQL\Traits;
6
7
use LaravelFreelancerNL\FluentAQL\QueryBuilder;
8
9
trait NormalizesTypeFunctions
10
{
11
    abstract protected function normalizeNumbers(QueryBuilder $queryBuilder);
12
13 2
    protected function normalizeToArray(QueryBuilder $queryBuilder): void
14
    {
15 2
        $this->parameters[0] = $queryBuilder->normalizeArgument(
0 ignored issues
show
Bug Best Practice introduced by
The property parameters does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
16 2
            $this->parameters[0],
17 2
            ['Number', 'Boolean', 'Query', 'Reference', 'Bind']
18
        );
19
    }
20
21 1
    protected function normalizeToBool(QueryBuilder $queryBuilder): void
22
    {
23 1
        $this->parameters[0] = $queryBuilder->normalizeArgument(
0 ignored issues
show
Bug Best Practice introduced by
The property parameters does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
24 1
            $this->parameters[0],
25 1
            ['Number', 'Boolean', 'Query', 'Reference', 'Bind']
26
        );
27
    }
28
29 1
    protected function normalizeToNumber(QueryBuilder $queryBuilder): void
30
    {
31 1
        $this->parameters[0] = $queryBuilder->normalizeArgument(
0 ignored issues
show
Bug Best Practice introduced by
The property parameters does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
32 1
            $this->parameters[0],
33 1
            ['Number', 'Boolean', 'Query', 'Reference', 'Bind']
34
        );
35
    }
36
37 1
    protected function normalizeToString(QueryBuilder $queryBuilder): void
38
    {
39 1
        $this->parameters[0] = $queryBuilder->normalizeArgument(
0 ignored issues
show
Bug Best Practice introduced by
The property parameters does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
40 1
            $this->parameters[0],
41 1
            ['Number', 'Boolean', 'Query', 'Reference', 'Bind']
42
        );
43
    }
44
}
45