mirror of
https://github.com/opdavies/build-configs.git
synced 2025-09-04 02:25:32 +01:00
Return an empty array if there is no ignore file
This commit is contained in:
parent
636aed29bb
commit
a56d9b2d5e
2 changed files with 9 additions and 0 deletions
|
@ -10,6 +10,10 @@ final class IgnoreFile
|
|||
|
||||
public static function parse(): array
|
||||
{
|
||||
if (@stat(self::FILENAME) === false) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return explode("\n", file_get_contents(self::FILENAME));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,4 +18,9 @@ class IgnoreFileTest extends KernelTestCase
|
|||
|
||||
self::assertSame(['phpstan.neon.dist'], IgnoreFile::parse());
|
||||
}
|
||||
|
||||
public function test_it_returns_an_empty_array_of_filenames_if_there_is_no_ignore_file(): void
|
||||
{
|
||||
self::assertSame([], IgnoreFile::parse());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue