1 | <?php |
||
23 | class Renamer extends AbstractCommand |
||
24 | { |
||
25 | /** |
||
26 | * The name and signature of the console command. |
||
27 | * |
||
28 | * @var string |
||
29 | */ |
||
30 | protected $signature = 'install'; |
||
31 | |||
32 | /** |
||
33 | * The console command description. |
||
34 | * |
||
35 | * @var string |
||
36 | */ |
||
37 | protected $description = 'Rename your application'; |
||
38 | |||
39 | /** |
||
40 | * Holds an instance of SymfonyStyle. |
||
41 | * |
||
42 | * @var \Symfony\Component\Console\Style\SymfonyStyle; |
||
43 | */ |
||
44 | protected $style; |
||
45 | |||
46 | /** |
||
47 | * Execute the console command. |
||
48 | */ |
||
49 | public function handle(): void |
||
56 | |||
57 | /** |
||
58 | * Configure the command options. |
||
59 | * |
||
60 | * Ask for the name of the build. |
||
61 | */ |
||
62 | protected function configure(): void |
||
66 | |||
67 | /** |
||
68 | * Perform project modifications in order to apply the |
||
69 | * application name on the composer and on the binary. |
||
70 | * |
||
71 | * @return $this |
||
72 | */ |
||
73 | protected function install(): Rename |
||
80 | |||
81 | /** |
||
82 | * Display an welcome message. |
||
83 | * |
||
84 | * @return $this |
||
85 | */ |
||
86 | protected function displayWelcomeMessage(): Rename |
||
92 | |||
93 | /** |
||
94 | * Asks for the application name. |
||
95 | * |
||
96 | * If there is no interaction, we take the folder basename. |
||
97 | * |
||
98 | * @return string |
||
99 | */ |
||
100 | protected function asksForApplicationName(): string |
||
112 | |||
113 | /** |
||
114 | * Update composer json with related information. |
||
115 | * |
||
116 | * @param string $name |
||
117 | * |
||
118 | * @return $this |
||
119 | */ |
||
120 | protected function updateComposer(string $name): Rename |
||
134 | |||
135 | /** |
||
136 | * Renames the application binary. |
||
137 | * |
||
138 | * @param string $name |
||
139 | * |
||
140 | * @return $this |
||
141 | */ |
||
142 | protected function rename(string $name): Rename |
||
150 | |||
151 | /** |
||
152 | * Set composer file. |
||
153 | * |
||
154 | * @param string $composer |
||
155 | * |
||
156 | * @return $this |
||
157 | */ |
||
158 | protected function setComposer(string $composer): Rename |
||
164 | |||
165 | /** |
||
166 | * Returns the current binary name. |
||
167 | * |
||
168 | * @return string |
||
169 | */ |
||
170 | protected function getCurrentBinaryName(): string |
||
176 | |||
177 | /** |
||
178 | * Get composer file. |
||
179 | * |
||
180 | * @return string |
||
181 | */ |
||
182 | protected function getComposer(): string |
||
193 | } |
||
194 |