Changeset View
Changeset View
Standalone View
Standalone View
src/lint/linter/ArcanistFutureLinter.php
<?php | <?php | ||||
abstract class ArcanistFutureLinter extends ArcanistLinter { | abstract class ArcanistFutureLinter extends ArcanistLinter { | ||||
private $futures; | private $futures; | ||||
abstract protected function buildFutures(array $paths); | abstract protected function buildFutures(array $paths); | ||||
abstract protected function resolveFuture($path, Future $future); | abstract protected function resolveFuture($path, Future $future); | ||||
final protected function getFuturesLimit() { | final protected function getFuturesLimit() { | ||||
return 8; | return 8; | ||||
} | } | ||||
public function willLintPaths(array $paths) { | public function willLintPaths(array $paths) { | ||||
$limit = $this->getFuturesLimit(); | $limit = $this->getFuturesLimit(); | ||||
$this->futures = id(new FutureIterator(array()))->limit($limit); | $this->futures = (new FutureIterator(array()))->limit($limit); | ||||
foreach ($this->buildFutures($paths) as $path => $future) { | foreach ($this->buildFutures($paths) as $path => $future) { | ||||
$future->setFutureKey($path); | $future->setFutureKey($path); | ||||
$this->futures->addFuture($future); | $this->futures->addFuture($future); | ||||
} | } | ||||
} | } | ||||
final public function lintPath($path) { | final public function lintPath($path) { | ||||
return; | return; | ||||
Show All 33 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