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 PhUml\Parser\Code\PhpCodeParser; |
||
9 | use Symfony\Component\Finder\Finder; |
||
0 ignored issues
–
show
|
|||
10 | |||
11 | /** |
||
12 | * It inspects a directory finding all the files with PHP code and saves their contents |
||
13 | * |
||
14 | * This finder inspect inner directories recursively. |
||
15 | * The contents of the files are used by the `PhpParser` to build a `Codebase` |
||
16 | * |
||
17 | * @see PhpCodeParser::parse() |
||
18 | */ |
||
19 | final class SourceCodeFinder implements CodeFinder |
||
20 | { |
||
21 | 30 | public static function fromConfiguration(CodeFinderConfiguration $configuration): SourceCodeFinder |
|
22 | { |
||
23 | 30 | $finder = new Finder(); |
|
24 | 30 | if (! $configuration->recursive()) { |
|
25 | 18 | $finder->depth(0); |
|
26 | } |
||
27 | 30 | return new self($finder); |
|
28 | } |
||
29 | |||
30 | 30 | private function __construct(private readonly Finder $finder) |
|
31 | { |
||
32 | } |
||
33 | |||
34 | 26 | public function find(CodebaseDirectory $directory): SourceCode |
|
35 | { |
||
36 | 26 | $sourceCode = new SourceCode(); |
|
37 | 26 | $this->finder->in($directory->absolutePath())->files()->name('*.php')->sortByName(); |
|
38 | 26 | foreach ($this->finder as $file) { |
|
39 | 25 | $sourceCode->add($file->getContents()); |
|
40 | } |
||
41 | 26 | return $sourceCode; |
|
42 | } |
||
43 | } |
||
44 |
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