phpdebt fails when there is no code. Let's inform the user and exit.
Don't fail with a division by zero
phpdebt fails when there is no code. Let's inform the user and exit.
It'd be great if this was committed
Code like
$module_handler = \Drupal::moduleHandler();
$enabled_modules = $module_handler->getModuleList();
foreach (array_keys($enabled_modules) as $module) {
// All modules should have a recorded schema version, but when they
// don't, detect and fix the problem.
if (!isset($versions[$module])) {
// Ensure the .install file is loaded.
$module_handler->loadInclude($module, 'install');
$all_updates = $update_registry->getAvailableUpdates($module);
(see update.inc)
results in
-
message: "#^A file could not be loaded from Drupal\\\\Core\\\\Extension\\\\ModuleHandlerInterface\\:\\:loadInclude$#"
count: 1
path: includes/update.inc
which it should not. There are instances where the first argument to loadInclude is a variable and in these instance PHPStan should not result in an error.
@sebastianbergmann what is the recommended way of testing that an error is triggered in PHPUnit 10? If you want to assert that an E_USER_WARNING is thrown by your code what is the best way to do this? Should you replace the error handler as above or is there a better way?
In order to get the folders listed I need to:
At this point I can then checkout .idea to restore what the project ships with and re-open the project and everything works as expected. But this is super super awkward.
If I open this repository in PHPStorm immediately after cloning I don't see any folders - i.e. src/ which makes the project unusable.
I was looking through the dev tooling and I was interested in the use of mutation testing. However looking at the automated testing it doesn't look like infection is running as part of the automated testing. Am I missing something? Or should we either make it run or remove it as a dev dependency.
Fix spelling in phpstan.neon.dist