@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() everywhere but Differential and Diffusion

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

Test Plan: Browse around.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran

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

vrana 8813c7be 5623abec

+105 -5
+4
src/applications/audit/editor/comment/PhabricatorAuditCommentEditor.php
··· 257 257 PhabricatorAuditComment $comment, 258 258 array $other_comments, 259 259 array $inline_comments) { 260 + assert_instances_of($other_comments, 'PhabricatorAuditComment'); 261 + assert_instances_of($inline_comments, 'PhabricatorAuditInlineComment'); 262 + 260 263 $commit = $this->commit; 261 264 262 265 $data = $commit->loadCommitData(); ··· 347 350 PhabricatorObjectHandle $handle, 348 351 PhabricatorMailReplyHandler $reply_handler, 349 352 array $inline_comments) { 353 + assert_instances_of($inline_comments, 'PhabricatorAuditInlineComment'); 350 354 351 355 $commit = $this->commit; 352 356 $user = $this->user;
+2
src/applications/audit/view/commitlist/PhabricatorAuditCommitListView.php
··· 34 34 } 35 35 36 36 public function setCommits(array $commits) { 37 + assert_instances_of($commits, 'PhabricatorRepositoryCommit'); 37 38 $this->commits = $commits; 38 39 return $this; 39 40 } 40 41 41 42 public function setHandles(array $handles) { 43 + assert_instances_of($handles, 'PhabricatorObjectHandle'); 42 44 $this->handles = $handles; 43 45 return $this; 44 46 }
+3
src/applications/audit/view/list/PhabricatorAuditListView.php
··· 27 27 private $showDescriptions = true; 28 28 29 29 public function setAudits(array $audits) { 30 + assert_instances_of($audits, 'PhabricatorRepositoryAuditRequest'); 30 31 $this->audits = $audits; 31 32 return $this; 32 33 } 33 34 34 35 public function setHandles(array $handles) { 36 + assert_instances_of($handles, 'PhabricatorObjectHandle'); 35 37 $this->handles = $handles; 36 38 return $this; 37 39 } ··· 51 53 } 52 54 53 55 public function setCommits(array $commits) { 56 + assert_instances_of($commits, 'PhabricatorRepositoryCommit'); 54 57 $this->commits = mpull($commits, null, 'getPHID'); 55 58 return $this; 56 59 }
+3
src/applications/conduit/controller/log/PhabricatorConduitLogController.php
··· 67 67 } 68 68 69 69 private function renderCallTable(array $calls, array $conns) { 70 + assert_instances_of($calls, 'PhabricatorConduitMethodCallLog'); 71 + assert_instances_of($conns, 'PhabricatorConduitConnectionLog'); 72 + 70 73 $user = $this->getRequest()->getUser(); 71 74 72 75 $rows = array();
+1
src/applications/conduit/method/differential/parsecommitmessage/ConduitAPI_differential_parsecommitmessage_Method.php
··· 96 96 } 97 97 98 98 private function buildLabelMap(array $aux_fields) { 99 + assert_instances_of($aux_fields, 'DifferentialFieldSpecification'); 99 100 $label_map = array(); 100 101 foreach ($aux_fields as $key => $aux_field) { 101 102 $labels = $aux_field->getSupportedCommitMessageLabels();
+1
src/applications/conduit/method/diffusion/getcommits/ConduitAPI_diffusion_getcommits_Method.php
··· 156 156 * Retrieve primary commit information for all referenced commits. 157 157 */ 158 158 private function queryCommitInformation(array $commits, array $repos) { 159 + assert_instances_of($repos, 'PhabricatorRepository'); 159 160 $conn_r = id(new PhabricatorRepositoryCommit())->establishConnection('r'); 160 161 $repos = mpull($repos, null, 'getID'); 161 162
+1
src/applications/conduit/method/maniphest/base/ConduitAPI_maniphest_Method.php
··· 172 172 } 173 173 174 174 protected function buildTaskInfoDictionaries(array $tasks) { 175 + assert_instances_of($tasks, 'ManiphestTask'); 175 176 if (!$tasks) { 176 177 return array(); 177 178 }
+1
src/applications/conduit/method/project/base/ConduitAPI_project_Method.php
··· 27 27 } 28 28 29 29 protected function buildProjectInfoDictionaries(array $projects) { 30 + assert_instances_of($projects, 'PhabricatorProject'); 30 31 if (!$projects) { 31 32 return array(); 32 33 }
+1
src/applications/daemon/view/daemonlogevents/PhabricatorDaemonLogEventsView.php
··· 23 23 private $user; 24 24 25 25 public function setEvents(array $events) { 26 + assert_instances_of($events, 'PhabricatorDaemonLogEvent'); 26 27 $this->events = $events; 27 28 return $this; 28 29 }
+1
src/applications/daemon/view/daemonloglist/PhabricatorDaemonLogListView.php
··· 22 22 private $user; 23 23 24 24 public function setDaemonLogs(array $daemon_logs) { 25 + assert_instances_of($daemon_logs, 'PhabricatorDaemonLog'); 25 26 $this->daemonLogs = $daemon_logs; 26 27 return $this; 27 28 }
+1
src/applications/daemon/view/daemonloglist/__init__.php
··· 12 12 phutil_require_module('phabricator', 'view/utils'); 13 13 14 14 phutil_require_module('phutil', 'markup'); 15 + phutil_require_module('phutil', 'utils'); 15 16 16 17 17 18 phutil_require_source('PhabricatorDaemonLogListView.php');
+1
src/applications/differential/editor/revision/DifferentialRevisionEditor.php
··· 100 100 } 101 101 102 102 public function setAuxiliaryFields(array $auxiliary_fields) { 103 + assert_instances_of($auxiliary_fields, 'DifferentialAuxiliaryField'); 103 104 $this->auxiliaryFields = $auxiliary_fields; 104 105 return $this; 105 106 }
+1
src/applications/differential/view/revisiondetail/DifferentialRevisionDetailView.php
··· 39 39 } 40 40 41 41 public function setAuxiliaryFields(array $fields) { 42 + assert_instances_of($fields, 'DifferentialAuxiliaryField'); 42 43 $this->auxiliaryFields = $fields; 43 44 return $this; 44 45 }
+8 -3
src/applications/directory/controller/main/PhabricatorDirectoryMainController.php
··· 63 63 64 64 } 65 65 66 - private function buildMainResponse($nav, $projects) { 66 + private function buildMainResponse($nav, array $projects) { 67 + assert_instances_of($projects, 'PhabricatorProject'); 68 + 67 69 if (PhabricatorEnv::getEnvConfig('maniphest.enabled')) { 68 70 $unbreak_panel = $this->buildUnbreakNowPanel(); 69 71 $triage_panel = $this->buildNeedsTriagePanel($projects); ··· 131 133 )); 132 134 } 133 135 134 - private function buildFeedResponse($nav, $projects) { 136 + private function buildFeedResponse($nav, array $projects) { 137 + assert_instances_of($projects, 'PhabricatorProject'); 135 138 136 139 $subnav = new AphrontSideNavFilterView(); 137 140 $subnav->setBaseURI(new PhutilURI('/feed/')); ··· 234 237 } 235 238 236 239 private function buildNeedsTriagePanel(array $projects) { 240 + assert_instances_of($projects, 'PhabricatorProject'); 241 + 237 242 $user = $this->getRequest()->getUser(); 238 243 $user_phid = $user->getPHID(); 239 244 ··· 368 373 return $panel; 369 374 } 370 375 371 - 372 376 private function buildTaskListView(array $tasks) { 377 + assert_instances_of($tasks, 'ManiphestTask'); 373 378 $user = $this->getRequest()->getUser(); 374 379 375 380 $phids = array_merge(
+1
src/applications/feed/builder/feed/PhabricatorFeedBuilder.php
··· 22 22 private $framed; 23 23 24 24 public function __construct(array $stories) { 25 + assert_instances_of($stories, 'PhabricatorFeedStory'); 25 26 $this->stories = $stories; 26 27 } 27 28
+1
src/applications/feed/story/base/PhabricatorFeedStory.php
··· 43 43 } 44 44 45 45 final public function setHandles(array $handles) { 46 + assert_instances_of($handles, 'PhabricatorObjectHandle'); 46 47 $this->handles = $handles; 47 48 return $this; 48 49 }
+1
src/applications/flag/view/list/PhabricatorFlagListView.php
··· 22 22 private $user; 23 23 24 24 public function setFlags(array $flags) { 25 + assert_instances_of($flags, 'PhabricatorFlag'); 25 26 $this->flags = $flags; 26 27 return $this; 27 28 }
+1
src/applications/flag/view/list/__init__.php
··· 14 14 phutil_require_module('phabricator', 'view/utils'); 15 15 16 16 phutil_require_module('phutil', 'markup'); 17 + phutil_require_module('phutil', 'utils'); 17 18 18 19 19 20 phutil_require_source('PhabricatorFlagListView.php');
+1
src/applications/herald/adapter/commit/HeraldCommitAdapter.php
··· 190 190 } 191 191 192 192 public function applyHeraldEffects(array $effects) { 193 + assert_instances_of($effects, 'HeraldEffect'); 193 194 194 195 $result = array(); 195 196 foreach ($effects as $effect) {
+1
src/applications/herald/adapter/dryrun/HeraldDryRunAdapter.php
··· 35 35 } 36 36 37 37 public function applyHeraldEffects(array $effects) { 38 + assert_instances_of($effects, 'HeraldEffect'); 38 39 $results = array(); 39 40 foreach ($effects as $effect) { 40 41 $results[] = new HeraldApplyTranscript(
+2
src/applications/herald/adapter/dryrun/__init__.php
··· 9 9 phutil_require_module('phabricator', 'applications/herald/adapter/base'); 10 10 phutil_require_module('phabricator', 'applications/herald/storage/transcript/apply'); 11 11 12 + phutil_require_module('phutil', 'utils'); 13 + 12 14 13 15 phutil_require_source('HeraldDryRunAdapter.php');
+3
src/applications/herald/engine/engine/HeraldEngine.php
··· 40 40 } 41 41 42 42 public function applyRules(array $rules, HeraldObjectAdapter $object) { 43 + assert_instances_of($rules, 'HeraldRule'); 43 44 $t_start = microtime(true); 44 45 45 46 $rules = mpull($rules, null, 'getID'); ··· 122 123 array $effects, 123 124 HeraldObjectAdapter $object, 124 125 array $rules) { 126 + assert_instances_of($effects, 'HeraldEffect'); 127 + assert_instances_of($rules, 'HeraldRule'); 125 128 126 129 $this->transcript->setDryRun($object instanceof HeraldDryRunAdapter); 127 130
+7
src/applications/herald/storage/rule/HeraldRule.php
··· 79 79 } 80 80 81 81 private static function flagDisabledUserRules(array $rules) { 82 + assert_instances_of($rules, 'HeraldRule'); 82 83 83 84 $users = array(); 84 85 foreach ($rules as $rule) { ··· 124 125 } 125 126 126 127 public function attachConditions(array $conditions) { 128 + assert_instances_of($conditions, 'HeraldCondition'); 127 129 $this->conditions = $conditions; 128 130 return $this; 129 131 } ··· 144 146 145 147 public function attachActions(array $actions) { 146 148 // TODO: validate actions have been attached. 149 + assert_instances_of($actions, 'HeraldAction'); 147 150 $this->actions = $actions; 148 151 return $this; 149 152 } ··· 173 176 } 174 177 175 178 public function saveConditions(array $conditions) { 179 + assert_instances_of($conditions, 'HeraldCondition'); 176 180 return $this->saveChildren( 177 181 id(new HeraldCondition())->getTableName(), 178 182 $conditions); 179 183 } 180 184 181 185 public function saveActions(array $actions) { 186 + assert_instances_of($actions, 'HeraldAction'); 182 187 return $this->saveChildren( 183 188 id(new HeraldAction())->getTableName(), 184 189 $actions); 185 190 } 186 191 187 192 protected function saveChildren($table_name, array $children) { 193 + assert_instances_of($children, 'HeraldDAO'); 194 + 188 195 if (!$this->getID()) { 189 196 throw new Exception("Save rule before saving children."); 190 197 }
+1
src/applications/herald/view/edithistory/HeraldRuleEditHistoryView.php
··· 31 31 } 32 32 33 33 public function setHandles(array $handles) { 34 + assert_instances_of($handles, 'PhabricatorObjectHandle'); 34 35 $this->handles = $handles; 35 36 return $this; 36 37 }
+2
src/applications/herald/view/rulelist/HeraldRuleListView.php
··· 26 26 private $user; 27 27 28 28 public function setRules(array $rules) { 29 + assert_instances_of($rules, 'HeraldRule'); 29 30 $this->rules = $rules; 30 31 return $this; 31 32 } 32 33 33 34 public function setHandles(array $handles) { 35 + assert_instances_of($handles, 'PhabricatorObjectHandle'); 34 36 $this->handles = $handles; 35 37 return $this; 36 38 }
+1
src/applications/herald/view/rulelist/__init__.php
··· 12 12 phutil_require_module('phabricator', 'view/control/table'); 13 13 14 14 phutil_require_module('phutil', 'markup'); 15 + phutil_require_module('phutil', 'utils'); 15 16 16 17 17 18 phutil_require_source('HeraldRuleListView.php');
+1 -1
src/applications/maniphest/controller/report/ManiphestReportController.php
··· 321 321 $request = $this->getRequest(); 322 322 $user = $request->getUser(); 323 323 324 - 325 324 $form = id(new AphrontFormView()) 326 325 ->setUser($user) 327 326 ->appendChild( ··· 744 743 } 745 744 746 745 private function renderOldest(array $tasks) { 746 + assert_instances_of($tasks, 'ManiphestTask'); 747 747 $oldest = null; 748 748 foreach ($tasks as $id => $task) { 749 749 if (($oldest === null) ||
+8 -1
src/applications/maniphest/editor/transaction/ManiphestTransactionEditor.php
··· 25 25 private $auxiliaryFields = array(); 26 26 27 27 public function setAuxiliaryFields(array $fields) { 28 + assert_instances_of($fields, 'ManiphestAuxiliaryFieldSpecification'); 28 29 $this->auxiliaryFields = $fields; 29 30 return $this; 30 31 } ··· 34 35 return $this; 35 36 } 36 37 37 - public function applyTransactions($task, array $transactions) { 38 + public function applyTransactions(ManiphestTask $task, array $transactions) { 39 + assert_instances_of($transactions, 'ManiphestTransaction'); 38 40 39 41 $email_cc = $task->getCCPHIDs(); 40 42 ··· 302 304 } 303 305 304 306 private function publishFeedStory(ManiphestTask $task, array $transactions) { 307 + assert_instances_of($transactions, 'ManiphestTransaction'); 308 + 305 309 $actions = array(ManiphestAction::ACTION_UPDATE); 306 310 $comments = null; 307 311 foreach ($transactions as $transaction) { ··· 355 359 } 356 360 357 361 private function isCreate(array $transactions) { 362 + assert_instances_of($transactions, 'ManiphestTransaction'); 358 363 $is_create = false; 359 364 foreach ($transactions as $transaction) { 360 365 $type = $transaction->getTransactionType(); ··· 368 373 } 369 374 370 375 private function getMailTags(array $transactions) { 376 + assert_instances_of($transactions, 'ManiphestTransaction'); 377 + 371 378 $tags = array(); 372 379 foreach ($transactions as $xaction) { 373 380 switch ($xaction->getTransactionType()) {
+1
src/applications/maniphest/query/ManiphestTaskQuery.php
··· 486 486 * TODO: Move this all to the database. 487 487 */ 488 488 private function applyGroupByProject(array $tasks) { 489 + assert_instances_of($tasks, 'ManiphestTask'); 489 490 490 491 $project_phids = array(); 491 492 foreach ($tasks as $task) {
+2
src/applications/maniphest/view/tasklist/ManiphestTaskListView.php
··· 28 28 private $showSubpriorityControls; 29 29 30 30 public function setTasks(array $tasks) { 31 + assert_instances_of($tasks, 'ManiphestTask'); 31 32 $this->tasks = $tasks; 32 33 return $this; 33 34 } 34 35 35 36 public function setHandles(array $handles) { 37 + assert_instances_of($handles, 'PhabricatorObjectHandle'); 36 38 $this->handles = $handles; 37 39 return $this; 38 40 }
+2
src/applications/maniphest/view/tasklist/__init__.php
··· 9 9 phutil_require_module('phabricator', 'applications/maniphest/view/base'); 10 10 phutil_require_module('phabricator', 'applications/maniphest/view/tasksummary'); 11 11 12 + phutil_require_module('phutil', 'utils'); 13 + 12 14 13 15 phutil_require_source('ManiphestTaskListView.php');
+1
src/applications/maniphest/view/taskprojects/ManiphestTaskProjectsView.php
··· 24 24 private $handles; 25 25 26 26 public function setHandles(array $handles) { 27 + assert_instances_of($handles, 'PhabricatorObjectHandle'); 27 28 $this->handles = $handles; 28 29 return $this; 29 30 }
+1
src/applications/maniphest/view/tasksummary/ManiphestTaskSummaryView.php
··· 33 33 } 34 34 35 35 public function setHandles(array $handles) { 36 + assert_instances_of($handles, 'PhabricatorObjectHandle'); 36 37 $this->handles = $handles; 37 38 return $this; 38 39 }
+3
src/applications/maniphest/view/transactiondetail/ManiphestTransactionDetailView.php
··· 36 36 private $auxiliaryFields; 37 37 38 38 public function setAuxiliaryFields(array $fields) { 39 + assert_instances_of($fields, 'ManiphestAuxiliaryFieldSpecification'); 39 40 $this->auxiliaryFields = mpull($fields, null, 'getAuxiliaryKey'); 40 41 return $this; 41 42 } ··· 45 46 } 46 47 47 48 public function setTransactionGroup(array $transactions) { 49 + assert_instances_of($transactions, 'ManiphestTransaction'); 48 50 $this->transactions = $transactions; 49 51 return $this; 50 52 } 51 53 52 54 public function setHandles(array $handles) { 55 + assert_instances_of($handles, 'PhabricatorObjectHandle'); 53 56 $this->handles = $handles; 54 57 return $this; 55 58 }
+3
src/applications/maniphest/view/transactionlist/ManiphestTransactionListView.php
··· 29 29 private $auxiliaryFields; 30 30 31 31 public function setTransactions(array $transactions) { 32 + assert_instances_of($transactions, 'ManiphestTransaction'); 32 33 $this->transactions = $transactions; 33 34 return $this; 34 35 } 35 36 36 37 public function setHandles(array $handles) { 38 + assert_instances_of($handles, 'PhabricatorObjectHandle'); 37 39 $this->handles = $handles; 38 40 return $this; 39 41 } ··· 54 56 } 55 57 56 58 public function setAuxiliaryFields(array $fields) { 59 + assert_instances_of($fields, 'ManiphestAuxiliaryFieldSpecification'); 57 60 $this->auxiliaryFields = $fields; 58 61 return $this; 59 62 }
+2
src/applications/maniphest/view/transactionlist/__init__.php
··· 13 13 phutil_require_module('phabricator', 'infrastructure/celerity/api'); 14 14 phutil_require_module('phabricator', 'infrastructure/javelin/api'); 15 15 16 + phutil_require_module('phutil', 'utils'); 17 + 16 18 17 19 phutil_require_source('ManiphestTransactionListView.php');
+3
src/applications/metamta/replyhandler/base/PhabricatorMailReplyHandler.php
··· 75 75 PhabricatorMetaMTAMail $mail_template, 76 76 array $to_handles, 77 77 array $cc_handles) { 78 + assert_instances_of($to_handles, 'PhabricatorObjectHandle'); 79 + assert_instances_of($cc_handles, 'PhabricatorObjectHandle'); 78 80 79 81 $result = array(); 80 82 ··· 149 151 } 150 152 151 153 protected function formatPHIDList(array $handles) { 154 + assert_instances_of($handles, 'PhabricatorObjectHandle'); 152 155 $list = array(); 153 156 foreach ($handles as $handle) { 154 157 $list[] = '<'.$handle->getPHID().'>';
+2
src/applications/metamta/storage/mail/PhabricatorMetaMTAMail.php
··· 129 129 } 130 130 131 131 public function setAttachments(array $attachments) { 132 + assert_instances_of($attachments, 'PhabricatorMetaMTAAttachment'); 132 133 $this->setParam('attachments', $attachments); 133 134 return $this; 134 135 } ··· 614 615 array $phids, 615 616 array $handles, 616 617 array $exclude) { 618 + assert_instances_of($handles, 'PhabricatorObjectHandle'); 617 619 618 620 $emails = array(); 619 621 foreach ($phids as $phid) {
+1
src/applications/owners/controller/list/PhabricatorOwnersListController.php
··· 204 204 } 205 205 206 206 private function renderPackageTable(array $packages, $header, $nodata) { 207 + assert_instances_of($packages, 'PhabricatorOwnersPackage'); 207 208 208 209 if ($packages) { 209 210 $package_ids = mpull($packages, 'getID');
+1
src/applications/owners/storage/owner/PhabricatorOwnersOwner.php
··· 28 28 } 29 29 30 30 public static function loadAllForPackages(array $packages) { 31 + assert_instances_of($packages, 'PhabricatorOwnersPackage'); 31 32 if (!$packages) { 32 33 return array(); 33 34 }
+1
src/applications/phriction/controller/diff/PhrictionDiffController.php
··· 233 233 } 234 234 235 235 private function renderComparisonTable(array $content) { 236 + assert_instances_of($content, 'PhrictionContent'); 236 237 237 238 $user = $this->getRequest()->getUser(); 238 239
+1
src/applications/project/controller/profile/PhabricatorProjectProfileController.php
··· 270 270 } 271 271 272 272 private function renderStories(array $stories) { 273 + assert_instances_of($stories, 'PhabricatorFeedStory'); 273 274 274 275 $builder = new PhabricatorFeedBuilder($stories); 275 276 $builder->setUser($this->getRequest()->getUser());
+1
src/applications/project/editor/project/PhabricatorProjectEditor.php
··· 35 35 } 36 36 37 37 public function applyTransactions(array $transactions) { 38 + assert_instances_of($transactions, 'PhabricatorProjectTransaction'); 38 39 if (!$this->user) { 39 40 throw new Exception('Call setUser() before save()!'); 40 41 }
+1
src/applications/project/storage/project/PhabricatorProject.php
··· 63 63 } 64 64 65 65 public function attachAffiliations(array $affiliations) { 66 + assert_instances_of($affiliations, 'PhabricatorProjectAffiliation'); 66 67 $this->affiliations = $affiliations; 67 68 return $this; 68 69 }
+2
src/applications/repository/storage/commit/PhabricatorRepositoryCommit.php
··· 86 86 * triggers. 87 87 */ 88 88 public function updateAuditStatus(array $requests) { 89 + assert_instances_of($requests, 'PhabricatorRepositoryAuditRequest'); 90 + 89 91 $any_concern = false; 90 92 $any_accept = false; 91 93 $any_need = false;
+2
src/applications/repository/worker/commitmessageparser/base/PhabricatorRepositoryCommitMessageParserWorker.php
··· 120 120 * committed or abandoned revision as a last resort. 121 121 */ 122 122 private function identifyBestRevision(array $revisions) { 123 + assert_instances_of($revisions, 'DifferentialRevision'); 123 124 // get the simplest, common case out of the way 124 125 if (count($revisions) == 1) { 125 126 return reset($revisions); ··· 165 166 * updated time. This is ostensibly the most recent revision. 166 167 */ 167 168 private function identifyMostRecentRevision(array $revisions) { 169 + assert_instances_of($revisions, 'DifferentialRevision'); 168 170 $revisions = msort($revisions, 'getDateModified'); 169 171 return end($revisions); 170 172 }
+1
src/applications/repository/worker/herald/PhabricatorRepositoryCommitHeraldWorker.php
··· 183 183 PhabricatorRepositoryCommit $commit, 184 184 array $map, 185 185 array $rules) { 186 + assert_instances_of($rules, 'HeraldRule'); 186 187 187 188 $requests = id(new PhabricatorRepositoryAuditRequest())->loadAllWhere( 188 189 'commitPHID = %s',
+12
src/applications/slowvote/controller/poll/PhabricatorSlowvotePollController.php
··· 208 208 } 209 209 210 210 private function renderComments(array $comments, array $handles) { 211 + assert_instances_of($comments, 'PhabricatorSlowvoteComment'); 212 + assert_instances_of($handles, 'PhabricatorObjectHandle'); 213 + 211 214 $viewer = $this->getRequest()->getUser(); 212 215 213 216 $engine = PhabricatorMarkupEngine::newSlowvoteMarkupEngine(); ··· 253 256 PhabricatorSlowvotePoll $poll, 254 257 array $viewer_choices, 255 258 PhabricatorSlowvoteOption $option) { 259 + assert_instances_of($viewer_choices, 'PhabricatorSlowvoteChoice'); 256 260 257 261 $id = $option->getID(); 258 262 switch ($poll->getMethod()) { ··· 325 329 PhabricatorSlowvotePoll $poll, 326 330 array $choices, 327 331 array $chosen) { 332 + assert_instances_of($choices, 'PhabricatorSlowvoteChoice'); 333 + assert_instances_of($chosen, 'PhabricatorSlowvoteChoice'); 328 334 329 335 switch ($poll->getMethod()) { 330 336 case PhabricatorSlowvotePoll::METHOD_PLURALITY: ··· 357 363 array $comments_by_option, 358 364 array $handles, 359 365 array $objects) { 366 + assert_instances_of($options, 'PhabricatorSlowvoteOption'); 367 + assert_instances_of($choices, 'PhabricatorSlowvoteChoice'); 368 + assert_instances_of($comments, 'PhabricatorSlowvoteComment'); 369 + assert_instances_of($viewer_choices, 'PhabricatorSlowvoteChoice'); 370 + assert_instances_of($handles, 'PhabricatorObjectHandle'); 371 + assert_instances_of($objects, 'PhabricatorLiskDAO'); 360 372 361 373 $viewer_phid = $this->getRequest()->getUser()->getPHID(); 362 374
+1
src/view/control/objectselector/PhabricatorObjectSelectorDialog.php
··· 47 47 } 48 48 49 49 public function setHandles(array $handles) { 50 + assert_instances_of($handles, 'PhabricatorObjectHandle'); 50 51 $this->handles = $handles; 51 52 return $this; 52 53 }
+1
src/view/control/objectselector/__init__.php
··· 13 13 phutil_require_module('phabricator', 'view/dialog'); 14 14 15 15 phutil_require_module('phutil', 'markup'); 16 + phutil_require_module('phutil', 'utils'); 16 17 17 18 18 19 phutil_require_source('PhabricatorObjectSelectorDialog.php');