1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-23 06:11:25 +01:00

fix triggerErrorExits not working

Fix https://github.com/vimeo/psalm/issues/8270
This commit is contained in:
kkmuffme 2022-07-21 12:54:47 +02:00
parent cac9ec957c
commit e1b0255db8

View File

@ -961,7 +961,6 @@ class Config
'reportInfo' => 'report_info',
'restrictReturnTypes' => 'restrict_return_types',
'limitMethodComplexity' => 'limit_method_complexity',
'triggerErrorExits' => 'trigger_error_exits',
];
foreach ($booleanAttributes as $xmlName => $internalName) {
@ -1096,6 +1095,13 @@ class Config
$config->infer_property_types_from_constructor = $attribute_text === 'true' || $attribute_text === '1';
}
if (isset($config_xml['triggerErrorExits'])) {
$attribute_text = (string) $config_xml['triggerErrorExits'];
if ($attribute_text === 'always' || $attribute_text === 'never') {
$config->trigger_error_exits = $attribute_text;
}
}
if (isset($config_xml->projectFiles)) {
$config->project_files = ProjectFileFilter::loadFromXMLElement($config_xml->projectFiles, $base_dir, true);
}