Skip to content

Commit ff52364

Browse files
committed
refactor: move assignment out of conditional in get_dir_file_info
1 parent 7505c73 commit ff52364

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

system/Helpers/filesystem_helper.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,8 +281,11 @@ function get_dir_file_info(string $sourceDir, bool $topLevelOnly = true, bool $r
281281
if (is_dir($sourceDir . $file) && $file[0] !== '.' && $topLevelOnly === false) {
282282
get_dir_file_info($sourceDir . $file . DIRECTORY_SEPARATOR, $topLevelOnly, true);
283283
} elseif ($file[0] !== '.') {
284-
$fileData[$file] = get_file_info($sourceDir . $file);
285-
$fileData[$file]['relative_path'] = $relativePath;
284+
$info = get_file_info($sourceDir . $file);
285+
if ($info !== null) {
286+
$fileData[$file] = $info;
287+
$fileData[$file]['relative_path'] = $relativePath;
288+
}
286289
}
287290
}
288291

0 commit comments

Comments
 (0)