12
12
use Symfony \Component \Console \Input \InputOption ;
13
13
use Symfony \Component \Console \Input \InputInterface ;
14
14
use Symfony \Component \Console \Output \OutputInterface ;
15
- use Magento \Framework \App \Utility \Files ;
16
- use Magento \Framework \Config \Dom \UrnResolver ;
17
- use Magento \Developer \Model \XmlCatalog \Format \FormatInterface ;
18
- use Magento \Framework \Filesystem ;
19
- use Magento \Framework \Filesystem \Directory \ReadInterface ;
20
15
use Magento \Framework \App \Filesystem \DirectoryList ;
21
- use Magento \Framework \Filesystem \Directory \ReadFactory ;
22
16
23
17
/**
24
18
* Class XmlCatalogGenerateCommand Generates dictionary of URNs for the IDE
25
- * @SuppressWarnings("PMD.CouplingBetweenObjects")
26
19
*/
27
20
class XmlCatalogGenerateCommand extends Command
28
21
{
@@ -37,50 +30,42 @@ class XmlCatalogGenerateCommand extends Command
37
30
const IDE_FILE_PATH_ARGUMENT = 'path ' ;
38
31
39
32
/**
40
- * @var Files
33
+ * @var \Magento\Framework\App\Utility\ Files
41
34
*/
42
35
private $ filesUtility ;
43
36
44
37
/**
45
- * @var UrnResolver
38
+ * @var \Magento\Framework\Config\Dom\ UrnResolver
46
39
*/
47
40
private $ urnResolver ;
48
41
49
42
/**
50
- * @var ReadInterface
51
- */
52
- private $ currentDirRead ;
53
-
54
- /**
55
- * @var ReadInterface
43
+ * @var \Magento\Framework\Filesystem\Directory\ReadInterface
56
44
*/
57
45
private $ rootDirRead ;
58
46
59
47
/**
60
48
* Supported formats
61
49
*
62
- * @var FormatInterface[]
50
+ * @var \Magento\Developer\Model\XmlCatalog\Format\ FormatInterface[]
63
51
*/
64
52
private $ formats ;
65
53
66
54
/**
67
- * @param Files $filesUtility
68
- * @param UrnResolver $urnResolver
69
- * @param Filesystem $filesystemFactory
70
- * @param ReadFactory $readFactory
71
- * @param FormatInterface[] $formats
55
+ * @param \Magento\Framework\App\Utility\Files $filesUtility
56
+ * @param \Magento\Framework\Config\Dom\UrnResolver $urnResolver
57
+ * @param \Magento\Framework\Filesystem $filesystemFactory
58
+ * @param \Magento\Developer\Model\XmlCatalog\Format\FormatInterface[] $formats
72
59
*/
73
60
public function __construct (
74
- Files $ filesUtility ,
75
- UrnResolver $ urnResolver ,
76
- Filesystem $ filesystemFactory ,
77
- ReadFactory $ readFactory ,
61
+ \Magento \Framework \App \Utility \Files $ filesUtility ,
62
+ \Magento \Framework \Config \Dom \UrnResolver $ urnResolver ,
63
+ \Magento \Framework \Filesystem $ filesystemFactory ,
78
64
array $ formats = []
79
65
) {
80
66
$ this ->filesUtility = $ filesUtility ;
81
67
$ this ->urnResolver = $ urnResolver ;
82
68
$ this ->formats = $ formats ;
83
- $ this ->currentDirRead = $ readFactory ->create (getcwd ());
84
69
$ this ->rootDirRead = $ filesystemFactory ->getDirectoryRead (DirectoryList::ROOT );
85
70
parent ::__construct ();
86
71
}
@@ -156,11 +141,10 @@ protected function execute(InputInterface $input, OutputInterface $output)
156
141
{
157
142
$ ideName = $ input ->getOption (self ::IDE_OPTION );
158
143
$ ideFilePath = $ input ->getArgument (self ::IDE_FILE_PATH_ARGUMENT );
159
- $ absolutePath = $ this ->currentDirRead ->getAbsolutePath ($ ideFilePath );
160
144
161
145
$ urnDictionary = $ this ->getUrnDictionary ($ output );
162
146
if ($ formatter = $ this ->getFormatters ($ ideName )) {
163
- $ formatter ->generateCatalog ($ urnDictionary , $ absolutePath );
147
+ $ formatter ->generateCatalog ($ urnDictionary , $ ideFilePath );
164
148
} else {
165
149
throw new InputException (__ ("Format for IDE '%1' is not supported " , $ ideName ));
166
150
}
@@ -170,7 +154,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
170
154
* Get formatter based on format
171
155
*
172
156
* @param string $format
173
- * @return FormatInterface|false
157
+ * @return \Magento\Developer\Model\XmlCatalog\Format\ FormatInterface|false
174
158
*/
175
159
private function getFormatters ($ format )
176
160
{
0 commit comments