-
-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathGenerateMessagingCommand.php
More file actions
40 lines (31 loc) · 859 Bytes
/
GenerateMessagingCommand.php
File metadata and controls
40 lines (31 loc) · 859 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
32
33
34
35
36
37
38
39
40
<?php
declare(strict_types=1);
namespace Bow\Console\Command\Generator;
use Bow\Console\AbstractCommand;
use Bow\Console\Color;
use Bow\Console\Generator;
class GenerateMessagingCommand extends AbstractCommand
{
/**
* Generate session
*
* @param string $messaging
* @return void
*/
public function run(string $messaging): void
{
$generator = new Generator(
$this->setting->getMessagingDirectory(),
$messaging
);
if ($generator->fileExists()) {
echo Color::red("The messaging already exists");
exit(1);
}
$generator->write('messaging', [
'baseNamespace' => $this->namespaces['messaging'] ?? "App\\Messaging",
]);
echo Color::green("The messaging has been well created.");
exit(0);
}
}