Skip to content

Commit

Permalink
fix triggerErrorExits not working
Browse files Browse the repository at this point in the history
Fix #8270
  • Loading branch information
kkmuffme committed Jul 21, 2022
1 parent cac9ec9 commit e1b0255
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Psalm/Config.php
Expand Up @@ -961,7 +961,6 @@ private static function fromXmlAndPaths(
'reportInfo' => 'report_info',
'restrictReturnTypes' => 'restrict_return_types',
'limitMethodComplexity' => 'limit_method_complexity',
'triggerErrorExits' => 'trigger_error_exits',
];

foreach ($booleanAttributes as $xmlName => $internalName) {
Expand Down Expand Up @@ -1096,6 +1095,13 @@ private static function fromXmlAndPaths(
$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);
}
Expand Down

0 comments on commit e1b0255

Please sign in to comment.