forked from phpbrew/phpbrew
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGenerator.php
More file actions
31 lines (28 loc) · 834 Bytes
/
Copy pathGenerator.php
File metadata and controls
31 lines (28 loc) · 834 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php
namespace command;
use GenPHP\Flavor\BaseGenerator;
use GenPHP\Flavor\FlavorDirectory;
use GenPHP\Path;
use Exception;
class Generator extends BaseGenerator
{
public function brief()
{
return "phpbrew command generator";
}
/**
* generate new flavor
*
* @param string $name flavor name, lower case, alphabets
* @param string $path your code base path
*/
public function generate($commandName)
{
$commandClass = ucfirst($commandName) . 'Command';
$commandFile = 'src' . DIRECTORY_SEPARATOR . 'PhpBrew' . DIRECTORY_SEPARATOR . 'Command' . DIRECTORY_SEPARATOR . $commandClass . '.php';
$this->render( 'Command.php.twig', $commandFile, array(
'commandClass' => $commandClass,
'brief' => 'new command',
));
}
}