Passed
Push — next ( 142d58...5325de )
by Bas
10:59
created

BindExpression::getBindVariable()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace LaravelFreelancerNL\FluentAQL\Expressions;
6
7
use LaravelFreelancerNL\FluentAQL\QueryBuilder;
8
9
/**
10
 * AQL literal expression.
11
 */
12
class BindExpression extends LiteralExpression implements ExpressionInterface
13
{
14
    protected string $bindVariable;
15
16
    protected mixed $data = null;
17
18 2
    public function __construct(string $bindVariable, mixed $data = null)
19
    {
20 2
        $this->bindVariable = $bindVariable;
21
22 2
        $this->data = $data;
23 2
    }
24
25
    /**
26
     * Compile expression output.
27
     *
28
     * @param QueryBuilder $queryBuilder
29
     * @return string
30
     */
31 2
    public function compile(QueryBuilder $queryBuilder): string
32
    {
33 2
        return $this->bindVariable;
34
    }
35
36 1
    public function getBindVariable(): string
37
    {
38 1
        return $this->bindVariable;
39
    }
40
41
    public function getData(): mixed
42
    {
43
        return $this->data;
44
    }
45
}
46