1
|
|
|
<?php declare(strict_types=1); |
2
|
|
|
/** |
3
|
|
|
* This source file is subject to the license that is bundled with this package in the file LICENSE. |
4
|
|
|
*/ |
5
|
|
|
|
6
|
|
|
namespace PhUml\Parser; |
7
|
|
|
|
8
|
|
|
use Webmozart\Assert\Assert; |
|
|
|
|
9
|
|
|
|
10
|
|
|
final class CodeParserConfiguration |
11
|
|
|
{ |
12
|
|
|
/** @var string */ |
13
|
|
|
private const ASSOCIATIONS = 'associations'; |
14
|
|
|
|
15
|
|
|
/** @var string */ |
16
|
|
|
private const HIDE_PRIVATE = 'hide-private'; |
17
|
|
|
|
18
|
|
|
/** @var string */ |
19
|
|
|
private const HIDE_PROTECTED = 'hide-protected'; |
20
|
|
|
|
21
|
|
|
/** @var string */ |
22
|
|
|
private const HIDE_PROPERTIES = 'hide-attributes'; |
23
|
|
|
|
24
|
|
|
/** @var string */ |
25
|
|
|
private const HIDE_METHODS = 'hide-methods'; |
26
|
|
|
|
27
|
|
|
private readonly bool $extractAssociations; |
28
|
|
|
|
29
|
|
|
private readonly bool $hideProtected; |
30
|
|
|
|
31
|
|
|
private readonly bool $hidePrivate; |
32
|
|
|
|
33
|
|
|
private readonly bool $hideAttributes; |
34
|
|
|
|
35
|
|
|
private readonly bool $hideMethods; |
36
|
|
|
|
37
|
5 |
|
public static function defaultConfiguration(): CodeParserConfiguration |
38
|
|
|
{ |
39
|
5 |
|
return new CodeParserConfiguration([ |
40
|
|
|
self::ASSOCIATIONS => false, |
41
|
|
|
self::HIDE_PRIVATE => false, |
42
|
|
|
self::HIDE_PROTECTED => false, |
43
|
|
|
self::HIDE_PROPERTIES => false, |
44
|
|
|
self::HIDE_METHODS => false, |
45
|
|
|
]); |
46
|
|
|
} |
47
|
|
|
|
48
|
|
|
/** @param mixed[] $options */ |
49
|
43 |
|
public function __construct(array $options) |
50
|
|
|
{ |
51
|
43 |
|
Assert::boolean($options[self::ASSOCIATIONS], 'Extract associations option must be a boolean value'); |
52
|
42 |
|
$this->extractAssociations = $options[self::ASSOCIATIONS]; |
|
|
|
|
53
|
42 |
|
Assert::boolean($options[self::HIDE_PRIVATE], 'Hide private members option must be a boolean value'); |
54
|
41 |
|
$this->hidePrivate = $options[self::HIDE_PRIVATE]; |
|
|
|
|
55
|
41 |
|
Assert::boolean($options[self::HIDE_PROTECTED], 'Hide protected members option must be a boolean value'); |
56
|
40 |
|
$this->hideProtected = $options[self::HIDE_PROTECTED]; |
|
|
|
|
57
|
40 |
|
Assert::boolean($options[self::HIDE_PROPERTIES], 'Hide attributes option must be a boolean value'); |
58
|
39 |
|
$this->hideAttributes = $options[self::HIDE_PROPERTIES]; |
|
|
|
|
59
|
39 |
|
Assert::boolean($options[self::HIDE_METHODS], 'Hide methods option must be a boolean value'); |
60
|
38 |
|
$this->hideMethods = $options[self::HIDE_METHODS]; |
|
|
|
|
61
|
|
|
} |
62
|
|
|
|
63
|
31 |
|
public function extractAssociations(): bool |
64
|
|
|
{ |
65
|
31 |
|
return $this->extractAssociations; |
66
|
|
|
} |
67
|
|
|
|
68
|
38 |
|
public function hidePrivate(): bool |
69
|
|
|
{ |
70
|
38 |
|
return $this->hidePrivate; |
71
|
|
|
} |
72
|
|
|
|
73
|
38 |
|
public function hideProtected(): bool |
74
|
|
|
{ |
75
|
38 |
|
return $this->hideProtected; |
76
|
|
|
} |
77
|
|
|
|
78
|
38 |
|
public function hideAttributes(): bool |
79
|
|
|
{ |
80
|
38 |
|
return $this->hideAttributes; |
81
|
|
|
} |
82
|
|
|
|
83
|
38 |
|
public function hideMethods(): bool |
84
|
|
|
{ |
85
|
38 |
|
return $this->hideMethods; |
86
|
|
|
} |
87
|
|
|
} |
88
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths