Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/typeahead/DiffusionRepositoryDatasource.php
Show All 35 Lines | foreach ($repos as $repository) { | ||||
$name = $repository->getName(); | $name = $repository->getName(); | ||||
$display_name = "{$monogram} {$name}"; | $display_name = "{$monogram} {$name}"; | ||||
$parts = array(); | $parts = array(); | ||||
$parts[] = $name; | $parts[] = $name; | ||||
$slug = $repository->getRepositorySlug(); | $slug = $repository->getRepositorySlug(); | ||||
if (strlen($slug)) { | if (phutil_nonempty_string($slug)) { | ||||
$parts[] = $slug; | $parts[] = $slug; | ||||
} | } | ||||
$callsign = $repository->getCallsign(); | $callsign = $repository->getCallsign(); | ||||
if ($callsign) { | if ($callsign) { | ||||
$parts[] = $callsign; | $parts[] = $callsign; | ||||
} | } | ||||
foreach ($repository->getAllMonograms() as $monogram) { | foreach ($repository->getAllMonograms() as $monogram) { | ||||
$parts[] = $monogram; | $parts[] = $monogram; | ||||
} | } | ||||
$name = implode("\n", $parts); | $name = implode("\n", $parts); | ||||
valerio.bozzolan: ↑ This assumes all the parts as strings. | |||||
$vcs = $repository->getVersionControlSystem(); | $vcs = $repository->getVersionControlSystem(); | ||||
$vcs_type = PhabricatorRepositoryType::getNameForRepositoryType($vcs); | $vcs_type = PhabricatorRepositoryType::getNameForRepositoryType($vcs); | ||||
$result = id(new PhabricatorTypeaheadResult()) | $result = id(new PhabricatorTypeaheadResult()) | ||||
->setName($name) | ->setName($name) | ||||
->setDisplayName($display_name) | ->setDisplayName($display_name) | ||||
->setURI($repository->getURI()) | ->setURI($repository->getURI()) | ||||
Show All 18 Lines |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0
↑ This assumes all the parts as strings.