Differential D21872 Diff 52175 src/applications/harbormaster/conduit/HarbormasterSendMessageConduitAPIMethod.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/harbormaster/conduit/HarbormasterSendMessageConduitAPIMethod.php
Show First 20 Lines • Show All 509 Lines • ▼ Show 20 Lines | if ($build_target_phid !== null) { | ||||
throw new Exception( | throw new Exception( | ||||
pht( | pht( | ||||
'Call specifies both "receiver" and "buildTargetPHID". '. | 'Call specifies both "receiver" and "buildTargetPHID". '. | ||||
'When using the modern "receiver" parameter, omit the '. | 'When using the modern "receiver" parameter, omit the '. | ||||
'deprecated "buildTargetPHID" parameter.')); | 'deprecated "buildTargetPHID" parameter.')); | ||||
} | } | ||||
} | } | ||||
if (!strlen($receiver_name)) { | if ($receiver_name === null || !strlen($receiver_name)) { | ||||
throw new Exception( | throw new Exception( | ||||
pht( | pht( | ||||
'Call omits required "receiver" parameter. Specify the PHID '. | 'Call omits required "receiver" parameter. Specify the PHID '. | ||||
'of the object you want to send a message to.')); | 'of the object you want to send a message to.')); | ||||
} | } | ||||
$message_type = $request->getValue('type'); | $message_type = $request->getValue('type'); | ||||
if (!strlen($message_type)) { | if ($message_type === null || !strlen($message_type)) { | ||||
throw new Exception( | throw new Exception( | ||||
pht( | pht( | ||||
'Call omits required "type" parameter. Specify the type of '. | 'Call omits required "type" parameter. Specify the type of '. | ||||
'message you want to send.')); | 'message you want to send.')); | ||||
} | } | ||||
$receiver_object = id(new PhabricatorObjectQuery()) | $receiver_object = id(new PhabricatorObjectQuery()) | ||||
->setViewer($viewer) | ->setViewer($viewer) | ||||
▲ Show 20 Lines • Show All 156 Lines • Show Last 20 Lines |