1 | <?php |
||
14 | abstract class Command extends SymfonyCommand |
||
15 | { |
||
16 | /** @var InputInterface */ |
||
17 | protected $input; |
||
18 | |||
19 | /** @var SymfonyStyle */ |
||
20 | protected $output; |
||
21 | |||
22 | protected function execute(InputInterface $input, OutputInterface $output) |
||
29 | 1 | ||
30 | 1 | /** |
|
31 | * Get argument value. |
||
32 | * |
||
33 | * @param string $name |
||
34 | * |
||
35 | * @return mixed |
||
36 | * |
||
37 | * @throws \Symfony\Component\Console\Exception\InvalidArgumentException |
||
38 | */ |
||
39 | protected function getArgument(string $name) |
||
43 | |||
44 | /** |
||
45 | * Get option value. |
||
46 | * |
||
47 | * @param string $name |
||
48 | * |
||
49 | * @return mixed |
||
50 | * |
||
51 | * @throws \Symfony\Component\Console\Exception\InvalidArgumentException |
||
52 | */ |
||
53 | protected function getOption(string $name) |
||
57 | |||
58 | /** |
||
59 | * Write a message. |
||
60 | * |
||
61 | * @param string $message |
||
62 | */ |
||
63 | protected function line(string $message): void |
||
67 | |||
68 | /** |
||
69 | * Display success message. |
||
70 | * |
||
71 | * @param string $message |
||
72 | */ |
||
73 | protected function success(string $message): void |
||
77 | |||
78 | /** |
||
79 | * Display info message. |
||
80 | * |
||
81 | * @param string $message |
||
82 | */ |
||
83 | protected function info(string $message): void |
||
87 | |||
88 | /** |
||
89 | * Display warning message. |
||
90 | * |
||
91 | * @param string $message |
||
92 | */ |
||
93 | protected function warning(string $message): void |
||
97 | |||
98 | /** |
||
99 | * Display error message. |
||
100 | * |
||
101 | * @param string $message |
||
102 | */ |
||
103 | protected function error(string $message): void |
||
107 | |||
108 | /** |
||
109 | * Prompt the user for input. |
||
110 | * |
||
111 | * @param string $message |
||
112 | * |
||
113 | * @return string |
||
114 | */ |
||
115 | protected function input(string $message): string |
||
119 | |||
120 | /** |
||
121 | * Display confirmation input. |
||
122 | * |
||
123 | * @param string $message |
||
124 | * |
||
125 | * @return bool |
||
126 | */ |
||
127 | protected function confirm(string $message): bool |
||
131 | |||
132 | /** |
||
133 | * Get filesystem instance. |
||
134 | * |
||
135 | * @return FilesystemInterface |
||
136 | * |
||
137 | * @throws \League\Flysystem\FilesystemNotFoundException |
||
138 | * @throws \Psr\Container\ContainerExceptionInterface |
||
139 | */ |
||
140 | protected function filesystem(): FilesystemInterface |
||
147 | |||
148 | /** |
||
149 | * Handle command. |
||
150 | */ |
||
151 | abstract public function handle(): void; |
||
152 | } |
||
153 |