Passed
Push — master ( cc7610...88ef28 )
by Bas
02:54
created

NormalizesFunctions   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Test Coverage

Coverage 52.17%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 23
c 1
b 0
f 0
dl 0
loc 46
ccs 12
cts 23
cp 0.5217
rs 10
wmc 8

4 Methods

Rating   Name   Duplication   Size   Complexity  
A normalizeNumbers() 0 6 2
A normalizeStrings() 0 6 2
A normalizeArrays() 0 6 2
A normalizeDocuments() 0 6 2
1
<?php
2
3
namespace LaravelFreelancerNL\FluentAQL\Traits;
4
5
use LaravelFreelancerNL\FluentAQL\QueryBuilder;
6
7
/**
8
 * Trait hasFunctions.
9
 *
10
 * AQL Function API calls.
11
 */
12
trait NormalizesFunctions
13
{
14
    use NormalizesArrayFunctions;
15
    use NormalizesDateFunctions;
16
    use NormalizesDocumentFunctions;
17
    use NormalizesGeoFunctions;
18
    use NormalizesMiscellaneousFunctions;
19
    use NormalizesNumericFunctions;
20
21 1
    protected function normalizeArrays(QueryBuilder $queryBuilder)
22
    {
23 1
        foreach ($this->parameters as $key => $parameter) {
24 1
            $this->parameters[$key] = $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...
25 1
                $parameter,
26 1
                ['List', 'Query', 'Variable', 'Reference', 'Bind']
27
            );
28
        }
29 1
    }
30
31
    protected function normalizeDocuments(QueryBuilder $queryBuilder)
32
    {
33
        foreach ($this->parameters as $key => $parameter) {
34
            $this->parameters[$key] = $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...
35
                $parameter,
36
                ['Object', 'Query', 'Variable', 'Reference', 'Bind']
37
            );
38
        }
39
    }
40
41
42 6
    protected function normalizeNumbers(QueryBuilder $queryBuilder)
43
    {
44 6
        foreach ($this->parameters as $key => $parameter) {
45 6
            $this->parameters[$key] = $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...
46 6
                $parameter,
47 6
                ['Number', 'Function', 'Query', 'Reference', 'Bind']
48
            );
49
        }
50 6
    }
51
52
    protected function normalizeStrings(QueryBuilder $queryBuilder)
53
    {
54
        foreach ($this->parameters as $key => $parameter) {
55
            $this->parameters[$key] = $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...
56
                $parameter,
57
                ['Query', 'Variable', 'Reference', 'Bind']
58
            );
59
        }
60
    }
61
}
62