Skip to content

Commit

Permalink
Merge pull request #8304 from kkmuffme/fix-triggerErrorExits-config-n…
Browse files Browse the repository at this point in the history
…ot-working

fix triggerErrorExits not working
  • Loading branch information
orklah committed Jul 21, 2022
2 parents cac9ec9 + e1b0255 commit 910bc57
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 910bc57

Please sign in to comment.