ExpressionType::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1
1
<?php
2
/**
3
 * @category    Brownie/BpmOnline
4
 * @author      Brownie <[email protected]>
5
 * @license     https://opensource.org/licenses/MIT
6
 */
7
8
namespace Brownie\BpmOnline\DataService\Column\Expression;
9
10
use Brownie\BpmOnline\DataService\Column\Expression;
11
12
/**
13
 * The type of expression that determines the value that will be contained in the added column.
14
 */
15
class ExpressionType extends Expression
16
{
17
18
    /**
19
     * Scheme column.
20
     */
21
    const SCHEMA_COLUMN = 0;
22
23
    /**
24
     * Function.
25
     */
26
    const FUNCTION = 1;
27
28
    /**
29
     * Parameter.
30
     */
31
    const PARAMETER = 2;
32
33
    /**
34
     * Subquery.
35
     */
36
    const SUB_QUERY = 3;
37
38
    /**
39
     * Arithmetic operation.
40
     */
41
    const ARITHMETIC_OPERATION = 4;
42
43
    /**
44
     * Key depending on the ExpressionType property.
45
     *
46
     * @var string
47
     */
48
    protected $keyName = 'ExpressionType';
49
50
    /**
51
     * List of supported fields.
52
     *
53
     * @var array
54
     */
55
    protected $fields = [
56
        'value' => self::PARAMETER,
57
    ];
58
59
    /**
60
     * Sets the input values.
61
     *
62
     * @param string $value Expression type.
63
     */
64 3
    public function __construct($value)
65
    {
66 3
        parent::__construct([
67 3
            'value' => $value
68
        ]);
69 3
    }
70
}
71