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


PHP ArcanistLintMessage::getPath方法代码示例

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


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

示例1: addLintMessage

 protected final function addLintMessage(ArcanistLintMessage $message)
 {
     $root = $this->getProjectRoot();
     $path = Filesystem::resolvePath($message->getPath(), $root);
     $message->setPath(Filesystem::readablePath($path, $root));
     $this->messages[] = $message;
     return $message;
 }
开发者ID:milindc2031,项目名称:Test,代码行数:8,代码来源:ArcanistLinter.php

示例2: isRelevantMessage

 private final function isRelevantMessage(ArcanistLintMessage $message)
 {
     // When a user runs "arc lint", we default to raising only warnings on
     // lines they have changed (errors are still raised anywhere in the
     // file). The list of $changed lines may be null, to indicate that the
     // path is a directory or a binary file so we should not exclude
     // warnings.
     if (!$this->changedLines || $message->isError() || $message->shouldBypassChangedLineFiltering()) {
         return true;
     }
     $locations = $message->getOtherLocations();
     $locations[] = $message->toDictionary();
     foreach ($locations as $location) {
         $path = idx($location, 'path', $message->getPath());
         if (!array_key_exists($path, $this->changedLines)) {
             if (phutil_is_windows()) {
                 // We try checking the UNIX path form as well, on Windows.  Linters
                 // store noramlized paths, which use the Windows-style "\" as a
                 // delimiter; as such, they don't match the UNIX-style paths stored
                 // in changedLines, which come from the VCS.
                 $path = str_replace('\\', '/', $path);
                 if (!array_key_exists($path, $this->changedLines)) {
                     continue;
                 }
             } else {
                 continue;
             }
         }
         $changed = $this->getPathChangedLines($path);
         if ($changed === null || !$location['line']) {
             return true;
         }
         $last_line = $location['line'];
         if (isset($location['original'])) {
             $last_line += substr_count($location['original'], "\n");
         }
         for ($l = $location['line']; $l <= $last_line; $l++) {
             if (!empty($changed[$l])) {
                 return true;
             }
         }
     }
     return false;
 }
开发者ID:endlessm,项目名称:arcanist,代码行数:44,代码来源:ArcanistLintEngine.php

示例3: isRelevantMessage

 private final function isRelevantMessage(ArcanistLintMessage $message)
 {
     // When a user runs "arc lint", we default to raising only warnings on
     // lines they have changed (errors are still raised anywhere in the
     // file). The list of $changed lines may be null, to indicate that the
     // path is a directory or a binary file so we should not exclude
     // warnings.
     if (!$this->changedLines || $message->isError() || $message->shouldBypassChangedLineFiltering()) {
         return true;
     }
     $locations = $message->getOtherLocations();
     $locations[] = $message->toDictionary();
     foreach ($locations as $location) {
         $path = idx($location, 'path', $message->getPath());
         if (!array_key_exists($path, $this->changedLines)) {
             continue;
         }
         $changed = $this->getPathChangedLines($path);
         if ($changed === null || !$location['line']) {
             return true;
         }
         $last_line = $location['line'];
         if (isset($location['original'])) {
             $last_line += substr_count($location['original'], "\n");
         }
         for ($l = $location['line']; $l <= $last_line; $l++) {
             if (!empty($changed[$l])) {
                 return true;
             }
         }
     }
     return false;
 }
开发者ID:fengshao0907,项目名称:arcanist,代码行数:33,代码来源:ArcanistLintEngine.php

示例4: addLintMessage

 protected function addLintMessage(ArcanistLintMessage $message)
 {
     if (!$this->getEngine()->getCommitHookMode()) {
         $root = $this->getEngine()->getWorkingCopy()->getProjectRoot();
         $path = Filesystem::resolvePath($message->getPath(), $root);
         $message->setPath(Filesystem::readablePath($path, $root));
     }
     $this->messages[] = $message;
     return $message;
 }
开发者ID:rafikk,项目名称:arcanist,代码行数:10,代码来源:ArcanistLinter.php


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