Commit 22057e0
fix: add directory validation in getIds() before scandir()
Previously, scandir() was called in HarFileRepository::getIds() without
checking if the directory exists, which could trigger PHP warnings.
This adds a validation check using is_dir() before calling scandir(),
returning an empty array if the directory doesn't exist. This complements
the earlier fix in loadJson() and ensures consistent error handling.
Also adds a test case to verify the behavior when getIds() is called
with a non-existent directory path.1 parent c62a75a commit 22057e0
File tree
2 files changed
+12
-0
lines changed- src/Repository
- tests/src/Unit/Repository
2 files changed
+12
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
50 | 54 | | |
51 | 55 | | |
52 | 56 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
86 | 94 | | |
0 commit comments