diff --git a/src/Command/RemoveIgnoredFilesCommand.php b/src/Command/RemoveIgnoredFilesCommand.php index 08bb72e..6c2eea6 100644 --- a/src/Command/RemoveIgnoredFilesCommand.php +++ b/src/Command/RemoveIgnoredFilesCommand.php @@ -19,13 +19,13 @@ final class RemoveIgnoredFilesCommand public function execute(array $filesToGenerateAndConfigurationData, \Closure $next) { /** - * @var array $filesToGenerate + * @var Collection $filesToGenerate * @var ConfigDto $configurationDataDto, * @var array $configurationData */ [$configurationData, $configurationDataDto, $filesToGenerate] = $filesToGenerateAndConfigurationData; - $filesToGenerate = array_filter($filesToGenerate, function (TemplateFile $templateFile): bool { + $filesToGenerate = $filesToGenerate->filter(function (TemplateFile $templateFile): bool { return !collect($this->filenames)->contains($templateFile->name); }); diff --git a/tests/Kernel/Command/RemoveIgnoredFilesCommandTest.php b/tests/Kernel/Command/RemoveIgnoredFilesCommandTest.php index 00e8c01..3a51f39 100644 --- a/tests/Kernel/Command/RemoveIgnoredFilesCommandTest.php +++ b/tests/Kernel/Command/RemoveIgnoredFilesCommandTest.php @@ -8,10 +8,10 @@ class RemoveIgnoredFilesCommandTest extends KernelTestCase { public function test_it_removes_any_ignored_files(): void { - $filenamesToGenerate = [ + $filenamesToGenerate = collect([ new TemplateFile(data: '', name: 'phpcs.xml.dist'), new TemplateFile(data: '', name: 'phpstan.neon.dist'), - ]; + ]); $filenamesToIgnore = ['phpstan.neon.dist'];