Skip to content

Commit 775f8b2

Browse files
authored
fixup!
1 parent 7718046 commit 775f8b2

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/Expression/ForClasses/IsA.php

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,25 @@
1313

1414
final class IsA implements Expression
1515
{
16-
/** @var string[] */
17-
private $allowedFqcnList;
16+
/** @var array<class-string> */
17+
private array $allowedFqcnList;
1818

19+
/**
20+
* @param class-string ...$allowedFqcnList
21+
*/
1922
public function __construct(string ...$allowedFqcnList)
2023
{
2124
$this->allowedFqcnList = $allowedFqcnList;
2225
}
2326

24-
public function describe(ClassDescription $theClass, string $because): Description
27+
public function describe(ClassDescription $theClass, string $because = ''): Description
2528
{
2629
$allowedFqcnList = implode(', ', $this->allowedFqcnList);
2730

2831
return new Description("should inherit from one of: $allowedFqcnList", $because);
2932
}
3033

31-
public function evaluate(ClassDescription $theClass, Violations $violations, string $because): void
34+
public function evaluate(ClassDescription $theClass, Violations $violations, string $because = ''): void
3235
{
3336
if (!$this->isA($theClass, ...$this->allowedFqcnList)) {
3437
$violation = Violation::create(
@@ -41,6 +44,9 @@ public function evaluate(ClassDescription $theClass, Violations $violations, str
4144
}
4245
}
4346

47+
/**
48+
* @param class-string ...$allowedFqcnList
49+
*/
4450
private function isA(ClassDescription $theClass, string ...$allowedFqcnList): bool
4551
{
4652
foreach ($allowedFqcnList as $allowedFqcn) {

0 commit comments

Comments
 (0)