Passed
Push — master ( 800de6...ff9dd6 )
by Jean Paul
08:33
created

JavaTransformerArgument::getMixedKey()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
namespace Coco\SourceWatcher\Core\Transformers;
4
5
use Coco\SourceWatcher\Core\SourceWatcherException;
6
7
class JavaTransformerArgument
8
{
9
    private string $type;
10
11
    private string $columnValue;
12
    private string $stringValue;
13
    private string $mixedKey;
14
    private string $mixedVal;
15
16
    /**
17
     * JavaTransformerArgument constructor.
18
     *
19
     * @param array $options
20
     * @throws SourceWatcherException
21
     */
22
    public function __construct ( array $options )
23
    {
24
        switch ( $options["type"] ) {
25
            case JavaTransformerArgumentType::ARG_TYPE_COLUMN:
26
                $this->columnValue = $options["columnValue"];
27
                break;
28
            case JavaTransformerArgumentType::ARG_TYPE_STRING:
29
                $this->stringValue = $options["stringValue"];
30
                break;
31
            case JavaTransformerArgumentType::ARG_TYPE_MIXED:
32
                $this->mixedKey = $options["mixedKey"];
33
                $this->mixedVal = $options["mixedVal"];
34
                break;
35
            default:
36
                throw new SourceWatcherException( "Type not supported" );
37
        }
38
39
        $this->type = $options["type"];
40
    }
41
42
    /**
43
     * @return mixed|string
44
     */
45
    public function getType () : string
46
    {
47
        return $this->type;
48
    }
49
50
    /**
51
     * @return mixed|string
52
     */
53
    public function getColumnValue () : string
54
    {
55
        return $this->columnValue;
56
    }
57
58
    /**
59
     * @return mixed|string
60
     */
61
    public function getStringValue () : string
62
    {
63
        return $this->stringValue;
64
    }
65
66
    /**
67
     * @return mixed|string
68
     */
69
    public function getMixedKey () : string
70
    {
71
        return $this->mixedKey;
72
    }
73
74
    /**
75
     * @return mixed|string
76
     */
77
    public function getMixedVal () : string
78
    {
79
        return $this->mixedVal;
80
    }
81
}
82