Skip to content

Commit

Permalink
Add refactoring todo
Browse files Browse the repository at this point in the history
The refactoring is worthwhile because:

Makes the code more maintainable and testable
Breaks down complex logic into smaller, focused methods
Preserves the public API while improving internal organization
Reduces the cognitive load when reading the Filesystem class
We can make it swappable in testing through the service container
  • Loading branch information
caendesilva committed Dec 14, 2024
1 parent ff3eba5 commit 15e95a0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/framework/src/Foundation/Kernel/Filesystem.php
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,8 @@ public function smartGlob(string $pattern, int $flags = 0): Collection
/** @return \Illuminate\Support\Collection<int, string> */
public function findFiles(string $directory, string|array|false $matchExtensions = false, bool $recursive = false): Collection
{
// TODO: Extract to internal class

if (! \Hyde\Facades\Filesystem::isDirectory($directory)) {
return collect();
}
Expand Down

0 comments on commit 15e95a0

Please sign in to comment.