summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsalvis2018-06-25 01:07:11 (GMT)
committersalvis2018-06-25 01:07:11 (GMT)
commite41485e2663b783d926be9eb9c9123b21a0e40bd (patch)
tree3ce38af144bf7f886450a73f942c2e97ef35fb14
parenteb934b2325c3d107f633279a8784de80caae1a1a (diff)
Issue #2951821 by salvis, Chi, rajeshwari10: Fix warning: count(): Parameter must be an array.
-rw-r--r--webprofiler/src/DataCollector/FormsDataCollector.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/webprofiler/src/DataCollector/FormsDataCollector.php b/webprofiler/src/DataCollector/FormsDataCollector.php
index 79f6332..a6a1b40 100644
--- a/webprofiler/src/DataCollector/FormsDataCollector.php
+++ b/webprofiler/src/DataCollector/FormsDataCollector.php
@@ -41,11 +41,11 @@ class FormsDataCollector extends DataCollector implements DrupalDataCollectorInt
* @return array
*/
public function getForms() {
- return $this->data['forms'];
+ return (!empty($this->data['forms']) && is_array($this->data['forms'])) ? $this->data['forms'] : [];
}
/**
- * @return array
+ * @return int
*/
public function getFormsCount() {
return count($this->getForms());