Lines
100.00%
3 / 3
Functions and Methods
100.00%
3 / 3
Classes and Traits
100.00%
1 / 1
| Name | Lines | Functions and Methods | CRAP | Classes and Traits | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| GeneratedCodeFromOlderMajorCollector | 100.00% | 3 / 3 | 100.00% | 3 / 3 | 3 | 100.00% | 1 / 1 | |||
| __construct | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | |||||
| getNodeType | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | |||||
| processNode | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | |||||
| 1 | <?php | |
| 2 | ||
| 3 | declare(strict_types=1); | |
| 4 | ||
| 5 | namespace Stewart\PHPStan\Collector; | |
| 6 | ||
| 7 | use PhpParser\Node; | |
| 8 | use PHPStan\Analyser\Scope; | |
| 9 | use PHPStan\Collectors\Collector; | |
| 10 | use PHPStan\Node\FileNode; | |
| 11 | use Stewart\PHPStan\Manifest\ManifestCatalogLoader; | |
| 12 | ||
| 13 | /** @implements Collector<FileNode, string> */ | |
| 14 | final readonly class GeneratedCodeFromOlderMajorCollector implements Collector | |
| 15 | { | |
| 16 | public function __construct(private ManifestCatalogLoader $manifests) {} | |
| 17 | ||
| 18 | public function getNodeType(): string | |
| 19 | { | |
| 20 | return FileNode::class; | |
| 21 | } | |
| 22 | ||
| 23 | public function processNode(Node $node, Scope $scope): ?string | |
| 24 | { | |
| 25 | return $this->manifests->findOlderMajorNamespaceTrackedBy($scope); | |
| 26 | } | |
| 27 | } |