Changeset View
Changeset View
Standalone View
Standalone View
src/applications/maniphest/command/ManiphestPriorityEmailCommand.php
Show First 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | final class ManiphestPriorityEmailCommand | ||||
public function buildTransactions( | public function buildTransactions( | ||||
PhabricatorUser $viewer, | PhabricatorUser $viewer, | ||||
PhabricatorApplicationTransactionInterface $object, | PhabricatorApplicationTransactionInterface $object, | ||||
PhabricatorMetaMTAReceivedMail $mail, | PhabricatorMetaMTAReceivedMail $mail, | ||||
$command, | $command, | ||||
array $argv) { | array $argv) { | ||||
$xactions = array(); | $xactions = array(); | ||||
$target = phutil_utf8_strtolower(head($argv)); | $keyword = phutil_utf8_strtolower(head($argv)); | ||||
$priority = null; | $priority = ManiphestTaskPriority::getTaskPriorityFromKeyword($keyword); | ||||
$keywords = ManiphestTaskPriority::getTaskPriorityKeywordsMap(); | |||||
foreach ($keywords as $key => $words) { | |||||
foreach ($words as $word) { | |||||
if ($word == $target) { | |||||
$priority = $key; | |||||
break; | |||||
} | |||||
} | |||||
} | |||||
if ($priority === null) { | if ($priority === null) { | ||||
epriestley: Should be `if ($priority === null)`? | |||||
return array(); | return array(); | ||||
} | } | ||||
if (ManiphestTaskPriority::isDisabledPriority($priority)) { | if (ManiphestTaskPriority::isDisabledPriority($priority)) { | ||||
return array(); | return array(); | ||||
} | } | ||||
$xactions[] = $object->getApplicationTransactionTemplate() | $xactions[] = $object->getApplicationTransactionTemplate() | ||||
->setTransactionType(ManiphestTaskPriorityTransaction::TRANSACTIONTYPE) | ->setTransactionType(ManiphestTaskPriorityTransaction::TRANSACTIONTYPE) | ||||
->setNewValue($priority); | ->setNewValue($keyword); | ||||
return $xactions; | return $xactions; | ||||
} | } | ||||
} | } |
Should be if ($priority === null)?