@@ -86,6 +86,12 @@ protected function executeCommand(InputInterface $input, OutputInterface $output
8686 return Cli::RETURN_SUCCESS ;
8787 }
8888
89+ /**
90+ * Resolve theme code from argument or interactive prompt.
91+ *
92+ * @param string|null $themeCode
93+ * @return string|null
94+ */
8995 private function selectTheme (?string $ themeCode ): ?string
9096 {
9197 if (!empty ($ themeCode )) {
@@ -112,6 +118,13 @@ private function selectTheme(?string $themeCode): ?string
112118 }
113119 }
114120
121+ /**
122+ * Validate that the theme exists and is a Hyva theme.
123+ *
124+ * @param string $themeCode
125+ * @param OutputInterface $output
126+ * @return string|null
127+ */
115128 private function validateHyvaTheme (string $ themeCode , OutputInterface $ output ): ?string
116129 {
117130 $ themePath = $ this ->themePath ->getPath ($ themeCode );
@@ -150,6 +163,13 @@ private function validateHyvaTheme(string $themeCode, OutputInterface $output):
150163 return $ themePath ;
151164 }
152165
166+ /**
167+ * Validate that the tailwind directory exists for the theme.
168+ *
169+ * @param string $themePath
170+ * @param string $themeCode
171+ * @return string|null
172+ */
153173 private function validateTailwindDirectory (string $ themePath , string $ themeCode ): ?string
154174 {
155175 $ tailwindPath = rtrim ($ themePath , '/ ' ) . '/web/tailwind ' ;
@@ -167,6 +187,14 @@ private function validateTailwindDirectory(string $themePath, string $themeCode)
167187 return $ tailwindPath ;
168188 }
169189
190+ /**
191+ * Run token generation in the tailwind directory.
192+ *
193+ * @param string $tailwindPath
194+ * @param string $themeCode
195+ * @param bool $isVerbose
196+ * @return bool
197+ */
170198 private function generateTokens (string $ tailwindPath , string $ themeCode , bool $ isVerbose ): bool
171199 {
172200 if ($ isVerbose ) {
@@ -197,6 +225,14 @@ private function generateTokens(string $tailwindPath, string $themeCode, bool $i
197225 }
198226 }
199227
228+ /**
229+ * Report and store generated token output.
230+ *
231+ * @param string $tailwindPath
232+ * @param string $themePath
233+ * @param string $themeCode
234+ * @return void
235+ */
200236 private function handleOutputFile (string $ tailwindPath , string $ themePath , string $ themeCode ): void
201237 {
202238 $ isVendorTheme = str_contains ($ themePath , '/vendor/ ' );
@@ -215,6 +251,13 @@ private function handleOutputFile(string $tailwindPath, string $themePath, strin
215251 $ this ->io ->newLine ();
216252 }
217253
254+ /**
255+ * Copy generated tokens to var/generated for vendor themes.
256+ *
257+ * @param string $sourceFilePath
258+ * @param string $themeCode
259+ * @return string
260+ */
218261 private function copyToVarGenerated (string $ sourceFilePath , string $ themeCode ): string
219262 {
220263 $ currentDir = getcwd ();
0 commit comments