mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-25 00:02:41 +01:00
c20fd58303
Summary: Currently we markup `rXabcd`, but not `rX` on its own. Mark these up as repository object names. Test Plan: Typed `rPOEMS`, `rPOEMS1`, `rPOEMS139893189`, etc. Reviewers: btrahan, dctrwatson Reviewed By: btrahan CC: aran, poop Differential Revision: https://secure.phabricator.com/D7859
25 lines
526 B
PHP
25 lines
526 B
PHP
<?php
|
|
|
|
final class DiffusionRepositoryRemarkupRule
|
|
extends PhabricatorRemarkupRuleObject {
|
|
|
|
protected function getObjectNamePrefix() {
|
|
return 'r';
|
|
}
|
|
|
|
protected function getObjectIDPattern() {
|
|
return '[A-Z]+';
|
|
}
|
|
|
|
protected function loadObjects(array $ids) {
|
|
$viewer = $this->getEngine()->getConfig('viewer');
|
|
|
|
$repositories = id(new PhabricatorRepositoryQuery())
|
|
->setViewer($viewer)
|
|
->withCallsigns($ids)
|
|
->execute();
|
|
|
|
return mpull($repositories, null, 'getCallsign');
|
|
}
|
|
|
|
}
|