Skip to content

Commit b32bd91

Browse files
committed
Merge pull request #88 from magento-tango/MAGETWO-32571
[Tango] S46 Controller Refactoring, Exceptions, Bug Fixes
2 parents bc18e4c + dfa392b commit b32bd91

File tree

349 files changed

+3543
-1379
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

349 files changed

+3543
-1379
lines changed

app/code/Magento/AdminNotification/Block/System/Messages/UnreadMessagePopup.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public function getUnreadMessages()
6666
/**
6767
* Retrieve popup title
6868
*
69-
* @return string
69+
* @return \Magento\Framework\Phrase
7070
*/
7171
public function getPopupTitle()
7272
{

app/code/Magento/AdminNotification/Model/System/Message/Baseurl.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ public function isDisplayed()
114114
/**
115115
* Retrieve message text
116116
*
117-
* @return string
117+
* @return \Magento\Framework\Phrase
118118
*/
119119
public function getText()
120120
{

app/code/Magento/AdminNotification/Model/System/Message/Media/Synchronization/Error.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ protected function _shouldBeDisplayed()
3131
/**
3232
* Retrieve message text
3333
*
34-
* @return string
34+
* @return \Magento\Framework\Phrase
3535
*/
3636
public function getText()
3737
{

app/code/Magento/AdminNotification/Model/System/Message/Media/Synchronization/Success.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ protected function _shouldBeDisplayed()
3030
/**
3131
* Retrieve message text
3232
*
33-
* @return string
33+
* @return \Magento\Framework\Phrase
3434
*/
3535
public function getText()
3636
{

app/code/Magento/AdminNotification/Model/System/Message/Security.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ public function isDisplayed()
129129
/**
130130
* Retrieve message text
131131
*
132-
* @return string
132+
* @return \Magento\Framework\Phrase
133133
*/
134134
public function getText()
135135
{

app/code/Magento/Backend/Block/System/Account/Edit.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ protected function _construct()
2727
}
2828

2929
/**
30-
* @return string
30+
* @return \Magento\Framework\Phrase
3131
*/
3232
public function getHeaderText()
3333
{

app/code/Magento/Backend/Block/System/Store/Delete.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ protected function _construct()
4949
/**
5050
* Get edit form container header text
5151
*
52-
* @return string
52+
* @return \Magento\Framework\Phrase
5353
*/
5454
public function getHeaderText()
5555
{

app/code/Magento/Backend/Block/System/Variable/Edit.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public function getFormHtml()
9797
/**
9898
* Return translated header text depending on creating/editing action
9999
*
100-
* @return string
100+
* @return \Magento\Framework\Phrase
101101
*/
102102
public function getHeaderText()
103103
{

app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Store.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ protected function _getShowEmptyStoresLabelFlag()
8383
* Render row store views
8484
*
8585
* @param \Magento\Framework\Object $row
86-
* @return string
86+
* @return \Magento\Framework\Phrase|string
8787
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
8888
* @SuppressWarnings(PHPMD.NPathComplexity)
8989
*/
@@ -135,7 +135,7 @@ public function render(\Magento\Framework\Object $row)
135135
* Render row store views for export
136136
*
137137
* @param \Magento\Framework\Object $row
138-
* @return string
138+
* @return \Magento\Framework\Phrase|string
139139
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
140140
*/
141141
public function renderExport(\Magento\Framework\Object $row)
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<?php
2+
/**
3+
* Copyright © 2015 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\Backend\Controller\Adminhtml\Dashboard;
8+
9+
class RefreshStatistics extends \Magento\Reports\Controller\Adminhtml\Report\Statistics
10+
{
11+
/**
12+
* @param \Magento\Backend\App\Action\Context $context
13+
* @param \Magento\Framework\Stdlib\DateTime\Filter\Date $dateFilter
14+
* @param \Magento\Backend\Model\View\Result\RedirectFactory $resultRedirectFactory
15+
* @param array $reportTypes
16+
* @param \Psr\Log\LoggerInterface $logger
17+
*/
18+
public function __construct(
19+
\Magento\Backend\App\Action\Context $context,
20+
\Magento\Framework\Stdlib\DateTime\Filter\Date $dateFilter,
21+
\Magento\Backend\Model\View\Result\RedirectFactory $resultRedirectFactory,
22+
array $reportTypes,
23+
\Psr\Log\LoggerInterface $logger
24+
) {
25+
parent::__construct($context, $dateFilter, $resultRedirectFactory, $reportTypes);
26+
$this->logger = $logger;
27+
}
28+
29+
/**
30+
* @return \Magento\Backend\Model\View\Result\Redirect
31+
*/
32+
public function execute()
33+
{
34+
try {
35+
$collectionsNames = array_values($this->reportTypes);
36+
foreach ($collectionsNames as $collectionName) {
37+
$this->_objectManager->create($collectionName)->aggregate();
38+
}
39+
$this->messageManager->addSuccess(__('We updated lifetime statistic.'));
40+
} catch (\Exception $e) {
41+
$this->messageManager->addError(__('We can\'t refresh lifetime statistics.'));
42+
$this->logger->critical($e);
43+
}
44+
return $this->resultRedirectFactory->create()->setPath('*/*');
45+
}
46+
}

0 commit comments

Comments
 (0)