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

CodeParserConfiguration::extractAssociations()   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 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