1 | <?php |
||
15 | abstract class Command extends SymfonyCommand |
||
16 | { |
||
17 | protected $kernel; |
||
18 | |||
19 | /** @var InputInterface */ |
||
20 | protected $input; |
||
21 | |||
22 | /** @var SymfonyStyle */ |
||
23 | protected $output; |
||
24 | |||
25 | 1 | public function __construct(Kernel $kernel) |
|
31 | |||
32 | protected function execute(InputInterface $input, OutputInterface $output) |
||
39 | |||
40 | /** |
||
41 | * Get argument value. |
||
42 | * |
||
43 | * @param string $name |
||
44 | * |
||
45 | * @return mixed |
||
46 | * |
||
47 | * @throws \Symfony\Component\Console\Exception\InvalidArgumentException |
||
48 | */ |
||
49 | protected function getArgument(string $name) |
||
53 | |||
54 | /** |
||
55 | * Write a message. |
||
56 | * |
||
57 | * @param string $message |
||
58 | */ |
||
59 | protected function line(string $message): void |
||
63 | |||
64 | /** |
||
65 | * Display success message. |
||
66 | * |
||
67 | * @param string $message |
||
68 | */ |
||
69 | protected function success(string $message): void |
||
73 | |||
74 | /** |
||
75 | * Display info message. |
||
76 | * |
||
77 | * @param string $message |
||
78 | */ |
||
79 | protected function info(string $message): void |
||
83 | |||
84 | /** |
||
85 | * Display warning message. |
||
86 | * |
||
87 | * @param string $message |
||
88 | */ |
||
89 | protected function warning(string $message): void |
||
93 | |||
94 | /** |
||
95 | * Display error message. |
||
96 | * |
||
97 | * @param string $message |
||
98 | */ |
||
99 | protected function error(string $message): void |
||
103 | |||
104 | /** |
||
105 | * Prompt the user for input. |
||
106 | * |
||
107 | * @param string $message |
||
108 | * |
||
109 | * @return string |
||
110 | */ |
||
111 | protected function input(string $message): string |
||
115 | |||
116 | /** |
||
117 | * Display confirmation input. |
||
118 | * |
||
119 | * @param string $message |
||
120 | * |
||
121 | * @return bool |
||
122 | */ |
||
123 | protected function confirm(string $message): bool |
||
127 | |||
128 | /** |
||
129 | * Get filesystem instance. |
||
130 | * |
||
131 | * @return FilesystemInterface |
||
132 | * |
||
133 | * @throws \League\Flysystem\FilesystemNotFoundException |
||
134 | * @throws \Psr\Container\ContainerExceptionInterface |
||
135 | */ |
||
136 | protected function filesystem(): FilesystemInterface |
||
143 | |||
144 | /** |
||
145 | * Handle command. |
||
146 | */ |
||
147 | abstract public function handle(): void; |
||
148 | } |
||
149 |