Skip to content

Commit c0a9af9

Browse files
yupx3
1 parent 0642489 commit c0a9af9

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

src/PHPUnit/ArchRuleCheckerConstraintAdapter.php

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
declare(strict_types=1);
34

45
namespace Arkitect\PHPUnit;
@@ -10,11 +11,17 @@
1011
use Arkitect\CLI\Progress\VoidProgress;
1112
use Arkitect\CLI\Runner;
1213
use Arkitect\CLI\TargetPhpVersion;
13-
use Arkitect\Rules\ArchRule;
1414
use Arkitect\Rules\ParsingErrors;
1515
use Arkitect\Rules\Violations;
1616
use PHPUnit\Framework\Constraint\Constraint;
1717

18+
/**
19+
* @psalm-suppress UndefinedClass
20+
*
21+
* Since we declared phpunit as a dev dependency we cannot be sure the class PHPUnit\Framework\Constraint\Constraint
22+
* will be available at runtime. Given arkitect will be used in a development environment, we can ignore this but it
23+
* would be nice to have a way to check if the class is available at runtime.
24+
*/
1825
class ArchRuleCheckerConstraintAdapter extends Constraint
1926
{
2027
/** @var ClassSet */
@@ -47,8 +54,10 @@ public function toString(): string
4754
return 'satisfies all architectural constraints';
4855
}
4956

50-
protected function matches(/** @var $rule ArchRule */ $other): bool
51-
{
57+
protected function matches(
58+
/** @var $rule ArchRule */
59+
$other
60+
): bool {
5261
$this->runner->check(
5362
ClassSetRules::create($this->classSet, $other),
5463
new VoidProgress(),

0 commit comments

Comments
 (0)