From a0e2332cad6876c5217ceabe7bea613a8408cf50 Mon Sep 17 00:00:00 2001 From: Andre Klapper Date: Sat, 10 Jan 2026 09:54:23 +0100 Subject: [PATCH] Replace a few null return values with void for consistency Summary: These private functions are not supposed to return anything as their return value is never read anyway, thus consistently return void instead of null (which makes no technical difference but is easier to read). Test Plan: Look at the other return values in the same function, and the calls of the function. Reviewers: O1 Blessed Committers, mainframe98 Reviewed By: O1 Blessed Committers, mainframe98 Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno Differential Revision: https://we.phorge.it/D26666 --- .../differential/parser/DifferentialChangesetParser.php | 3 +++ src/applications/drydock/worker/DrydockLeaseUpdateWorker.php | 2 +- .../flag/events/PhabricatorFlagsUIEventListener.php | 2 +- .../tokens/event/PhabricatorTokenUIEventListener.php | 4 ++-- .../editor/PhabricatorApplicationTransactionEditor.php | 2 +- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/applications/differential/parser/DifferentialChangesetParser.php b/src/applications/differential/parser/DifferentialChangesetParser.php index 707235187b..1dd654c391 100644 --- a/src/applications/differential/parser/DifferentialChangesetParser.php +++ b/src/applications/differential/parser/DifferentialChangesetParser.php @@ -366,6 +366,9 @@ final class DifferentialChangesetParser extends Phobject { return $this; } + /** + * @return bool + */ private function loadCache() { $render_cache_key = $this->getRenderCacheKey(); if (!$render_cache_key) { diff --git a/src/applications/drydock/worker/DrydockLeaseUpdateWorker.php b/src/applications/drydock/worker/DrydockLeaseUpdateWorker.php index 2ae83da651..205cd469ed 100644 --- a/src/applications/drydock/worker/DrydockLeaseUpdateWorker.php +++ b/src/applications/drydock/worker/DrydockLeaseUpdateWorker.php @@ -279,7 +279,7 @@ final class DrydockLeaseUpdateWorker extends DrydockWorker { $phids = $lease->getAllocatedResourcePHIDs(); if (!$phids) { - return null; + return; } $resources = id(new DrydockResourceQuery()) diff --git a/src/applications/flag/events/PhabricatorFlagsUIEventListener.php b/src/applications/flag/events/PhabricatorFlagsUIEventListener.php index 872b495a93..ef6909adcb 100644 --- a/src/applications/flag/events/PhabricatorFlagsUIEventListener.php +++ b/src/applications/flag/events/PhabricatorFlagsUIEventListener.php @@ -29,7 +29,7 @@ final class PhabricatorFlagsUIEventListener extends PhabricatorEventListener { } if (!$this->canUseApplication($event->getUser())) { - return null; + return; } $flag = PhabricatorFlagQuery::loadUserFlag($user, $object->getPHID()); diff --git a/src/applications/tokens/event/PhabricatorTokenUIEventListener.php b/src/applications/tokens/event/PhabricatorTokenUIEventListener.php index 25a2b44bf1..463621d1b7 100644 --- a/src/applications/tokens/event/PhabricatorTokenUIEventListener.php +++ b/src/applications/tokens/event/PhabricatorTokenUIEventListener.php @@ -42,7 +42,7 @@ final class PhabricatorTokenUIEventListener } if (!$this->canUseApplication($event->getUser())) { - return null; + return; } $can_interact = PhabricatorPolicyFilter::canInteract($user, $object); @@ -93,7 +93,7 @@ final class PhabricatorTokenUIEventListener } if (!$this->canUseApplication($event->getUser())) { - return null; + return; } $tokens_given = id(new PhabricatorTokenGivenQuery()) diff --git a/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php b/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php index 0fd564d8a7..ebd233e28a 100644 --- a/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php +++ b/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php @@ -4963,7 +4963,7 @@ abstract class PhabricatorApplicationTransactionEditor ->withProxyPHIDs($removed_phids) ->execute(); if (!$proxy_columns) { - return array(); + return; } $proxy_phids = mpull($proxy_columns, 'getPHID'); -- 2.51.2