Page MenuHomePhabricator

ExampleReviewerListener.php

Authored By
epriestley
May 16 2013, 7:01 PM
Size
717 B
Referenced Files
None
Subscribers
None

ExampleReviewerListener.php

<?php
final class ExampleReviewerListener extends PhutilEventListener {
public function register() {
$this->listen(ArcanistEventType::TYPE_DIFF_WILLBUILDMESSAGE);
}
public function handleEvent(PhutilEvent $event) {
$fields = $event->getValue('fields');
$more = $event->getValue('workflow')->getConduit()->callMethodSynchronous(
'user.query',
array(
'usernames' => array(
'dog',
'duck',
),
));
$phids = idx($fields, 'reviewerPHIDs', array());
foreach ($more as $user) {
$phids[] = $user['phid'];
}
$phids = array_unique($phids);
$fields['reviewerPHIDs'] = $phids;
$event->setValue('fields', $fields);
}
}

File Metadata

Mime Type
text/plain; charset=utf-8
Storage Engine
amazon-s3
Storage Format
Raw Data
Storage Handle
phabricator/r2/gn/gyjrltg5ua676sl3
Default Alt Text
ExampleReviewerListener.php (717 B)

Event Timeline