@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Use assert_instances_of() in Diffusion

Summary: NOTE: This is not produced by a script so there might be errors. Please review carefully.

Test Plan: Browse around Diffusion.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran

Differential Revision: https://secure.phabricator.com/D2094

vrana c241f50d 591d5000

+33 -6
+11 -3
src/applications/diffusion/controller/commit/DiffusionCommitController.php
··· 267 267 PhabricatorRepositoryCommit $commit, 268 268 PhabricatorRepositoryCommitData $data, 269 269 array $parents) { 270 + assert_instances_of($parents, 'PhabricatorRepositoryCommit'); 270 271 $user = $this->getRequest()->getUser(); 271 272 272 273 $phids = array(); ··· 347 348 return $props; 348 349 } 349 350 350 - private function buildAuditTable($commit, $audits) { 351 + private function buildAuditTable( 352 + PhabricatorRepositoryCommit $commit, 353 + array $audits) { 354 + assert_instances_of($audits, 'PhabricatorRepositoryAuditRequest'); 351 355 $user = $this->getRequest()->getUser(); 352 356 353 357 $view = new PhabricatorAuditListView(); ··· 369 373 return $panel; 370 374 } 371 375 372 - private function buildComments($commit) { 376 + private function buildComments(PhabricatorRepositoryCommit $commit) { 373 377 $user = $this->getRequest()->getUser(); 374 378 $comments = id(new PhabricatorAuditComment())->loadAllWhere( 375 379 'targetPHID = %s ORDER BY dateCreated ASC', ··· 402 406 return $view; 403 407 } 404 408 405 - private function buildAddCommentView($commit, array $audit_requests) { 409 + private function buildAddCommentView( 410 + PhabricatorRepositoryCommit $commit, 411 + array $audit_requests) { 412 + assert_instances_of($audit_requests, 'PhabricatorRepositoryAuditRequest'); 406 413 $user = $this->getRequest()->getUser(); 407 414 408 415 $is_serious = PhabricatorEnv::getEnvConfig('phabricator.serious-business'); ··· 493 500 private function getAuditActions( 494 501 PhabricatorRepositoryCommit $commit, 495 502 array $audit_requests) { 503 + assert_instances_of($audit_requests, 'PhabricatorRepositoryAuditRequest'); 496 504 $user = $this->getRequest()->getUser(); 497 505 498 506 $user_is_author = ($commit->getAuthorPHID() == $user->getPHID());
+3 -1
src/applications/diffusion/data/pathchange/DiffusionPathChange.php
··· 1 1 <?php 2 2 3 3 /* 4 - * Copyright 2011 Facebook, Inc. 4 + * Copyright 2012 Facebook, Inc. 5 5 * 6 6 * Licensed under the Apache License, Version 2.0 (the "License"); 7 7 * you may not use this file except in compliance with the License. ··· 135 135 } 136 136 137 137 final public static function convertToArcanistChanges(array $changes) { 138 + assert_instances_of($changes, 'DiffusionPathChange'); 138 139 $direct = array(); 139 140 $result = array(); 140 141 foreach ($changes as $path) { ··· 158 159 } 159 160 160 161 final public static function convertToDifferentialChangesets(array $changes) { 162 + assert_instances_of($changes, 'DiffusionPathChange'); 161 163 $arcanist_changes = self::convertToArcanistChanges($changes); 162 164 $diff = DifferentialDiff::newFromRawChanges($arcanist_changes); 163 165 return $diff->getChangesets();
+5 -2
src/applications/diffusion/query/symbol/DiffusionSymbolQuery.php
··· 1 1 <?php 2 2 3 3 /* 4 - * Copyright 2011 Facebook, Inc. 4 + * Copyright 2012 Facebook, Inc. 5 5 * 6 6 * Licensed under the Apache License, Version 2.0 (the "License"); 7 7 * you may not use this file except in compliance with the License. ··· 15 15 * See the License for the specific language governing permissions and 16 16 * limitations under the License. 17 17 */ 18 - 19 18 20 19 /** 21 20 * Query symbol information (class and function names and location), returning ··· 222 221 * @task internal 223 222 */ 224 223 private function loadPaths(array $symbols) { 224 + assert_instances_of($symbols, 'PhabricatorRepositorySymbol'); 225 225 $path_map = queryfx_all( 226 226 id(new PhabricatorRepository())->establishConnection('r'), 227 227 'SELECT * FROM %T WHERE id IN (%Ld)', ··· 238 238 * @task internal 239 239 */ 240 240 private function loadArcanistProjects(array $symbols) { 241 + assert_instances_of($symbols, 'PhabricatorRepositorySymbol'); 241 242 $projects = id(new PhabricatorRepositoryArcanistProject())->loadAllWhere( 242 243 'id IN (%Ld)', 243 244 mpull($symbols, 'getArcanistProjectID')); ··· 252 253 * @task internal 253 254 */ 254 255 private function loadRepositories(array $symbols) { 256 + assert_instances_of($symbols, 'PhabricatorRepositorySymbol'); 257 + 255 258 $projects = mpull($symbols, 'getArcanistProject'); 256 259 $projects = array_filter($projects); 257 260
+1
src/applications/diffusion/view/branchtable/DiffusionBranchTableView.php
··· 21 21 private $branches; 22 22 23 23 public function setBranches(array $branches) { 24 + assert_instances_of($branches, 'DiffusionBranchInformation'); 24 25 $this->branches = $branches; 25 26 return $this; 26 27 }
+1
src/applications/diffusion/view/branchtable/__init__.php
··· 10 10 phutil_require_module('phabricator', 'view/control/table'); 11 11 12 12 phutil_require_module('phutil', 'markup'); 13 + phutil_require_module('phutil', 'utils'); 13 14 14 15 15 16 phutil_require_source('DiffusionBranchTableView.php');
+2
src/applications/diffusion/view/browsetable/DiffusionBrowseTableView.php
··· 27 27 } 28 28 29 29 public function setHandles(array $handles) { 30 + assert_instances_of($handles, 'PhabricatorObjectHandle'); 30 31 $this->handles = $handles; 31 32 return $this; 32 33 } ··· 36 37 array $handles, 37 38 PhabricatorRepositoryCommit $commit = null, 38 39 PhabricatorRepositoryCommitData $data = null) { 40 + assert_instances_of($handles, 'PhabricatorObjectHandle'); 39 41 40 42 if ($commit) { 41 43 $epoch = $commit->getEpoch();
+1
src/applications/diffusion/view/browsetable/__init__.php
··· 13 13 phutil_require_module('phabricator', 'view/control/table'); 14 14 15 15 phutil_require_module('phutil', 'markup'); 16 + phutil_require_module('phutil', 'utils'); 16 17 17 18 18 19 phutil_require_source('DiffusionBrowseTableView.php');
+2
src/applications/diffusion/view/comment/DiffusionCommentView.php
··· 45 45 } 46 46 47 47 public function setHandles(array $handles) { 48 + assert_instances_of($handles, 'PhabricatorObjectHandle'); 48 49 $this->handles = $handles; 49 50 return $this; 50 51 } ··· 55 56 } 56 57 57 58 public function setInlineComments(array $inline_comments) { 59 + assert_instances_of($inline_comments, 'PhabricatorAuditInlineComment'); 58 60 $this->inlineComments = $inline_comments; 59 61 return $this; 60 62 }
+3
src/applications/diffusion/view/commentlist/DiffusionCommentListView.php
··· 29 29 } 30 30 31 31 public function setComments(array $comments) { 32 + assert_instances_of($comments, 'PhabricatorAuditComment'); 32 33 $this->comments = $comments; 33 34 return $this; 34 35 } 35 36 36 37 public function setInlineComments(array $inline_comments) { 38 + assert_instances_of($inline_comments, 'PhabricatorAuditInlineComment'); 37 39 $this->inlineComments = $inline_comments; 38 40 return $this; 39 41 } ··· 55 57 } 56 58 57 59 public function setHandles(array $handles) { 60 + assert_instances_of($handles, 'PhabricatorObjectHandle'); 58 61 $this->handles = $handles; 59 62 return $this; 60 63 }
+1
src/applications/diffusion/view/commitchangetable/DiffusionCommitChangeTableView.php
··· 21 21 private $pathChanges; 22 22 23 23 public function setPathChanges(array $path_changes) { 24 + assert_instances_of($path_changes, 'DiffusionPathChange'); 24 25 $this->pathChanges = $path_changes; 25 26 return $this; 26 27 }
+1
src/applications/diffusion/view/commitchangetable/__init__.php
··· 11 11 phutil_require_module('phabricator', 'view/control/table'); 12 12 13 13 phutil_require_module('phutil', 'markup'); 14 + phutil_require_module('phutil', 'utils'); 14 15 15 16 16 17 phutil_require_source('DiffusionCommitChangeTableView.php');
+2
src/applications/diffusion/view/historytable/DiffusionHistoryTableView.php
··· 24 24 private $parents; 25 25 26 26 public function setHistory(array $history) { 27 + assert_instances_of($history, 'DiffusionPathChange'); 27 28 $this->history = $history; 28 29 return $this; 29 30 } 30 31 31 32 public function setHandles(array $handles) { 33 + assert_instances_of($handles, 'PhabricatorObjectHandle'); 32 34 $this->handles = $handles; 33 35 return $this; 34 36 }