mirror of
https://we.phorge.it/source/arcanist.git
synced 2024-11-29 10:12:41 +01:00
Use assert_instances_of()
Summary: D2042 Test Plan: - `arc lint` with dependent message - `arc liberate` - `arc diff` Reviewers: epriestley Reviewed By: epriestley CC: aran, epriestley Differential Revision: https://secure.phabricator.com/D2048
This commit is contained in:
parent
edb6a38389
commit
30f036c6b9
5 changed files with 7 additions and 1 deletions
|
@ -188,6 +188,7 @@ final class ArcanistLintMessage {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setDependentMessages(array $messages) {
|
public function setDependentMessages(array $messages) {
|
||||||
|
assert_instances_of($messages, 'ArcanistLintMessage');
|
||||||
$this->dependentMessages = $messages;
|
$this->dependentMessages = $messages;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,10 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
phutil_require_module('arcanist', 'lint/severity');
|
phutil_require_module('arcanist', 'lint/severity');
|
||||||
|
|
||||||
|
phutil_require_module('phutil', 'utils');
|
||||||
|
|
||||||
|
|
||||||
phutil_require_source('ArcanistLintMessage.php');
|
phutil_require_source('ArcanistLintMessage.php');
|
||||||
|
|
|
@ -546,7 +546,7 @@ final class ArcanistBundle {
|
||||||
}
|
}
|
||||||
|
|
||||||
private function buildHunkChanges(array $hunks) {
|
private function buildHunkChanges(array $hunks) {
|
||||||
|
assert_instances_of($hunks, 'ArcanistDiffHunk');
|
||||||
$result = array();
|
$result = array();
|
||||||
foreach ($hunks as $hunk) {
|
foreach ($hunks as $hunk) {
|
||||||
$small_hunks = $this->breakHunkIntoSmallHunks($hunk);
|
$small_hunks = $this->breakHunkIntoSmallHunks($hunk);
|
||||||
|
|
|
@ -58,6 +58,7 @@ final class ArcanistDiffParser {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setChanges(array $changes) {
|
public function setChanges(array $changes) {
|
||||||
|
assert_instances_of($changes, 'ArcanistDiffChange');
|
||||||
$this->changes = mpull($changes, null, 'getCurrentPath');
|
$this->changes = mpull($changes, null, 'getCurrentPath');
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
|
@ -202,6 +202,7 @@ EOTEXT
|
||||||
}
|
}
|
||||||
|
|
||||||
private function liberateWritePatches(array $results) {
|
private function liberateWritePatches(array $results) {
|
||||||
|
assert_instances_of($results, 'ArcanistLintResult');
|
||||||
$wrote = array();
|
$wrote = array();
|
||||||
|
|
||||||
foreach ($results as $result) {
|
foreach ($results as $result) {
|
||||||
|
|
Loading…
Reference in a new issue