From 7aab7e80af28f2faadb93cfc3b63a70cc8d59629 Mon Sep 17 00:00:00 2001 From: Mike Riley Date: Sun, 25 Feb 2018 20:12:30 +0000 Subject: [PATCH] Provide default values for table view properties which are `count`ed Summary: PHP 7.2 has changed the behavior of `count`, you must provide an array or `Countable` as a parameter, otherwise a warning is generated. These two class members are counted during rendering, and are commonly left as null properties. https://wiki.php.net/rfc/counting_non_countables Test Plan: Browsed around my install and stopped seeing `count(): Parameter must be an array or an object that implements Countable at [AphrontTableView.php:153]` everywhere. Reviewers: #blessed_reviewers, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: Korvin, epriestley Differential Revision: https://secure.phabricator.com/D19140 --- src/view/control/AphrontTableView.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/view/control/AphrontTableView.php b/src/view/control/AphrontTableView.php index 176d246718..3cca7f89e5 100644 --- a/src/view/control/AphrontTableView.php +++ b/src/view/control/AphrontTableView.php @@ -4,7 +4,7 @@ final class AphrontTableView extends AphrontView { protected $data; protected $headers; - protected $shortHeaders; + protected $shortHeaders = array(); protected $rowClasses = array(); protected $columnClasses = array(); protected $cellClasses = array(); @@ -21,7 +21,7 @@ final class AphrontTableView extends AphrontView { protected $sortParam; protected $sortSelected; protected $sortReverse; - protected $sortValues; + protected $sortValues = array(); private $deviceReadyTable; public function __construct(array $data) {