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

WriterOptions   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 92.86%

Importance

Changes 2
Bugs 0 Features 2
Metric Value
wmc 6
c 2
b 0
f 2
lcom 0
cbo 0
dl 0
loc 29
ccs 13
cts 14
cp 0.9286
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __set() 0 12 3
A __get() 0 10 3
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