mirror of
https://github.com/opdavies/build-configs.git
synced 2025-09-04 02:25:32 +01:00
Files to generate should be a Collection
This commit is contained in:
parent
f0121f8bc6
commit
2b180e967c
2 changed files with 4 additions and 4 deletions
|
@ -19,13 +19,13 @@ final class RemoveIgnoredFilesCommand
|
||||||
public function execute(array $filesToGenerateAndConfigurationData, \Closure $next)
|
public function execute(array $filesToGenerateAndConfigurationData, \Closure $next)
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var array<int,TemplateFile> $filesToGenerate
|
* @var Collection<int,TemplateFile> $filesToGenerate
|
||||||
* @var ConfigDto $configurationDataDto,
|
* @var ConfigDto $configurationDataDto,
|
||||||
* @var array<non-empty-string,mixed> $configurationData
|
* @var array<non-empty-string,mixed> $configurationData
|
||||||
*/
|
*/
|
||||||
[$configurationData, $configurationDataDto, $filesToGenerate] = $filesToGenerateAndConfigurationData;
|
[$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);
|
return !collect($this->filenames)->contains($templateFile->name);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -8,10 +8,10 @@ class RemoveIgnoredFilesCommandTest extends KernelTestCase
|
||||||
{
|
{
|
||||||
public function test_it_removes_any_ignored_files(): void
|
public function test_it_removes_any_ignored_files(): void
|
||||||
{
|
{
|
||||||
$filenamesToGenerate = [
|
$filenamesToGenerate = collect([
|
||||||
new TemplateFile(data: '', name: 'phpcs.xml.dist'),
|
new TemplateFile(data: '', name: 'phpcs.xml.dist'),
|
||||||
new TemplateFile(data: '', name: 'phpstan.neon.dist'),
|
new TemplateFile(data: '', name: 'phpstan.neon.dist'),
|
||||||
];
|
]);
|
||||||
|
|
||||||
$filenamesToIgnore = ['phpstan.neon.dist'];
|
$filenamesToIgnore = ['phpstan.neon.dist'];
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue