Skip to content

Commit 8983b3c

Browse files
committed
Minor - flint fixes
1 parent c3b9456 commit 8983b3c

File tree

62 files changed

+2180
-2223
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+2180
-2223
lines changed

chash.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
33
* Command-line tool to do things more swiftly in Chamilo.
4-
* To add support for a new command see the Console Component read:
4+
* To add support for a new command see the Console Component read:.
55
*
66
* https://speakerdeck.com/hhamon/symfony-extending-the-console-component
77
* http://symfony.com/doc/2.0/components/console/introduction.html
@@ -28,11 +28,13 @@
2828
use Symfony\Component\Console\Application;
2929

3030
$helpers = [
31-
'configuration' => new Chash\Helpers\ConfigurationHelper()
31+
'configuration' => new Chash\Helpers\ConfigurationHelper(),
3232
];
3333

3434
$application = new Application('Chamilo Command Line Interface', '1.0');
35-
35+
$helpers = [
36+
'configuration' => new Chash\Helpers\ConfigurationHelper()
37+
];
3638
$helperSet = $application->getHelperSet();
3739
foreach ($helpers as $name => $helper) {
3840
$helperSet->set($helper, $name);

createPhar.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
33
* Make sure you have this setting in your php.ini (cli)
4-
* phar.readonly = Off
4+
* phar.readonly = Off.
55
*/
66
error_reporting(-1);
77

src/Command/Chash/SelfUpdateCommand.php

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
namespace Chash\Command\Chash;
44

5+
use Alchemy\Zippy\Zippy;
6+
use Composer\IO\NullIO;
7+
use Composer\Util\RemoteFilesystem;
58
use Doctrine\Migrations\Tools\Console\Command\AbstractCommand;
6-
use Symfony\Component\Console\Input\InputOption;
79
use Symfony\Component\Console;
8-
use Composer\Util\RemoteFilesystem;
9-
use Composer\IO\NullIO;
10-
use Alchemy\Zippy\Zippy;
10+
use Symfony\Component\Console\Input\InputOption;
1111

1212
/**
13-
* Class SelfUpdateCommand
13+
* Class SelfUpdateCommand.
1414
*/
1515
class SelfUpdateCommand extends AbstractCommand
1616
{
@@ -25,29 +25,28 @@ protected function configure(): void
2525
}
2626

2727
/**
28-
* Executes a command via CLI
29-
*
30-
* @param Console\Input\InputInterface $input
31-
* @param Console\Output\OutputInterface $output
28+
* Executes a command via CLI.
3229
*
33-
* @return int|null|void
30+
* @return int|void|null
3431
*/
3532
protected function execute(Console\Input\InputInterface $input, Console\Output\OutputInterface $output)
3633
{
3734
$tempFolder = $input->getOption('temp-folder');
3835
$destinationFolder = $input->getOption('src-destination');
3936

4037
if (empty($destinationFolder)) {
41-
$destinationFolder = realpath(__DIR__.'/../../../chash/');
38+
$destinationFolder = realpath(__DIR__.'/../../../chash/');
4239
}
4340

4441
if (!is_writable($destinationFolder)) {
4542
$output->writeln('Chash update failed: the "'.$destinationFolder.'" directory used to update the Chash file could not be written');
43+
4644
return 0;
4745
}
4846

4947
if (!is_writable($tempFolder)) {
5048
$output->writeln('Chash update failed: the "'.$tempFolder.'" directory used to download the temp file could not be written');
49+
5150
return 0;
5251
}
5352

@@ -62,7 +61,8 @@ protected function execute(Console\Input\InputInterface $input, Console\Output\O
6261
$rfs->copy('github.com', 'https://github.com/chamilo/chash/archive/master.zip', $tempFile);
6362

6463
if (!file_exists($tempFile)) {
65-
$output->writeln('Chash update failed: the "'.$tempFile. '" file could not be written');
64+
$output->writeln('Chash update failed: the "'.$tempFile.'" file could not be written');
65+
6666
return 0;
6767
}
6868

@@ -78,6 +78,7 @@ protected function execute(Console\Input\InputInterface $input, Console\Output\O
7878
} catch (\Alchemy\Zippy\Exception\RunTimeException $e) {
7979
$output->writeln("<comment>Chash update failed during unzip.");
8080
$output->writeln($e->getMessage());
81+
8182
return 0;
8283
}
8384
$fs = new \Symfony\Component\Filesystem\Filesystem();

src/Command/Chash/SetupCommand.php

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,29 @@
33
namespace Chash\Command\Chash;
44

55
use Doctrine\Migrations\Tools\Console\Command\AbstractCommand;
6+
use Symfony\Component\Console;
67
use Symfony\Component\Console\Input\InputArgument;
78
use Symfony\Component\Console\Input\InputOption;
8-
use Symfony\Component\Console;
9-
use Symfony\Component\Yaml\Dumper;
109
use Symfony\Component\Filesystem\Filesystem;
10+
use Symfony\Component\Yaml\Dumper;
1111

1212
/**
13-
* Class SetupCommand
13+
* Class SetupCommand.
1414
*/
1515
class SetupCommand extends AbstractCommand
1616
{
1717
public $migrationFile;
1818

19+
/**
20+
* Gets the migration file path.
21+
*
22+
* @return string
23+
*/
24+
public function getMigrationFile()
25+
{
26+
return $this->migrationFile;
27+
}
28+
1929
protected function configure(): void
2030
{
2131
$this
@@ -27,12 +37,9 @@ protected function configure(): void
2737
}
2838

2939
/**
30-
* Executes a command via CLI
31-
*
32-
* @param Console\Input\InputInterface $input
33-
* @param Console\Output\OutputInterface $output
40+
* Executes a command via CLI.
3441
*
35-
* @return int|null|void
42+
* @return int|void|null
3643
*/
3744
protected function execute(Console\Input\InputInterface $input, Console\Output\OutputInterface $output)
3845
{
@@ -56,8 +63,6 @@ protected function execute(Console\Input\InputInterface $input, Console\Output\O
5663
if ($version == '110') {
5764
$file = $chamiloRoot.'app/config/migrations110.yml';
5865

59-
60-
6166
$this->migrationFile = $file;
6267

6368
return 1;
@@ -74,7 +79,7 @@ protected function execute(Console\Input\InputInterface $input, Console\Output\O
7479
'name' => 'Chamilo Migrations',
7580
'migrations_namespace' => 'Application\Migrations\Schema\V111',
7681
'table_name' => 'version',
77-
'migrations_directory' => $migrationsFolder
82+
'migrations_directory' => $migrationsFolder,
7883
];
7984

8085
$dumper = new Dumper();
@@ -90,13 +95,4 @@ protected function execute(Console\Input\InputInterface $input, Console\Output\O
9095
$output->writeln("<comment>Chash migrations.yml saved: $file</comment>");
9196
$this->migrationFile = $file;
9297
}
93-
94-
/**
95-
* Gets the migration file path
96-
* @return string
97-
*/
98-
public function getMigrationFile()
99-
{
100-
return $this->migrationFile;
101-
}
10298
}

src/Command/Common/ChamiloEmailCommand.php

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,13 @@
33
namespace Chash\Command\Common;
44

55
use Symfony\Component\Console\Command\Command;
6-
use Symfony\Component\Console\Input\InputArgument;
76
use Symfony\Component\Console\Input\InputInterface;
87
use Symfony\Component\Console\Input\InputOption;
98
use Symfony\Component\Console\Output\OutputInterface;
109

11-
use Symfony\Component\Console\Formatter\OutputFormatterStyle;
12-
1310
/**
14-
* Class CommonChamiloUserCommand
11+
* Class CommonChamiloUserCommand.
12+
*
1513
* @package Chash\Command\User
1614
*/
1715
class ChamiloEmailCommand extends Command
@@ -28,9 +26,7 @@ protected function configure(): void
2826
}
2927

3028
/**
31-
* @param InputInterface $input
32-
* @param OutputInterface $output
33-
* @return int|null|void
29+
* @return int|void|null
3430
*/
3531
protected function execute(InputInterface $input, OutputInterface $output)
3632
{

src/Command/Common/ChamiloUserCommand.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace Chash\Command\Common;
44

5-
use Chash\Command\Common\DatabaseCommand;
65
use Symfony\Component\Console\Input\InputInterface;
76
use Symfony\Component\Console\Output\OutputInterface;
87

@@ -14,9 +13,7 @@ protected function configure(): void
1413
}
1514

1615
/**
17-
* @param InputInterface $input
18-
* @param OutputInterface $output
19-
* @return int|null|void
16+
* @return int|void|null
2017
*/
2118
protected function execute(InputInterface $input, OutputInterface $output)
2219
{

0 commit comments

Comments
 (0)