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

NormalizesFunctions::normalizeDocuments()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
cc 2
eloc 4
c 0
b 0
f 0
nc 2
nop 1
dl 0
loc 6
ccs 0
cts 5
cp 0
crap 6
rs 10
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