Passed
Branch next (ee2197)
by Bas
02:37
created

NormalizesFunctions::normalizeAny()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2

Importance

Changes 0
Metric Value
cc 2
eloc 4
c 0
b 0
f 0
nc 2
nop 1
dl 0
loc 6
ccs 5
cts 5
cp 1
crap 2
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace LaravelFreelancerNL\FluentAQL\Traits;
6
7
use LaravelFreelancerNL\FluentAQL\QueryBuilder;
8
9
/**
10
 * Trait hasFunctions.
11
 *
12
 * AQL Function API calls.
13
 */
14
trait NormalizesFunctions
15
{
16
    use NormalizesArangoSearchFunctions;
17
    use NormalizesArrayFunctions;
18
    use NormalizesDateFunctions;
19
    use NormalizesDocumentFunctions;
20
    use NormalizesGeoFunctions;
21
    use NormalizesMiscellaneousFunctions;
22
    use NormalizesNumericFunctions;
23
    use NormalizesStringFunctions;
24
    use NormalizesTypeFunctions;
25
26 1
    protected function normalizeAny(QueryBuilder $queryBuilder): void
27
    {
28 1
        foreach ($this->parameters as $key => $parameter) {
29 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...
30 1
                $parameter,
31 1
                ['Object', 'List', 'Null', 'Number', 'Boolean', 'List', 'Query', 'Reference', 'Bind']
32
            );
33
        }
34 1
    }
35
36 1
    protected function normalizeArrays(QueryBuilder $queryBuilder): void
37
    {
38 1
        foreach ($this->parameters as $key => $parameter) {
39 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...
40 1
                $parameter,
41 1
                ['List', 'Query', 'Variable', 'Reference', 'Bind']
42
            );
43
        }
44 1
    }
45
46 2
    protected function normalizeDocuments(QueryBuilder $queryBuilder): void
47
    {
48 2
        foreach ($this->parameters as $key => $parameter) {
49 2
            $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...
50 2
                $parameter,
51 2
                ['Object', 'Query', 'Variable', 'Reference', 'Bind']
52
            );
53
        }
54 2
    }
55
56
57 6
    protected function normalizeNumbers(QueryBuilder $queryBuilder): void
58
    {
59 6
        foreach ($this->parameters as $key => $parameter) {
60 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...
61 6
                $parameter,
62 6
                ['Number', 'Function', 'Query', 'Reference', 'Bind']
63
            );
64
        }
65 6
    }
66
67 6
    protected function normalizeStrings(QueryBuilder $queryBuilder): void
68
    {
69 6
        foreach ($this->parameters as $key => $parameter) {
70 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...
71 6
                $parameter,
72 6
                ['Query', 'Reference', 'Bind']
73
            );
74
        }
75 6
    }
76
}
77