From c77bfd6603746eb903a59ed26d3b3f5c456c1622 Mon Sep 17 00:00:00 2001 From: epriestley Date: Tue, 25 Jun 2013 16:30:06 -0700 Subject: [PATCH] Make EdgeQuery return `array()` for empty data instead of `null` Summary: Ref T2852. When we pull edge data and an edge has none, we currently populate `null` in the results. This is inconvenient and makes `idx()`'ing it clumsy. Instead, populate `array()` for empty. (We've barely used edge data anywhere so far, which is why this hasn't come up before, but I have some use cases for it now.) Test Plan: - Trivial / used in future diff. - Verified existing edge data callsites don't care about this API change (there are only 3). Reviewers: btrahan, chad Reviewed By: chad CC: aran Maniphest Tasks: T2852 Differential Revision: https://secure.phabricator.com/D6293 --- src/infrastructure/edges/query/PhabricatorEdgeQuery.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/infrastructure/edges/query/PhabricatorEdgeQuery.php b/src/infrastructure/edges/query/PhabricatorEdgeQuery.php index 160aff9b0b..90bc8c807a 100644 --- a/src/infrastructure/edges/query/PhabricatorEdgeQuery.php +++ b/src/infrastructure/edges/query/PhabricatorEdgeQuery.php @@ -189,7 +189,7 @@ final class PhabricatorEdgeQuery extends PhabricatorQuery { } } foreach ($edges as $key => $edge) { - $edges[$key]['data'] = idx($data_map, $edge['dataID']); + $edges[$key]['data'] = idx($data_map, $edge['dataID'], array()); } }