1 | <?php |
||
13 | class Renamer extends Command |
||
14 | { |
||
15 | /** |
||
16 | * {@inheritdoc} |
||
17 | */ |
||
18 | protected $signature = 'app:rename {name? : The new name}'; |
||
19 | |||
20 | /** |
||
21 | * {@inheritdoc} |
||
22 | */ |
||
23 | protected $description = 'Perform an application rename'; |
||
24 | |||
25 | /** |
||
26 | * {@inheritdoc} |
||
27 | */ |
||
28 | public function handle(): void |
||
34 | |||
35 | /** |
||
36 | * Perform project modifications in order to apply the |
||
37 | * application name on the composer and on the binary. |
||
38 | * |
||
39 | * @return $this |
||
40 | */ |
||
41 | protected function rename(): self |
||
54 | |||
55 | /** |
||
56 | * Display an welcome message. |
||
57 | * |
||
58 | * @return $this |
||
59 | */ |
||
60 | protected function displayWelcomeMessage(): self |
||
64 | |||
65 | /** |
||
66 | * Asks for the application name. |
||
67 | * |
||
68 | * If there is no interaction, we take the folder basename. |
||
69 | * |
||
70 | * @return string |
||
71 | */ |
||
72 | protected function asksForApplicationName(): string |
||
84 | |||
85 | /** |
||
86 | * Update composer json with related information. |
||
87 | * |
||
88 | * @param string $name |
||
89 | * |
||
90 | * @return $this |
||
91 | */ |
||
92 | protected function updateComposer(string $name): self |
||
106 | |||
107 | /** |
||
108 | * Renames the application binary. |
||
109 | * |
||
110 | * @param string $name |
||
111 | * |
||
112 | * @return $this |
||
113 | */ |
||
114 | protected function renameBinary(string $name): self |
||
122 | |||
123 | /** |
||
124 | * Set composer file. |
||
125 | * |
||
126 | * @param string $composer |
||
127 | * |
||
128 | * @return $this |
||
129 | */ |
||
130 | protected function setComposer(string $composer): self |
||
136 | |||
137 | /** |
||
138 | * Returns the current binary name. |
||
139 | * |
||
140 | * @return string |
||
141 | */ |
||
142 | protected function getCurrentBinaryName(): string |
||
148 | |||
149 | /** |
||
150 | * Get composer file. |
||
151 | * |
||
152 | * @return string |
||
153 | */ |
||
154 | protected function getComposer(): string |
||
165 | } |
||
166 |