1 | <?php |
||
10 | class Application |
||
11 | { |
||
12 | /** |
||
13 | * Create a new console application |
||
14 | * |
||
15 | * @param Injector|null $injector |
||
16 | * @param ConfigurationSet|null $configuration |
||
17 | * @param CommandSet|null $commands |
||
18 | * |
||
19 | * @return static |
||
20 | */ |
||
21 | public static function build( |
||
32 | |||
33 | /** |
||
34 | * @var Injector |
||
35 | */ |
||
36 | private $injector; |
||
37 | |||
38 | /** |
||
39 | * @var ConfigurationSet |
||
40 | */ |
||
41 | private $configuration; |
||
42 | |||
43 | /** |
||
44 | * @var CommandSet |
||
45 | */ |
||
46 | private $commands; |
||
47 | |||
48 | /** |
||
49 | * @param Injector|null $injector |
||
50 | * @param ConfigurationSet|null $configuration |
||
51 | * @param CommandSet|null $commands |
||
52 | */ |
||
53 | public function __construct( |
||
62 | |||
63 | /** |
||
64 | * Set configuration |
||
65 | * |
||
66 | * @param array $configuration |
||
67 | * |
||
68 | * @return $this |
||
69 | */ |
||
70 | public function setConfiguration(array $configuration) |
||
75 | |||
76 | /** |
||
77 | * Set commands |
||
78 | * |
||
79 | * @param array $commands |
||
80 | * |
||
81 | * @return $this |
||
82 | */ |
||
83 | public function setCommands(array $commands) |
||
88 | |||
89 | /** |
||
90 | * Start the console application |
||
91 | * |
||
92 | * @return int 0 if everything went fine, or an error code |
||
93 | */ |
||
94 | public function run() |
||
106 | } |
||
107 |