36
36
*/
37
37
abstract class DownloadCommand extends Command
38
38
{
39
- /** @var Filesystem */
39
+ /**
40
+ * @var Filesystem
41
+ */
40
42
protected $ fs ;
41
- /** @var OutputInterface */
43
+
44
+ /**
45
+ * @var OutputInterface
46
+ */
42
47
protected $ output ;
48
+
49
+ /**
50
+ * @var string
51
+ */
43
52
protected $ projectName ;
53
+
54
+ /**
55
+ * @var string
56
+ */
44
57
protected $ projectDir ;
45
58
59
+ /**
60
+ * @var string
61
+ */
62
+ protected $ version ;
63
+
64
+ /**
65
+ * @var string
66
+ */
67
+ protected $ downloadedFilePath ;
68
+
69
+ /**
70
+ * @var array
71
+ */
72
+ protected $ requirementsErrors = array ();
73
+
46
74
/**
47
75
* Returns the type of the downloaded application in a human readable format.
48
76
* It's mainly used to display readable error messages.
@@ -62,14 +90,16 @@ protected function initialize(InputInterface $input, OutputInterface $output)
62
90
$ this ->fs = new Filesystem ();
63
91
64
92
$ this ->enableSignalHandler ();
93
+
94
+ $ this ->version = $ input ->hasArgument ('version ' ) ? trim ($ input ->getArgument ('version ' )) : 'latest ' ;
65
95
}
66
96
67
97
/**
68
98
* Chooses the best compressed file format to download (ZIP or TGZ) depending upon the
69
99
* available operating system uncompressing commands and the enabled PHP extensions
70
100
* and it downloads the file.
71
101
*
72
- * @return Command
102
+ * @return $this
73
103
*
74
104
* @throws \RuntimeException if the Symfony archive could not be downloaded
75
105
*/
@@ -200,7 +230,7 @@ protected function getGuzzleClient()
200
230
* Extracts the compressed Symfony file (ZIP or TGZ) using the
201
231
* native operating system commands if available or PHP code otherwise.
202
232
*
203
- * @return NewCommand
233
+ * @return DownloadCommand
204
234
*
205
235
* @throws \RuntimeException if the downloaded archive could not be extracted
206
236
*/
@@ -256,7 +286,7 @@ protected function extract()
256
286
/**
257
287
* Checks if environment meets symfony requirements.
258
288
*
259
- * @return Command
289
+ * @return $this
260
290
*/
261
291
protected function checkSymfonyRequirements ()
262
292
{
@@ -280,7 +310,7 @@ protected function checkSymfonyRequirements()
280
310
/**
281
311
* Creates the appropriate .gitignore file for a Symfony project.
282
312
*
283
- * @return Command
313
+ * @return $this
284
314
*/
285
315
protected function createGitIgnore ()
286
316
{
@@ -438,7 +468,7 @@ protected function isEmptyDirectory($dir)
438
468
*/
439
469
protected function isSymfony3 ()
440
470
{
441
- return '3 ' === $ this ->version [0 ];
471
+ return $ this -> version && '3 ' === $ this ->version [0 ];
442
472
}
443
473
444
474
private function enableSignalHandler ()
0 commit comments