Skip to content

Commit

Permalink
Update list method signature and remove unnecessary assertion
Browse files Browse the repository at this point in the history
Changed the list method to accept variadic string parameters for directories. Removed an assertion for class/interface existence that is deemed unnecessary.
  • Loading branch information
koriym committed Nov 2, 2024
1 parent 4dab18d commit 1966caf
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/ClassesInDirectories.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@
final class ClassesInDirectories
{
/**
* @param list<string> $directories
+ * @param string ...$directories
*
* @return Generator<int, class-string>
*/
public static function list(string ...$directories): Generator // @phpstan-ignore-line
public static function list(string ...$directories): Generator
{
foreach ($directories as $directory) {
$iterator = new RecursiveIteratorIterator(
Expand All @@ -57,8 +57,6 @@ public static function list(string ...$directories): Generator // @phpstan-ignor
continue;
}

assert(class_exists($className) || interface_exists($className));

yield $className;
}
}
Expand Down

0 comments on commit 1966caf

Please sign in to comment.