Skip to content

Commit

Permalink
Fix command autowiring
Browse files Browse the repository at this point in the history
  • Loading branch information
jmontoyaa committed Dec 16, 2019
1 parent f5fc598 commit 4081a60
Show file tree
Hide file tree
Showing 51 changed files with 100 additions and 205 deletions.
2 changes: 1 addition & 1 deletion config/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ services:
# this creates a service per class whose id is the fully-qualified class name
Chash\:
resource: '../src/*'
exclude: '../src/{DependencyInjection,Entity,Migrations,Tests,Kernel.php}'
exclude: '../src/{DependencyInjection,Command/Common,Entity,Migrations,Tests,Kernel.php}'
1 change: 0 additions & 1 deletion src/Command/Chash/SelfUpdateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

/**
* Class SelfUpdateCommand
* @package Chash\Command\Chash
*/
class SelfUpdateCommand extends AbstractCommand
{
Expand Down
6 changes: 1 addition & 5 deletions src/Command/Chash/SetupCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,11 @@

/**
* Class SetupCommand
* @package Chash\Command\Chash
*/
class SetupCommand extends AbstractCommand
{
public $migrationFile = null;
public $migrationFile;

/**
*
*/
protected function configure(): void
{
$this
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Chash\Command\Email;
namespace Chash\Command\Common;

use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
Expand All @@ -14,11 +14,8 @@
* Class CommonChamiloUserCommand
* @package Chash\Command\User
*/
class CommonChamiloEmailCommand extends Command
class ChamiloEmailCommand extends Command
{
/**
*
*/
protected function configure(): void
{
$this
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,12 @@
<?php

namespace Chash\Command\User;
namespace Chash\Command\Common;

use Chash\Command\Database\CommonDatabaseCommand;
use Symfony\Component\Console\Input\InputArgument;
use Chash\Command\Common\DatabaseCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;

use Symfony\Component\Console\Formatter\OutputFormatterStyle;

/**
* Class CommonChamiloUserCommand
* @package Chash\Command\User
*/
class CommonChamiloUserCommand extends CommonDatabaseCommand
class ChamiloUserCommand extends DatabaseCommand
{
protected function configure(): void
{
Expand All @@ -30,5 +22,4 @@ protected function execute(InputInterface $input, OutputInterface $output)
{
parent::execute($input, $output);
}

}
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
<?php

namespace Chash\Command\Installation;
namespace Chash\Command\Common;

use Doctrine\Common\Annotations\AnnotationReader;
use Doctrine\DBAL\ConnectionException;
use Doctrine\ORM\EntityManager;
use Symfony\Component\Console\Helper\HelperSet;
use Symfony\Component\Yaml\Parser;
//use Doctrine\Migrations\Tools\Console\Command\AbstractCommand;
//use Doctrine\ORM\Tools\Console\Command\SchemaTool\AbstractCommand;
use Symfony\Component\Console\Command\Command as AbstractCommand;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\Filesystem\Exception\IOException;
Expand All @@ -20,7 +18,6 @@

/**
* Class CommonCommand
* @package Chash\Command\Installation
*/
class CommonCommand extends AbstractCommand
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
<?php

namespace Chash\Command\Database;
namespace Chash\Command\Common;

use Symfony\Component\Console\Style\SymfonyStyle;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Chash\Command\Installation\CommonCommand;
use Symfony\Component\Dotenv\Dotenv;
use Exception;

/**
* Class CommonDatabaseCommand
* @package Chash\Command\Database
*/
class CommonDatabaseCommand extends CommonCommand
class DatabaseCommand extends CommonCommand
{
protected function configure(): void
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
<?php

namespace Chash\Command\Info;
namespace Chash\Command\Common;

use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;

use Symfony\Component\Console\Formatter\OutputFormatterStyle;

/**
* Class CommonInfoCommand
* @package Chash\Command\Info
*/
class CommonInfoCommand extends Command
class InfoCommand extends Command
{
protected function configure(): void
{
Expand Down
7 changes: 2 additions & 5 deletions src/Command/Database/DropDatabaseCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,15 @@

namespace Chash\Command\Database;

use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Chash\Command\Common\DatabaseCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Question\ConfirmationQuestion;

/**
* Class DropDatabaseCommand
* @package Chash\Command\Database
*/
class DropDatabaseCommand extends CommonDatabaseCommand
class DropDatabaseCommand extends DatabaseCommand
{
protected function configure(): void
{
Expand Down
9 changes: 2 additions & 7 deletions src/Command/Database/DumpCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@

namespace Chash\Command\Database;

use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Chash\Command\Common\DatabaseCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;

/**
Expand All @@ -16,11 +14,8 @@
*
* @package Chash\Command\Database
*/
class DumpCommand extends CommonDatabaseCommand
class DumpCommand extends DatabaseCommand
{
/**
*
*/
protected function configure(): void
{
parent::configure();
Expand Down
7 changes: 2 additions & 5 deletions src/Command/Database/FullBackupCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Chash\Command\Database;

use Symfony\Component\Console\Command\Command;
use Chash\Command\Common\DatabaseCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
Expand All @@ -15,11 +15,8 @@
* Store the temporary data into the /tmp/ directory
* @param array $params The params received
*/
class FullBackupCommand extends CommonDatabaseCommand
class FullBackupCommand extends DatabaseCommand
{
/**
*
*/
protected function configure(): void
{
parent::configure();
Expand Down
8 changes: 2 additions & 6 deletions src/Command/Database/RestoreCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,18 @@

namespace Chash\Command\Database;

use Symfony\Component\Console\Command\Command;
use Chash\Command\Common\DatabaseCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;

/**
* Imports an SQL dump of the database (caller should use an output redirect of some kind
* to store to a file)
* @param array $params params received
*/
class RestoreCommand extends CommonDatabaseCommand
class RestoreCommand extends DatabaseCommand
{
/**
*
*/
protected function configure(): void
{
parent::configure();
Expand Down
11 changes: 2 additions & 9 deletions src/Command/Database/RunSQLCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,16 @@

namespace Chash\Command\Database;

use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Chash\Command\Common\DatabaseCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;

use Symfony\Component\Console\Formatter\OutputFormatterStyle;

/**
* Connects to the MySQL client without the need to introduce a password
* @return int Exit code returned by mysql command
*/
class RunSQLCommand extends CommonDatabaseCommand
class RunSQLCommand extends DatabaseCommand
{
/**
*
*/
protected function configure(): void
{
parent::configure();
Expand Down
8 changes: 2 additions & 6 deletions src/Command/Database/SQLCountCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,17 @@

namespace Chash\Command\Database;

use Symfony\Component\Console\Command\Command;
use Chash\Command\Common\DatabaseCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;

/**
* Count the number of rows in a specific table
* @return mixed Integer number of rows, or null on error
*/
class SQLCountCommand extends CommonDatabaseCommand
class SQLCountCommand extends DatabaseCommand
{
/**
*
*/
protected function configure(): void
{
parent::configure();
Expand Down
10 changes: 2 additions & 8 deletions src/Command/Database/ShowConnInfoCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,16 @@

namespace Chash\Command\Database;

use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Chash\Command\Common\DatabaseCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Question\ConfirmationQuestion;

/**
* Class ShowConnInfoCommand
* @package Chash\Command\Database
*/
class ShowConnInfoCommand extends CommonDatabaseCommand
class ShowConnInfoCommand extends DatabaseCommand
{
/**
*
*/
protected function configure(): void
{
parent::configure();
Expand Down
3 changes: 2 additions & 1 deletion src/Command/Email/SendEmailCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Chash\Command\Email;

use Chash\Command\Common\ChamiloEmailCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
Expand All @@ -13,7 +14,7 @@
* Command functions meant to deal with what the user of this script is calling
* it for.
*/
class SendEmailCommand extends CommonChamiloEmailCommand
class SendEmailCommand extends ChamiloEmailCommand
{
protected function configure(): void
{
Expand Down
11 changes: 2 additions & 9 deletions src/Command/Files/CleanConfigFilesCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,17 @@

namespace Chash\Command\Files;

use Chash\Command\Database\CommonDatabaseCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Chash\Command\Common\DatabaseCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Question\ConfirmationQuestion;

/**
* Class CleanConfigFilesCommand
* Clean the archives directory, leaving only index.html, twig and Serializer
* @package Chash\Command\Files
*/
class CleanConfigFilesCommand extends CommonDatabaseCommand
class CleanConfigFilesCommand extends DatabaseCommand
{
/**
*
*/
protected function configure(): void
{
parent::configure();
Expand Down
11 changes: 2 additions & 9 deletions src/Command/Files/CleanCoursesFilesCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,17 @@

namespace Chash\Command\Files;

use Chash\Command\Database\CommonDatabaseCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Chash\Command\Common\DatabaseCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Question\ConfirmationQuestion;

/**
* Class CleanCoursesFilesCommand
* Clean the courses directory, leaving only index.html, twig and Serializer
* @package Chash\Command\Files
*/
class CleanCoursesFilesCommand extends CommonDatabaseCommand
class CleanCoursesFilesCommand extends DatabaseCommand
{
/**
*
*/
protected function configure(): void
{
parent::configure();
Expand Down
Loading

0 comments on commit 4081a60

Please sign in to comment.