Skip to content

Commit fb43431

Browse files
Herberto Gracahgraca
Herberto Graca
authored andcommitted
Replace array for string ...
This provides better typing
1 parent 976c200 commit fb43431

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/Analyzer/ClassDescription.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public function namespaceMatches(string $pattern): bool
9393
return $this->FQCN->matches($pattern);
9494
}
9595

96-
public function namespaceMatchesOneOfTheseNamespaces(array $classesToBeExcluded): bool
96+
public function namespaceMatchesOneOfTheseNamespaces(string ...$classesToBeExcluded): bool
9797
{
9898
foreach ($classesToBeExcluded as $classToBeExcluded) {
9999
if ($this->namespaceMatches($classToBeExcluded)) {

src/Rules/ArchRule.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function __construct(
3838

3939
public function check(ClassDescription $classDescription, Violations $violations): void
4040
{
41-
if ($classDescription->namespaceMatchesOneOfTheseNamespaces($this->classesToBeExcluded)) {
41+
if ($classDescription->namespaceMatchesOneOfTheseNamespaces(...$this->classesToBeExcluded)) {
4242
return;
4343
}
4444

tests/Unit/Analyzer/ClassDescriptionTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function test_should_return_true_if_there_class_is_in_namespace_array():
3636
{
3737
$cd = $this->builder->build();
3838

39-
$this->assertTrue($cd->namespaceMatchesOneOfTheseNamespaces(['Fruit']));
39+
$this->assertTrue($cd->namespaceMatchesOneOfTheseNamespaces('Fruit', 'Banana'));
4040
}
4141

4242
public function test_should_return_true_if_is_annotated_with(): void

0 commit comments

Comments
 (0)