Commit 434aa0e1 authored by Ana Rute Mendes's avatar Ana Rute Mendes 🌈
Browse files

Nit pick: replace if statements with switch

These conditions will increase, to keep the code cleaner replace 3
if statements with a switch
parent f355732b
......@@ -448,31 +448,33 @@ final class ManiphestTransactionEditor
break;
case PhabricatorTransactions::TYPE_CUSTOMFIELD:
if ($xaction->getMetadataValue('customfield:key') == 'std:maniphest:purchasing:approver') {
switch ($xaction->getMetadataValue('customfield:key')) {
case 'std:maniphest:purchasing:approver':
foreach ($xaction->getRequiredHandlePHIDs() as $p) {
if (!empty($p)) {
$approver = $p;
break;
}
}
}
break;
if ($xaction->getMetadataValue('customfield:key') == 'std:maniphest:purchasing:project') {
case 'std:maniphest:purchasing:project':
foreach ($xaction->getRequiredHandlePHIDs() as $p) {
if (!empty($p)) {
$purchasing_project = $p;
break;
}
}
}
break;
if ($xaction->getMetadataValue('customfield:key') == 'std:maniphest:sysadmin:confidential-request') {
case 'std:maniphest:sysadmin:confidential-request':
if ($xaction->getNewValue() != $xaction->getOldValue()) {
$changed_confidentiality = true;
}
if ($xaction->getNewValue() == 'Yes' || $xaction->getNewValue() == 'Dunno') {
$confidential = true;
}
break;
}
break;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment