5
5
*/
6
6
namespace Magento \Sitemap \Controller \Adminhtml \Sitemap ;
7
7
8
- use Magento \Backend \App \Action ;
8
+ use Magento \Backend \App \Action \Context ;
9
+ use Magento \Framework \App \Action \HttpPostActionInterface ;
9
10
use Magento \Framework \App \Filesystem \DirectoryList ;
10
11
use Magento \Framework \Controller ;
12
+ use Magento \Framework \Validator \StringLength ;
13
+ use Magento \MediaStorage \Model \File \Validator \AvailablePath ;
14
+ use Magento \Sitemap \Model \SitemapFactory ;
11
15
12
- class Save extends \Magento \Sitemap \Controller \Adminhtml \Sitemap
16
+ /**
17
+ * Save sitemap controller.
18
+ */
19
+ class Save extends \Magento \Sitemap \Controller \Adminhtml \Sitemap implements HttpPostActionInterface
13
20
{
14
21
/**
15
22
* Maximum length of sitemap filename
16
23
*/
17
24
const MAX_FILENAME_LENGTH = 32 ;
18
25
19
26
/**
20
- * @var \Magento\Framework\Validator\ StringLength
27
+ * @var StringLength
21
28
*/
22
29
private $ stringValidator ;
23
30
24
31
/**
25
- * @var \Magento\MediaStorage\Model\File\Validator\ AvailablePath
32
+ * @var AvailablePath
26
33
*/
27
34
private $ pathValidator ;
28
35
@@ -37,33 +44,33 @@ class Save extends \Magento\Sitemap\Controller\Adminhtml\Sitemap
37
44
private $ filesystem ;
38
45
39
46
/**
40
- * @var \Magento\Sitemap\Model\ SitemapFactory
47
+ * @var SitemapFactory
41
48
*/
42
49
private $ sitemapFactory ;
43
50
44
51
/**
45
52
* Save constructor.
46
- * @param Action\ Context $context
47
- * @param \Magento\Framework\Validator\ StringLength $stringValidator
48
- * @param \Magento\MediaStorage\Model\File\Validator\ AvailablePath $pathValidator
53
+ * @param Context $context
54
+ * @param StringLength $stringValidator
55
+ * @param AvailablePath $pathValidator
49
56
* @param \Magento\Sitemap\Helper\Data $sitemapHelper
50
57
* @param \Magento\Framework\Filesystem $filesystem
51
- * @param \Magento\Sitemap\Model\ SitemapFactory $sitemapFactory
58
+ * @param SitemapFactory $sitemapFactory
52
59
*/
53
60
public function __construct (
54
- \ Magento \ Backend \ App \ Action \ Context $ context ,
55
- \ Magento \ Framework \ Validator \ StringLength $ stringValidator = null ,
56
- \ Magento \ MediaStorage \ Model \ File \ Validator \ AvailablePath $ pathValidator = null ,
61
+ Context $ context ,
62
+ StringLength $ stringValidator = null ,
63
+ AvailablePath $ pathValidator = null ,
57
64
\Magento \Sitemap \Helper \Data $ sitemapHelper = null ,
58
65
\Magento \Framework \Filesystem $ filesystem = null ,
59
- \ Magento \ Sitemap \ Model \ SitemapFactory $ sitemapFactory = null
66
+ SitemapFactory $ sitemapFactory = null
60
67
) {
61
68
parent ::__construct ($ context );
62
- $ this ->stringValidator = $ stringValidator ?: $ this ->_objectManager ->get (\ Magento \ Framework \ Validator \ StringLength::class);
63
- $ this ->pathValidator = $ pathValidator ?: $ this ->_objectManager ->get (\ Magento \ MediaStorage \ Model \ File \ Validator \ AvailablePath::class);
69
+ $ this ->stringValidator = $ stringValidator ?: $ this ->_objectManager ->get (StringLength::class);
70
+ $ this ->pathValidator = $ pathValidator ?: $ this ->_objectManager ->get (AvailablePath::class);
64
71
$ this ->sitemapHelper = $ sitemapHelper ?: $ this ->_objectManager ->get (\Magento \Sitemap \Helper \Data::class);
65
72
$ this ->filesystem = $ filesystem ?: $ this ->_objectManager ->get (\Magento \Framework \Filesystem::class);
66
- $ this ->sitemapFactory = $ sitemapFactory ?: $ this ->_objectManager ->get (\ Magento \ Sitemap \ Model \ SitemapFactory::class);
73
+ $ this ->sitemapFactory = $ sitemapFactory ?: $ this ->_objectManager ->get (SitemapFactory::class);
67
74
}
68
75
69
76
/**
0 commit comments