@@ -114,8 +114,8 @@ public function __construct(
114
114
\Magento \Backend \Helper \Dashboard \Data $ dashboardData ,
115
115
array $ data = []
116
116
) {
117
- $ this ->_dashboardData = $ dashboardData ;
118
117
parent ::__construct ($ context , $ collectionFactory , $ data );
118
+ $ this ->_dashboardData = $ dashboardData ;
119
119
}
120
120
121
121
/**
@@ -131,7 +131,7 @@ protected function _getTabTemplate()
131
131
/**
132
132
* Set data rows
133
133
*
134
- * @param array $rows
134
+ * @param string $rows
135
135
* @return void
136
136
*/
137
137
public function setDataRows ($ rows )
@@ -155,15 +155,14 @@ public function addSeries($seriesId, array $options)
155
155
* Get series
156
156
*
157
157
* @param string $seriesId
158
- * @return array|false
158
+ * @return array|bool
159
159
*/
160
160
public function getSeries ($ seriesId )
161
161
{
162
162
if (isset ($ this ->_allSeries [$ seriesId ])) {
163
163
return $ this ->_allSeries [$ seriesId ];
164
- } else {
165
- return false ;
166
164
}
165
+ return false ;
167
166
}
168
167
169
168
/**
@@ -308,7 +307,7 @@ public function getChartUrl($directUrl = true)
308
307
309
308
if ($ minvalue >= 0 && $ maxvalue >= 0 ) {
310
309
if ($ maxvalue > 10 ) {
311
- $ p = pow (10 , $ this ->_getPow ($ maxvalue ));
310
+ $ p = pow (10 , $ this ->_getPow (( int ) $ maxvalue ));
312
311
$ maxy = ceil ($ maxvalue / $ p ) * $ p ;
313
312
$ yLabels = range ($ miny , $ maxy , $ p );
314
313
} else {
@@ -349,7 +348,7 @@ public function getChartUrl($directUrl = true)
349
348
$ indexid = 0 ;
350
349
foreach ($ this ->_axisLabels as $ idx => $ labels ) {
351
350
if ($ idx == 'x ' ) {
352
- $ this ->formatAxisLabelDate ($ idx , $ timezoneLocal );
351
+ $ this ->formatAxisLabelDate (( string ) $ idx , ( string ) $ timezoneLocal );
353
352
$ tmpstring = implode ('| ' , $ this ->_axisLabels [$ idx ]);
354
353
$ valueBuffer [] = $ indexid . ":| " . $ tmpstring ;
355
354
} elseif ($ idx == 'y ' ) {
@@ -369,13 +368,12 @@ public function getChartUrl($directUrl = true)
369
368
foreach ($ params as $ name => $ value ) {
370
369
$ p [] = $ name . '= ' . urlencode ($ value );
371
370
}
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 );
378
372
}
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 ]);
379
377
}
380
378
381
379
/**
@@ -394,7 +392,7 @@ private function formatAxisLabelDate($idx, $timezoneLocal)
394
392
switch ($ this ->getDataHelper ()->getParam ('period ' )) {
395
393
case '24h ' :
396
394
$ this ->_axisLabels [$ idx ][$ _index ] = $ this ->_localeDate ->formatDateTime (
397
- $ period ->setTime ($ period ->format ('H ' ), 0 , 0 ),
395
+ $ period ->setTime (( int ) $ period ->format ('H ' ), 0 , 0 ),
398
396
\IntlDateFormatter::NONE ,
399
397
\IntlDateFormatter::SHORT
400
398
);
0 commit comments