NormalizesFunctions::normalizeStrings()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

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