Skip to content

Commit cc5ca3f

Browse files
Merge branch 'MAGETWO-98584' of https://github.com/magento-epam/magento2ce into MAGETWO-98584
2 parents 18dc53f + a7d1f1b commit cc5ca3f

File tree

1 file changed

+12
-14
lines changed
  • app/code/Magento/Backend/Block/Dashboard

1 file changed

+12
-14
lines changed

app/code/Magento/Backend/Block/Dashboard/Graph.php

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ public function __construct(
114114
\Magento\Backend\Helper\Dashboard\Data $dashboardData,
115115
array $data = []
116116
) {
117-
$this->_dashboardData = $dashboardData;
118117
parent::__construct($context, $collectionFactory, $data);
118+
$this->_dashboardData = $dashboardData;
119119
}
120120

121121
/**
@@ -131,7 +131,7 @@ protected function _getTabTemplate()
131131
/**
132132
* Set data rows
133133
*
134-
* @param array $rows
134+
* @param string $rows
135135
* @return void
136136
*/
137137
public function setDataRows($rows)
@@ -155,15 +155,14 @@ public function addSeries($seriesId, array $options)
155155
* Get series
156156
*
157157
* @param string $seriesId
158-
* @return array|false
158+
* @return array|bool
159159
*/
160160
public function getSeries($seriesId)
161161
{
162162
if (isset($this->_allSeries[$seriesId])) {
163163
return $this->_allSeries[$seriesId];
164-
} else {
165-
return false;
166164
}
165+
return false;
167166
}
168167

169168
/**
@@ -308,7 +307,7 @@ public function getChartUrl($directUrl = true)
308307

309308
if ($minvalue >= 0 && $maxvalue >= 0) {
310309
if ($maxvalue > 10) {
311-
$p = pow(10, $this->_getPow($maxvalue));
310+
$p = pow(10, $this->_getPow((int) $maxvalue));
312311
$maxy = ceil($maxvalue / $p) * $p;
313312
$yLabels = range($miny, $maxy, $p);
314313
} else {
@@ -349,7 +348,7 @@ public function getChartUrl($directUrl = true)
349348
$indexid = 0;
350349
foreach ($this->_axisLabels as $idx => $labels) {
351350
if ($idx == 'x') {
352-
$this->formatAxisLabelDate($idx, $timezoneLocal);
351+
$this->formatAxisLabelDate((string) $idx, (string) $timezoneLocal);
353352
$tmpstring = implode('|', $this->_axisLabels[$idx]);
354353
$valueBuffer[] = $indexid . ":|" . $tmpstring;
355354
} elseif ($idx == 'y') {
@@ -369,13 +368,12 @@ public function getChartUrl($directUrl = true)
369368
foreach ($params as $name => $value) {
370369
$p[] = $name . '=' . urlencode($value);
371370
}
372-
return self::API_URL . '?' . implode('&', $p);
373-
} else {
374-
$gaData = urlencode(base64_encode(json_encode($params)));
375-
$gaHash = $this->_dashboardData->getChartDataHash($gaData);
376-
$params = ['ga' => $gaData, 'h' => $gaHash];
377-
return $this->getUrl('adminhtml/*/tunnel', ['_query' => $params]);
371+
return (string) self::API_URL . '?' . implode('&', $p);
378372
}
373+
$gaData = urlencode(base64_encode(json_encode($params)));
374+
$gaHash = $this->_dashboardData->getChartDataHash($gaData);
375+
$params = ['ga' => $gaData, 'h' => $gaHash];
376+
return $this->getUrl('adminhtml/*/tunnel', ['_query' => $params]);
379377
}
380378

381379
/**
@@ -394,7 +392,7 @@ private function formatAxisLabelDate($idx, $timezoneLocal)
394392
switch ($this->getDataHelper()->getParam('period')) {
395393
case '24h':
396394
$this->_axisLabels[$idx][$_index] = $this->_localeDate->formatDateTime(
397-
$period->setTime($period->format('H'), 0, 0),
395+
$period->setTime((int) $period->format('H'), 0, 0),
398396
\IntlDateFormatter::NONE,
399397
\IntlDateFormatter::SHORT
400398
);

0 commit comments

Comments
 (0)