1
1
<?php
2
2
/**
3
- *
4
3
* Copyright © 2015 Magento. All rights reserved.
5
4
* See COPYING.txt for license details.
6
5
*/
@@ -15,11 +14,11 @@ class Save extends \Magento\Sitemap\Controller\Adminhtml\Sitemap
15
14
/**
16
15
* Validate path to generate
17
16
*
18
- * @param $data
17
+ * @param array $data
19
18
* @return bool
20
19
* @throws \Exception
21
20
*/
22
- protected function validatePathToGenerate ($ data )
21
+ protected function validatePathToGenerate (array $ data )
23
22
{
24
23
if (!empty ($ data ['sitemap_filename ' ]) && !empty ($ data ['sitemap_path ' ])) {
25
24
$ data ['sitemap_path ' ] = '/ ' . ltrim ($ data ['sitemap_path ' ], '/ ' );
@@ -45,9 +44,10 @@ protected function validatePathToGenerate($data)
45
44
/**
46
45
* Clear sitemap
47
46
*
48
- * @param $model
47
+ * @param \Magento\Sitemap\Model\Sitemap $model
48
+ * @return void
49
49
*/
50
- protected function clearSiteMap ($ model )
50
+ protected function clearSiteMap (\ Magento \ Sitemap \ Model \ Sitemap $ model )
51
51
{
52
52
/** @var \Magento\Framework\Filesystem\Directory\Write $directory */
53
53
$ directory = $ this ->_objectManager ->get ('Magento\Framework\Filesystem ' )
@@ -68,7 +68,7 @@ protected function clearSiteMap($model)
68
68
* Save model
69
69
*
70
70
* @param array $data
71
- * @return Controller\ Result\Redirect|Controller \Result\Forward
71
+ * @return \Magento\Backend\Model\View\ Result\Redirect|\Magento\Backend\Model\View \Result\Forward
72
72
*/
73
73
protected function saveModel ($ data )
74
74
{
@@ -105,22 +105,22 @@ protected function saveModel($data)
105
105
$ this ->_objectManager ->get ('Magento\Backend\Model\Session ' )->setFormData ($ data );
106
106
// redirect to edit form
107
107
return $ this ->resultFactory ->create (Controller \ResultFactory::TYPE_REDIRECT )
108
- ->setPath ('adminhtml/*/edit ' ,['sitemap_id ' => $ this ->getRequest ()->getParam ('sitemap_id ' )]);
108
+ ->setPath ('adminhtml/*/edit ' , ['sitemap_id ' => $ this ->getRequest ()->getParam ('sitemap_id ' )]);
109
109
}
110
110
}
111
111
112
112
/**
113
113
* Save action
114
114
*
115
- * @return Controller \Result\Redirect
115
+ * @return \Magento\Backend\Model\View \Result\Redirect
116
116
*/
117
117
public function execute ()
118
118
{
119
119
// check if data sent
120
120
$ data = $ this ->getRequest ()->getPostValue ();
121
121
if ($ data ) {
122
122
if (!$ this ->validatePathToGenerate ($ data )) {
123
- /** @var Controller \Result\Redirect $resultRedirect */
123
+ /** @var \Magento\Backend\Model\View \Result\Redirect $resultRedirect */
124
124
$ resultRedirect = $ this ->resultFactory ->create (Controller \ResultFactory::TYPE_REDIRECT );
125
125
return $ resultRedirect ->setPath (
126
126
'adminhtml/*/edit ' ,
@@ -131,5 +131,4 @@ public function execute()
131
131
}
132
132
return $ this ->resultFactory ->create (Controller \ResultFactory::TYPE_REDIRECT )->setPath ('adminhtml/*/ ' );
133
133
}
134
-
135
134
}
0 commit comments