@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.

Fix some if conditions which are always true

Summary: Fix code around some `if` conditions which are always `true` anyway.

Test Plan: Read earlier code in each file; run static code analysis.

Reviewers: O1 Blessed Committers, mainframe98

Reviewed By: O1 Blessed Committers, mainframe98

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Differential Revision: https://we.phorge.it/D26476

+28 -43
+2 -5
src/applications/diffusion/controller/DiffusionBrowseController.php
··· 1020 1020 ->setHeader($header) 1021 1021 ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) 1022 1022 ->addClass('diffusion-mobile-view') 1023 - ->setCollapsed(true); 1024 - 1025 - if ($messages) { 1026 - $corpus->setInfoView( 1023 + ->setCollapsed(true) 1024 + ->setInfoView( 1027 1025 id(new PHUIInfoView()) 1028 1026 ->setSeverity($severity) 1029 1027 ->setErrors($messages)); 1030 - } 1031 1028 1032 1029 return $corpus; 1033 1030 }
+7 -9
src/applications/metamta/management/PhabricatorMailManagementResendWorkflow.php
··· 35 35 'id IN (%Ld)', 36 36 $ids); 37 37 38 - if ($ids) { 39 - $ids = array_fuse($ids); 40 - $missing = array_diff_key($ids, $messages); 41 - if ($missing) { 42 - throw new PhutilArgumentUsageException( 43 - pht( 44 - 'Some specified messages do not exist: %s', 45 - implode(', ', array_keys($missing)))); 46 - } 38 + $ids = array_fuse($ids); 39 + $missing = array_diff_key($ids, $messages); 40 + if ($missing) { 41 + throw new PhutilArgumentUsageException( 42 + pht( 43 + 'Some specified messages do not exist: %s', 44 + implode(', ', array_keys($missing)))); 47 45 } 48 46 49 47 foreach ($messages as $message) {
+7 -9
src/applications/metamta/management/PhabricatorMailManagementShowInboundWorkflow.php
··· 35 35 'id IN (%Ld)', 36 36 $ids); 37 37 38 - if ($ids) { 39 - $ids = array_fuse($ids); 40 - $missing = array_diff_key($ids, $messages); 41 - if ($missing) { 42 - throw new PhutilArgumentUsageException( 43 - pht( 44 - 'Some specified messages do not exist: %s', 45 - implode(', ', array_keys($missing)))); 46 - } 38 + $ids = array_fuse($ids); 39 + $missing = array_diff_key($ids, $messages); 40 + if ($missing) { 41 + throw new PhutilArgumentUsageException( 42 + pht( 43 + 'Some specified messages do not exist: %s', 44 + implode(', ', array_keys($missing)))); 47 45 } 48 46 49 47 $last_key = last_key($messages);
+2 -4
src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
··· 1419 1419 $read_locking = false; 1420 1420 } 1421 1421 1422 - if ($transaction_open) { 1423 - $object->saveTransaction(); 1424 - $transaction_open = false; 1425 - } 1422 + $object->saveTransaction(); 1423 + $transaction_open = false; 1426 1424 1427 1425 $this->didCommitTransactions($object, $xactions); 1428 1426
+3 -7
src/view/page/PhabricatorStandardPageView.php
··· 216 216 217 217 parent::willRenderPage(); 218 218 219 - if (!$this->getRequest()) { 219 + $request = $this->getRequest(); 220 + if (!$request) { 220 221 throw new Exception( 221 222 pht( 222 223 'You must set the %s to render a %s.', ··· 237 238 238 239 Javelin::initBehavior('workflow', array()); 239 240 240 - $request = $this->getRequest(); 241 - $user = null; 242 - if ($request) { 243 - $user = $request->getUser(); 244 - } 245 - 241 + $user = $request->getUser(); 246 242 if ($user) { 247 243 if ($user->isUserActivated()) { 248 244 // Only bother user about timezone offset if they have not set UTC
+7 -9
src/view/phui/PHUIHeaderView.php
··· 303 303 304 304 if ($this->actionItems) { 305 305 $action_list = array(); 306 - if ($this->actionItems) { 307 - foreach ($this->actionItems as $item) { 308 - $action_list[] = phutil_tag( 309 - 'li', 310 - array( 311 - 'class' => 'phui-header-action-item', 312 - ), 313 - $item); 314 - } 306 + foreach ($this->actionItems as $item) { 307 + $action_list[] = phutil_tag( 308 + 'li', 309 + array( 310 + 'class' => 'phui-header-action-item', 311 + ), 312 + $item); 315 313 } 316 314 $right[] = phutil_tag( 317 315 'ul',