Completed
Push — symfony-console-application ( 3187e2...c3ee2a )
by Luis
10:39
created

plGraphvizProcessorOptions::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 1
eloc 9
nc 1
nop 0
dl 0
loc 12
rs 9.4285
c 2
b 0
f 0
1
<?php
2
3
use PhUml\Graphviz\HtmlLabelStyle;
4
5
class plGraphvizProcessorOptions extends plProcessorOptions
6
{
7
    public function __construct()
8
    {
9
        $this->properties = [
10
            'style' => [
11
                'data' => new HtmlLabelStyle(),
12
                'type' => self::STRING,
13
                'description' => 'Style to use for the dot creation'
14
            ],
15
            'createAssociations' => [
16
                'data' => true,
17
                'type' => self::BOOL,
18
                'description' => 'Create connections between classes that include each other. (This information can only be extracted if it is present in docblock comments)'
19
            ],
20
        ];
21
    }
22
23
    public function __set($key, $val)
24
    {
25
        switch ($key) {
26
            case 'style':
27
                $this->properties[$key]['data'] = HtmlLabelStyle::factory((string)$val);
0 ignored issues
show
Bug introduced by
The method factory() does not exist on PhUml\Graphviz\HtmlLabelStyle. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

27
                /** @scrutinizer ignore-call */ 
28
                $this->properties[$key]['data'] = HtmlLabelStyle::factory((string)$val);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
28
                break;
29
            case 'createAssociations':
30
                $this->properties[$key]['data'] = ($val === '0' || $val === 'false') ? false : true;
31
                break;
32
            default:
33
                throw new plProcessorOptionException($key, plProcessorOptionException::WRITE);
34
        }
35
36
    }
37
}
38