1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
/* |
6
|
|
|
* This file is part of the humbug/php-scoper package. |
7
|
|
|
* |
8
|
|
|
* Copyright (c) 2017 Théo FIDRY <[email protected]>, |
9
|
|
|
* Pádraic Brady <[email protected]> |
10
|
|
|
* |
11
|
|
|
* For the full copyright and license information, please view the LICENSE |
12
|
|
|
* file that was distributed with this source code. |
13
|
|
|
*/ |
14
|
|
|
|
15
|
|
|
namespace Humbug\PhpScoper\Symbol; |
16
|
|
|
|
17
|
|
|
use Countable; |
18
|
|
|
use PhpParser\Node\Name\FullyQualified; |
19
|
|
|
use function array_values; |
20
|
|
|
use function count; |
21
|
|
|
|
22
|
|
|
final class SymbolsRegistry implements Countable |
23
|
|
|
{ |
24
|
|
|
/** |
25
|
|
|
* @var array<string, array{string, string}> |
26
|
|
|
*/ |
27
|
|
|
private array $recordedFunctions; |
28
|
|
|
|
29
|
|
|
/** |
30
|
|
|
* @var array<string, array{string, string}> |
31
|
|
|
*/ |
32
|
|
|
private array $recordedClasses; |
33
|
|
|
|
34
|
|
|
public function recordFunction(FullyQualified $original, FullyQualified $alias): void |
35
|
|
|
{ |
36
|
|
|
$this->recordedFunctions[(string) $original] = [(string) $original, (string) $alias]; |
37
|
|
|
} |
38
|
|
|
|
39
|
|
|
/** |
40
|
|
|
* @return list<string> |
|
|
|
|
41
|
|
|
*/ |
42
|
|
|
public function getRecordedFunctions(): array |
43
|
|
|
{ |
44
|
|
|
return array_values($this->recordedFunctions); |
|
|
|
|
45
|
|
|
} |
46
|
|
|
|
47
|
|
|
public function recordClass(FullyQualified $original, FullyQualified $alias): void |
48
|
|
|
{ |
49
|
|
|
$this->recordedClasses[(string) $original] = [(string) $original, (string) $alias]; |
50
|
|
|
} |
51
|
|
|
|
52
|
|
|
/** |
53
|
|
|
* @return list<string> |
54
|
|
|
*/ |
55
|
|
|
public function getRecordedClasses(): array |
56
|
|
|
{ |
57
|
|
|
return array_values($this->recordedClasses); |
|
|
|
|
58
|
|
|
} |
59
|
|
|
|
60
|
|
|
public function count(): int |
61
|
|
|
{ |
62
|
|
|
return count($this->recordedFunctions) + count($this->recordedClasses); |
63
|
|
|
} |
64
|
|
|
} |
65
|
|
|
|
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