Completed
Pull Request — master (#11)
by
unknown
05:00
created

WriterOptions::__get()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 3.0416

Importance

Changes 2
Bugs 0 Features 2
Metric Value
c 2
b 0
f 2
dl 0
loc 10
ccs 5
cts 6
cp 0.8333
rs 9.4285
cc 3
eloc 6
nc 3
nop 1
crap 3.0416
1
<?php
2
3
namespace Flagbit\Plantuml\TokenReflection;
4
5
class WriterOptions
6
{
7
    private $withoutFunctionParameter = false;
8
    private $maxLineLength = null;
9
10 3
    public function __set($optionName, $value)
11
    {
12
        switch($optionName)
13
        {
14 3
            case 'withoutFunctionParameter':
15 2
                $this->withoutFunctionParameter = (bool) $value;
16 2
                break;
17 1
            case 'maxLineLength':
18 1
                $this->maxLineLength = (int) $value;
19 1
                break;
20
        }
21 3
    }
22
23 11
    public function __get($optionName)
24
    {
25
        switch($optionName)
26
        {
27 11
            case 'withoutFunctionParameter':
28 8
                return $this->withoutFunctionParameter;
29 4
            case 'maxLineLength':
30 4
                return $this->maxLineLength;
31
        }
32
    }
33
}
34