Skip to content
This repository was archived by the owner on Nov 14, 2019. It is now read-only.

Commit 13bda0e

Browse files
committed
minor #252 Add missing DocBlock. (regniblod)
This PR was merged into the 1.0-dev branch. Discussion ---------- Add missing DocBlock. Commits ------- 661dc7b Add missing DocBlock.
2 parents 6f0bed6 + 661dc7b commit 13bda0e

File tree

8 files changed

+190
-43
lines changed

8 files changed

+190
-43
lines changed

src/Symfony/Installer/AboutCommand.php

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,26 @@
2222
*/
2323
class AboutCommand extends Command
2424
{
25+
/**
26+
* @var string The current version of the Symfony installer
27+
*/
2528
private $appVersion;
2629

30+
/**
31+
* Constructor.
32+
*
33+
* @param string $appVersion The current version of the Symfony installer
34+
*/
2735
public function __construct($appVersion)
2836
{
2937
parent::__construct();
3038

3139
$this->appVersion = $appVersion;
3240
}
3341

42+
/**
43+
* {@inheritdoc}
44+
*/
3445
protected function configure()
3546
{
3647
$this
@@ -39,6 +50,9 @@ protected function configure()
3950
;
4051
}
4152

53+
/**
54+
* {@inheritdoc}
55+
*/
4256
protected function execute(InputInterface $input, OutputInterface $output)
4357
{
4458
$commandHelp = <<<COMMAND_HELP
@@ -99,7 +113,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
99113
/**
100114
* Returns the executed command.
101115
*
102-
* @return string
116+
* @return string The executed command
103117
*/
104118
private function getExecutedCommand()
105119
{

src/Symfony/Installer/Application.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ class Application extends ConsoleApplication
2424
{
2525
const VERSIONS_URL = 'https://get.symfony.com/symfony.version';
2626

27+
/**
28+
* {@inheritdoc}
29+
*/
2730
public function doRun(InputInterface $input, OutputInterface $output)
2831
{
2932
return parent::doRun($input, $output);

src/Symfony/Installer/DemoCommand.php

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323
*/
2424
class DemoCommand extends DownloadCommand
2525
{
26+
/**
27+
* {@inheritdoc}
28+
*/
2629
protected function configure()
2730
{
2831
$this
@@ -32,6 +35,9 @@ protected function configure()
3235
;
3336
}
3437

38+
/**
39+
* {@inheritdoc}
40+
*/
3541
protected function initialize(InputInterface $input, OutputInterface $output)
3642
{
3743
parent::initialize($input, $output);
@@ -56,6 +62,9 @@ protected function initialize(InputInterface $input, OutputInterface $output)
5662
}
5763
}
5864

65+
/**
66+
* {@inheritdoc}
67+
*/
5968
protected function execute(InputInterface $input, OutputInterface $output)
6069
{
6170
try {
@@ -94,7 +103,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
94103
* Removes all the temporary files and directories created to
95104
* download the demo application.
96105
*
97-
* @return NewCommand
106+
* @return $this
98107
*/
99108
private function cleanUp()
100109
{
@@ -107,7 +116,7 @@ private function cleanUp()
107116
* It displays the message with the result of installing the Symfony Demo
108117
* application and provides some pointers to the user.
109118
*
110-
* @return DemoCommand
119+
* @return $this
111120
*/
112121
private function displayInstallationResult()
113122
{
@@ -145,11 +154,17 @@ private function displayInstallationResult()
145154
return $this;
146155
}
147156

157+
/**
158+
* {@inheritdoc}
159+
*/
148160
protected function getDownloadedApplicationType()
149161
{
150162
return 'the Symfony Demo Application';
151163
}
152164

165+
/**
166+
* {@inheritdoc}
167+
*/
153168
protected function getRemoteFileUrl()
154169
{
155170
return 'http://symfony.com/download?v=Symfony_Demo';

src/Symfony/Installer/DownloadCommand.php

Lines changed: 44 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -38,53 +38,58 @@
3838
abstract class DownloadCommand extends Command
3939
{
4040
/**
41-
* @var Filesystem
41+
* @var Filesystem To dump content to a file
4242
*/
4343
protected $fs;
4444

4545
/**
46-
* @var OutputInterface
46+
* @var OutputInterface To output content
4747
*/
4848
protected $output;
4949

5050
/**
51-
* @var string
51+
* @var string The project name
5252
*/
5353
protected $projectName;
5454

5555
/**
56-
* @var string
56+
* @var string The project dir
5757
*/
5858
protected $projectDir;
5959

6060
/**
61-
* @var string
61+
* @var string The version to install
6262
*/
6363
protected $version = 'latest';
6464

6565
/**
66-
* @var string
66+
* @var string The path to the downloaded file
6767
*/
6868
protected $downloadedFilePath;
6969

7070
/**
71-
* @var array
71+
* @var array The requirement errors
7272
*/
7373
protected $requirementsErrors = array();
7474

7575
/**
7676
* Returns the type of the downloaded application in a human readable format.
7777
* It's mainly used to display readable error messages.
7878
*
79-
* @return string
79+
* @return string The type of the downloaded application in a human readable format
8080
*/
8181
abstract protected function getDownloadedApplicationType();
8282

8383
/**
8484
* Returns the absolute URL of the remote file downloaded by the command.
85+
*
86+
* @return string The absolute URL of the remote file downloaded by the command
8587
*/
8688
abstract protected function getRemoteFileUrl();
8789

90+
/**
91+
* {@inheritdoc}
92+
*/
8893
protected function initialize(InputInterface $input, OutputInterface $output)
8994
{
9095
$this->output = $output;
@@ -100,7 +105,7 @@ protected function initialize(InputInterface $input, OutputInterface $output)
100105
*
101106
* @return $this
102107
*
103-
* @throws \RuntimeException if the Symfony archive could not be downloaded
108+
* @throws \RuntimeException If the Symfony archive could not be downloaded
104109
*/
105110
protected function download()
106111
{
@@ -189,6 +194,13 @@ protected function download()
189194
return $this;
190195
}
191196

197+
/**
198+
* Checks the project name.
199+
*
200+
* @return $this
201+
*
202+
* @throws \RuntimeException If there is already a projet in the specified directory
203+
*/
192204
protected function checkProjectName()
193205
{
194206
if (is_dir($this->projectDir) && !$this->isEmptyDirectory($this->projectDir)) {
@@ -206,7 +218,9 @@ protected function checkProjectName()
206218
* Returns the Guzzle client configured according to the system environment
207219
* (e.g. it takes into account whether it should use a proxy server or not).
208220
*
209-
* @return Client
221+
* @return Client The configured Guzzle client
222+
*
223+
* @throws \RuntimeException If the php-curl is not installed or the allow_url_fopen ini setting is not set
210224
*/
211225
protected function getGuzzleClient()
212226
{
@@ -234,9 +248,9 @@ protected function getGuzzleClient()
234248
* Extracts the compressed Symfony file (ZIP or TGZ) using the
235249
* native operating system commands if available or PHP code otherwise.
236250
*
237-
* @return DownloadCommand
251+
* @return $this
238252
*
239-
* @throws \RuntimeException if the downloaded archive could not be extracted
253+
* @throws \RuntimeException If the downloaded archive could not be extracted
240254
*/
241255
protected function extract()
242256
{
@@ -341,7 +355,7 @@ protected function createGitIgnore()
341355
* Returns the full Symfony version number of the project by getting
342356
* it from the composer.lock file.
343357
*
344-
* @return string
358+
* @return string The installed Symfony version
345359
*/
346360
protected function getInstalledSymfonyVersion()
347361
{
@@ -360,6 +374,10 @@ protected function getInstalledSymfonyVersion()
360374

361375
/**
362376
* Checks if the installer has enough permissions to create the project.
377+
*
378+
* @return $this
379+
*
380+
* @throws IOException If the installer does not have enough permissions to write to the project parent directory
363381
*/
364382
protected function checkPermissions()
365383
{
@@ -399,7 +417,7 @@ protected function formatSize($bytes)
399417
* @param \Requirement $requirement The Symfony requirements
400418
* @param int $lineSize The maximum line length
401419
*
402-
* @return string
420+
* @return string The formatted error message
403421
*/
404422
protected function getErrorMessage(\Requirement $requirement, $lineSize = 70)
405423
{
@@ -416,7 +434,7 @@ protected function getErrorMessage(\Requirement $requirement, $lineSize = 70)
416434
/**
417435
* Generates a good random value for Symfony's 'secret' option.
418436
*
419-
* @return string
437+
* @return string The randomly generated secret
420438
*/
421439
protected function generateRandomSecret()
422440
{
@@ -431,7 +449,7 @@ protected function generateRandomSecret()
431449
* Returns the executed command with all its arguments
432450
* (e.g. "symfony new blog 2.8.1").
433451
*
434-
* @return string
452+
* @return string The executed command with all its arguments
435453
*/
436454
protected function getExecutedCommand()
437455
{
@@ -458,7 +476,7 @@ protected function getExecutedCommand()
458476
*
459477
* @param string $dir the path of the directory to check
460478
*
461-
* @return bool
479+
* @return bool Whether the given directory is empty
462480
*/
463481
protected function isEmptyDirectory($dir)
464482
{
@@ -470,7 +488,7 @@ protected function isEmptyDirectory($dir)
470488
/**
471489
* Checks that the asked version is in the 3.x branch.
472490
*
473-
* @return bool
491+
* @return bool Wheter is Symfony3
474492
*/
475493
protected function isSymfony3()
476494
{
@@ -502,7 +520,7 @@ protected function checkInstallerVersion()
502520
}
503521

504522
/**
505-
* @return boolean Whether the installed version is the latest one
523+
* @return bool Whether the installed version is the latest one
506524
*/
507525
protected function isInstallerUpdated()
508526
{
@@ -515,9 +533,9 @@ protected function isInstallerUpdated()
515533
/**
516534
* Returns the contents obtained by making a GET request to the given URL.
517535
*
518-
* @param string $url
536+
* @param string $url The URL to get the contents from
519537
*
520-
* @return string
538+
* @return string The obtained contents of $url
521539
*/
522540
protected function getUrlContents($url)
523541
{
@@ -526,6 +544,11 @@ protected function getUrlContents($url)
526544
return $client->get($url)->getBody()->getContents();
527545
}
528546

547+
/**
548+
* Enables the signal handler.
549+
*
550+
* @throws AbortException If the execution has been aborted with SIGINT signal.
551+
*/
529552
private function enableSignalHandler()
530553
{
531554
if (!function_exists('pcntl_signal')) {

src/Symfony/Installer/Exception/AbortException.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
namespace Symfony\Installer\Exception;
44

5+
/**
6+
* This exception is thrown when the execution is aborted with the SIGINT signal.
7+
*
8+
* @author Grégoire Pineau <[email protected]>
9+
*/
510
class AbortException extends \RuntimeException
611
{
712
}

0 commit comments

Comments
 (0)