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 = 'rename'; |
||
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 | * {@inheritdoc} |
||
48 | */ |
||
49 | public function handle(): void |
||
56 | |||
57 | /** |
||
58 | * {@inheritdoc} |
||
59 | */ |
||
60 | protected function configure(): void |
||
64 | |||
65 | /** |
||
66 | * Perform project modifications in order to apply the |
||
67 | * application name on the composer and on the binary. |
||
68 | * |
||
69 | * @return $this |
||
70 | */ |
||
71 | protected function rename(): Renamer |
||
78 | |||
79 | /** |
||
80 | * Display an welcome message. |
||
81 | * |
||
82 | * @return $this |
||
83 | */ |
||
84 | protected function displayWelcomeMessage(): Renamer |
||
90 | |||
91 | /** |
||
92 | * Asks for the application name. |
||
93 | * |
||
94 | * If there is no interaction, we take the folder basename. |
||
95 | * |
||
96 | * @return string |
||
97 | */ |
||
98 | protected function asksForApplicationName(): string |
||
110 | |||
111 | /** |
||
112 | * Update composer json with related information. |
||
113 | * |
||
114 | * @param string $name |
||
115 | * |
||
116 | * @return $this |
||
117 | */ |
||
118 | protected function updateComposer(string $name): Renamer |
||
132 | |||
133 | /** |
||
134 | * Renames the application binary. |
||
135 | * |
||
136 | * @param string $name |
||
137 | * |
||
138 | * @return $this |
||
139 | */ |
||
140 | protected function renameBinary(string $name): Renamer |
||
148 | |||
149 | /** |
||
150 | * Set composer file. |
||
151 | * |
||
152 | * @param string $composer |
||
153 | * |
||
154 | * @return $this |
||
155 | */ |
||
156 | protected function setComposer(string $composer): Renamer |
||
162 | |||
163 | /** |
||
164 | * Returns the current binary name. |
||
165 | * |
||
166 | * @return string |
||
167 | */ |
||
168 | protected function getCurrentBinaryName(): string |
||
174 | |||
175 | /** |
||
176 | * Get composer file. |
||
177 | * |
||
178 | * @return string |
||
179 | */ |
||
180 | protected function getComposer(): string |
||
191 | } |
||
192 |