-
Notifications
You must be signed in to change notification settings - Fork 48
/
Copy pathConsoleEvent.php
68 lines (44 loc) · 1.88 KB
/
ConsoleEvent.php
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<?php declare(strict_types=1);
/**
* The file is part of inhere/console
*
* @author https://github.com/inhere
* @homepage https://github.com/inhere/php-console
* @license https://github.com/inhere/php-console/blob/master/LICENSE
*/
namespace Inhere\Console;
/**
* Class ConsoleEvent
* - event name list
*
* @package Inhere\Console
*/
final class ConsoleEvent
{
// ----- application
public const ON_BEFORE_RUN = 'app.beforeRun';
public const ON_AFTER_RUN = 'app.afterRun';
public const ON_RUN_ERROR = 'app.runError';
public const ON_STOP_RUN = 'app.stopRun';
// on group OR command not found
public const ON_NOT_FOUND = 'app.notFound';
public const BEFORE_RENDER_APP_HELP = 'app.help.render.before';
public const BEFORE_RENDER_APP_VERSION = 'app.version.render.before';
public const BEFORE_RENDER_APP_COMMANDS_LIST = 'app.commands.list.render.before';
// ----- group command and subcommand
// every command/subcommand run will fire it
public const COMMAND_RUN_BEFORE = 'every.command.run.before';
// every command/subcommand exec will fire it
public const COMMAND_EXEC_BEFORE = 'every.command.exec.before';
public const COMMAND_EXEC_AFTER = 'every.command.exec.after';
public const SUBCOMMAND_RUN_BEFORE = 'group.subcommand.run.before';
// ----- group/subcommand
public const SUBCOMMAND_NOT_FOUND = 'group.subcommand.not.found';
public const BEFORE_RENDER_GROUP_HELP = 'group.help.render.before';
public const AFTER_RENDER_GROUP_HELP = 'group.help.render.after';
public const BEFORE_RENDER_SUBCOMMAND_HELP = 'group.command.help.render.before';
public const AFTER_RENDER_SUBCOMMAND_HELP = 'group.command.help.render.after';
// ----- command
public const BEFORE_RENDER_COMMAND_HELP = 'command.help.render.before';
public const AFTER_RENDER_COMMAND_HELP = 'command.help.render.after';
}