Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Put back exception during class scanning #24601

Merged
merged 1 commit into from
Sep 24, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Civi/Core/ClassScanner.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,8 @@ public static function scanFolders(array &$classes, string $classRoot, string $c
}
elseif (!interface_exists($class) && !trait_exists($class)) {
// If you get this error, then perhaps (a) you need to fix the name of file/class/namespace or (b) you should disable class-scanning.
\Civi::log('class_scanner')->warning("Scanned file {$relFile} for class {$class}, but it was not found.");
// throw new \RuntimeException("Scanned file {$relFile} for class {$class}, but it was not found.");
// We can't throw an exception since it breaks some test environments. We can't log because this happens too early and it leads to an infinite loop. error_log() works but is debatable if anyone will look there.
}
}
}
Expand Down