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

NormalizesFunctions   A

Complexity

Total Complexity 10

Size/Duplication

Total Lines 59
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 30
c 1
b 0
f 0
dl 0
loc 59
ccs 29
cts 29
cp 1
rs 10
wmc 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A normalizeNumbers() 0 6 2
A normalizeAny() 0 6 2
A normalizeStrings() 0 6 2
A normalizeArrays() 0 6 2
A normalizeDocuments() 0 6 2
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