1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-25 16:22:42 +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:
vrana 2012-03-28 21:36:37 -07:00
parent edb6a38389
commit 30f036c6b9
5 changed files with 7 additions and 1 deletions

View file

@ -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;
} }

View file

@ -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');

View file

@ -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);

View file

@ -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;
} }

View file

@ -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) {