Passed
Pull Request — master (#12)
by Bas
02:32
created

NormalizesFunctions::normalizeNumbers()   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 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 4
c 1
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
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 NormalizesGeoFunctions;
17
    use NormalizesMiscellaneousFunctions;
18
    use NormalizesNumericFunctions;
19
20 1
    protected function normalizeArrays(QueryBuilder $queryBuilder)
21
    {
22 1
        foreach ($this->parameters as $key => $parameter) {
23 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...
24 1
                $parameter,
25 1
                ['List', 'Query', 'Variable', 'Reference', 'Bind']
26
            );
27
        }
28 1
    }
29
30 6
    protected function normalizeNumbers(QueryBuilder $queryBuilder)
31
    {
32 6
        foreach ($this->parameters as $key => $parameter) {
33 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...
34 6
                $parameter,
35 6
                ['Number', 'Function', 'Query', 'Reference', 'Bind']
36
            );
37
        }
38 6
    }
39
40
    protected function normalizeStrings(QueryBuilder $queryBuilder)
41
    {
42
        foreach ($this->parameters as $key => $parameter) {
43
            $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...
44
                $parameter,
45
                ['Query', 'Variable', 'Reference', 'Bind']
46
            );
47
        }
48
    }
49
}
50