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\Code\Builders; |
7
|
|
|
|
8
|
|
|
use PhpParser\Node\Stmt\Class_; |
|
|
|
|
9
|
|
|
use PhUml\Code\ClassDefinition; |
10
|
|
|
use PhUml\Code\Name; |
11
|
|
|
use PhUml\Parser\Code\Builders\Names\InterfaceNamesBuilder; |
12
|
|
|
use PhUml\Parser\Code\Builders\Names\TraitNamesBuilder; |
13
|
|
|
|
14
|
|
|
/** |
15
|
|
|
* It builds a `ClassDefinition` |
16
|
|
|
* |
17
|
|
|
* @see MembersBuilder |
18
|
|
|
* @see InterfaceNamesBuilder |
19
|
|
|
* @see TraitNamesBuilder |
20
|
|
|
*/ |
21
|
|
|
final class ClassDefinitionBuilder |
22
|
|
|
{ |
23
|
|
|
use InterfaceNamesBuilder; |
24
|
|
|
use TraitNamesBuilder; |
|
|
|
|
25
|
|
|
|
26
|
42 |
|
public function __construct( |
27
|
|
|
private readonly MembersBuilder $membersBuilder, |
28
|
|
|
private readonly UseStatementsBuilder $useStatementsBuilder, |
29
|
|
|
private readonly AttributeAnalyzer $analyzer |
30
|
|
|
) { |
31
|
|
|
} |
32
|
|
|
|
33
|
31 |
|
public function build(Class_ $class): ClassDefinition |
34
|
|
|
{ |
35
|
31 |
|
$useStatements = $this->useStatementsBuilder->build($class); |
36
|
|
|
|
37
|
31 |
|
return new ClassDefinition( |
38
|
31 |
|
new Name((string) $class->namespacedName), |
39
|
31 |
|
$this->membersBuilder->methods($class->getMethods(), $useStatements), |
40
|
31 |
|
$this->membersBuilder->constants($class->stmts), |
41
|
31 |
|
$class->extends !== null ? new Name((string) $class->extends) : null, |
42
|
31 |
|
$this->membersBuilder->properties($class->stmts, $class->getMethod('__construct'), $useStatements), |
43
|
31 |
|
$this->buildInterfaces($class->implements), |
44
|
31 |
|
$this->buildTraits($class->stmts), |
45
|
31 |
|
$this->analyzer->isAttribute($class) |
46
|
|
|
); |
47
|
|
|
} |
48
|
|
|
} |
49
|
|
|
|
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