当前位置: 首页>>代码示例>>PHP>>正文


PHP DifferentialDiff::getBuildable方法代码示例

本文整理汇总了PHP中DifferentialDiff::getBuildable方法的典型用法代码示例。如果您正苦于以下问题:PHP DifferentialDiff::getBuildable方法的具体用法?PHP DifferentialDiff::getBuildable怎么用?PHP DifferentialDiff::getBuildable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DifferentialDiff的用法示例。


在下文中一共展示了DifferentialDiff::getBuildable方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: renderDiffPropertyViewValue

 public function renderDiffPropertyViewValue(DifferentialDiff $diff)
 {
     // TODO: This load is slightly inefficient, but most of this is moving
     // to Harbormaster and this simplifies the transition. Eat 1-2 extra
     // queries for now.
     $keys = $this->getDiffPropertyKeys();
     $properties = id(new DifferentialDiffProperty())->loadAllWhere('diffID = %d AND name IN (%Ls)', $diff->getID(), $keys);
     $properties = mpull($properties, 'getData', 'getName');
     foreach ($keys as $key) {
         $diff->attachProperty($key, idx($properties, $key));
     }
     $messages = array();
     $buildable = $diff->getBuildable();
     if ($buildable) {
         $target_phids = array();
         foreach ($buildable->getBuilds() as $build) {
             foreach ($build->getBuildTargets() as $target) {
                 $target_phids[] = $target->getPHID();
             }
         }
         if ($target_phids) {
             $messages = $this->loadHarbormasterTargetMessages($target_phids);
         }
     }
     if (!$messages) {
         // No Harbormaster messages, so look for legacy messages and make them
         // look like modern messages.
         $legacy_messages = $diff->getProperty($this->getLegacyProperty());
         if ($legacy_messages) {
             // Show the top 100 legacy lint messages. Previously, we showed some
             // by default and let the user toggle the rest. With modern messages,
             // we can send the user to the Harbormaster detail page. Just show
             // "a lot" of messages in legacy cases to try to strike a balance
             // between implementation simplicitly and compatibility.
             $legacy_messages = array_slice($legacy_messages, 0, 100);
             foreach ($legacy_messages as $message) {
                 try {
                     $modern = $this->newModernMessage($message);
                     $messages[] = $modern;
                 } catch (Exception $ex) {
                     // Ignore any poorly formatted messages.
                 }
             }
         }
     }
     $status = $this->renderHarbormasterStatus($diff, $messages);
     if ($messages) {
         $path_map = mpull($diff->loadChangesets(), 'getID', 'getFilename');
         foreach ($path_map as $path => $id) {
             $href = '#C' . $id . 'NL';
             // TODO: When the diff is not the right-hand-size diff, we should
             // ideally adjust this URI to be absolute.
             $path_map[$path] = $href;
         }
         $view = $this->newHarbormasterMessageView($messages);
         if ($view) {
             $view->setPathURIMap($path_map);
         }
     } else {
         $view = null;
     }
     if ($view) {
         $view = phutil_tag('div', array('class' => 'differential-harbormaster-table-view'), $view);
     }
     return array($status, $view);
 }
开发者ID:hrb518,项目名称:phabricator,代码行数:66,代码来源:DifferentialHarbormasterField.php


注:本文中的DifferentialDiff::getBuildable方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。