Skip to content

Commit

Permalink
bugfix: do not throw ConfigException when missing files are allowed (
Browse files Browse the repository at this point in the history
…#5280)

Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
  • Loading branch information
boesing committed Feb 25, 2021
1 parent fff32d0 commit 5169bd7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Psalm/Config/FileFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -239,14 +239,18 @@ public static function loadFromXMLElement(
);

if (empty($globs)) {
if ($allow_missing_files) {
continue;
}

throw new ConfigException(
'Could not resolve config path to ' . $base_dir . DIRECTORY_SEPARATOR .
(string)$file['name']
);
}

foreach ($globs as $glob_index => $file_path) {
if (!$file_path) {
if (!$file_path && !$allow_missing_files) {
throw new ConfigException(
'Could not resolve config path to ' . $base_dir . DIRECTORY_SEPARATOR .
(string)$file['name'] . ':' . $glob_index
Expand Down

0 comments on commit 5169bd7

Please sign in to comment.