Skip to content

Commit ee8aebf

Browse files
committed
Add AnalysisResult and DefinitionAnalyser for container analysis and cycle detection; add tests and assets
1 parent 1082010 commit ee8aebf

16 files changed

Lines changed: 1875 additions & 0 deletions

src/Compiler/AnalysisResult.php

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace League\Container\Compiler;
6+
7+
final readonly class AnalysisResult
8+
{
9+
/**
10+
* @param list<CompiledDefinition> $compiledDefinitions
11+
* @param array<string, list<string>> $tagMap
12+
* @param list<array{serviceId: string, errorType: string, message: string, suggestedFix: string}> $errors
13+
* @param list<string> $warnings
14+
*/
15+
public function __construct(
16+
public array $compiledDefinitions,
17+
public DependencyGraph $dependencyGraph,
18+
public array $tagMap,
19+
public array $errors,
20+
public array $warnings,
21+
) {}
22+
23+
public function hasErrors(): bool
24+
{
25+
return $this->errors !== [];
26+
}
27+
28+
public function hasWarnings(): bool
29+
{
30+
return $this->warnings !== [];
31+
}
32+
}

0 commit comments

Comments
 (0)