Passed
Push — 5.0 ( d46d5f )
by Luis
39s queued 12s
created

CodeParserConfiguration   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 16
c 1
b 0
f 0
dl 0
loc 45
rs 10
wmc 6

6 Methods

Rating   Name   Duplication   Size   Complexity  
A extractAssociations() 0 3 1
A __construct() 0 7 1
A hideAttributes() 0 3 1
A hidePrivate() 0 3 1
A hideMethods() 0 3 1
A hideProtected() 0 3 1
1
<?php declare(strict_types=1);
2
/**
3
 * PHP version 8.0
4
 *
5
 * This source file is subject to the license that is bundled with this package in the file LICENSE.
6
 */
7
8
namespace PhUml\Parser;
9
10
final class CodeParserConfiguration
11
{
12
    private bool $extractAssociations;
13
14
    private bool $hideProtected;
15
16
    private bool $hidePrivate;
17
18
    private bool $hideAttributes;
19
20
    private bool $hideMethods;
21
22
    /** @param mixed[] $options */
23
    public function __construct(array $options)
24
    {
25
        $this->extractAssociations = (bool) ($options['associations'] ?? false);
26
        $this->hidePrivate = (bool) ($options['hide-private'] ?? false);
27
        $this->hideProtected = (bool) ($options['hide-protected'] ?? false);
28
        $this->hideAttributes = (bool) ($options['hide-attributes'] ?? false);
29
        $this->hideMethods = (bool) ($options['hide-methods'] ?? false);
30
    }
31
32
    public function extractAssociations(): bool
33
    {
34
        return $this->extractAssociations;
35
    }
36
37
    public function hidePrivate(): bool
38
    {
39
        return $this->hidePrivate;
40
    }
41
42
    public function hideProtected(): bool
43
    {
44
        return $this->hideProtected;
45
    }
46
47
    public function hideAttributes(): bool
48
    {
49
        return $this->hideAttributes;
50
    }
51
52
    public function hideMethods(): bool
53
    {
54
        return $this->hideMethods;
55
    }
56
}
57