Skip to content

Commit

Permalink
yupx3
Browse files Browse the repository at this point in the history
  • Loading branch information
micheleorselli committed Feb 11, 2025
1 parent 0642489 commit c0a9af9
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/PHPUnit/ArchRuleCheckerConstraintAdapter.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

declare(strict_types=1);

namespace Arkitect\PHPUnit;
Expand All @@ -10,11 +11,17 @@
use Arkitect\CLI\Progress\VoidProgress;
use Arkitect\CLI\Runner;
use Arkitect\CLI\TargetPhpVersion;
use Arkitect\Rules\ArchRule;
use Arkitect\Rules\ParsingErrors;
use Arkitect\Rules\Violations;
use PHPUnit\Framework\Constraint\Constraint;

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

protected function matches(/** @var $rule ArchRule */ $other): bool
{
protected function matches(
/** @var $rule ArchRule */
$other
): bool {
$this->runner->check(
ClassSetRules::create($this->classSet, $other),
new VoidProgress(),
Expand Down

0 comments on commit c0a9af9

Please sign in to comment.