Skip to content

Commit

Permalink
Merge pull request #128 from hamrahpay/patch-1
Browse files Browse the repository at this point in the history
Create ModuleMakeControllerCommand.php
  • Loading branch information
kaidesu committed Dec 3, 2015
2 parents 4e9f225 + 864731c commit c1782c5
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions src/Console/Commands/ModuleMakeControllerCommand.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<?php
namespace Caffeinated\Modules\Console\Commands;

use Caffeinated\Modules\Console\Handlers\ModuleMakeControllerHandler;
use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputArgument;

class ModuleMakeControllerCommand extends Command
{
/**
* @var string $name The console command name.
*/
protected $name = 'module:make:controller';

/**
* @var string $description The console command description.
*/
protected $description = 'Create a new module controller class';

/**
* @var \Caffeinated\Modules\Console\Handlers\ModuleMakeRequestHandler
*/
protected $handler;

/**
* Create a new command instance.
*
* @param \Caffeinated\Modules\Console\Handlers\ModuleMakeRequestHandler $handler
*/
public function __construct(ModuleMakeControllerHandler $handler)
{
parent::__construct();

$this->handler = $handler;
}

/**
* Execute the console command.
*
* @return mixed
*/
public function fire()
{
return $this->handler->fire($this, $this->argument('module'), $this->argument('name'));
}

/**
* Get the console command arguments.
*
* @return array
*/
protected function getArguments()
{
return [
['module', InputArgument::REQUIRED, 'The slug of the module'],
['name', InputArgument::REQUIRED, 'The name of the class']
];
}
}

0 comments on commit c1782c5

Please sign in to comment.