Skip to content

Commit 0f68473

Browse files
ops
1 parent 31be702 commit 0f68473

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

src/CLI/AnalysisResult.php

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<?php
2+
declare(strict_types=1);
3+
4+
namespace Arkitect\CLI;
5+
6+
use Arkitect\Rules\ParsingErrors;
7+
use Arkitect\Rules\Violations;
8+
9+
class AnalysisResult
10+
{
11+
private Violations $violations;
12+
13+
private ParsingErrors $parsingErrors;
14+
15+
public function __construct(Violations $violations, ParsingErrors $parsingErrors)
16+
{
17+
$this->violations = $violations;
18+
$this->parsingErrors = $parsingErrors;
19+
}
20+
21+
public function getViolations(): Violations
22+
{
23+
return $this->violations;
24+
}
25+
26+
public function getParsingErrors(): ParsingErrors
27+
{
28+
return $this->parsingErrors;
29+
}
30+
31+
public function hasErrors(): bool
32+
{
33+
return $this->hasViolations() || $this->hasParsingErrors();
34+
}
35+
36+
public function hasViolations(): bool
37+
{
38+
return $this->violations->count() > 0;
39+
}
40+
41+
public function hasParsingErrors(): bool
42+
{
43+
return $this->parsingErrors->count() > 0;
44+
}
45+
}

0 commit comments

Comments
 (0)