1313use Inhere \Console \IO \Output ;
1414use Inhere \Console \Util \FormatUtil ;
1515use Inhere \Console \Util \Helper ;
16- use Inhere \Console \Util \Annotation ;
16+ use Toolkit \PhpUtil \PhpDoc ;
17+ use Toolkit \StrUtil \Str ;
1718
1819/**
1920 * Class Controller
@@ -94,7 +95,7 @@ public function run(string $command = '')
9495 $ command = $ this ->defaultAction ;
9596 }
9697
97- $ this ->action = FormatUtil ::camelCase ($ this ->getRealCommandName ($ command ));
98+ $ this ->action = Str ::camelCase ($ this ->getRealCommandName ($ command ));
9899
99100 if (!$ this ->action ) {
100101 return $ this ->showHelp ();
@@ -211,7 +212,7 @@ final public function helpCommand(): int
211212 return 0 ;
212213 }
213214
214- $ action = FormatUtil ::camelCase ($ action );
215+ $ action = Str ::camelCase ($ action );
215216 $ method = $ this ->actionSuffix ? $ action . \ucfirst ($ this ->actionSuffix ) : $ action ;
216217 $ aliases = self ::getCommandAliases ($ action );
217218
@@ -236,7 +237,7 @@ final public function showCommandList()
236237 $ sName = \lcfirst (self ::getName () ?: $ ref ->getShortName ());
237238
238239 if (!($ classDes = self ::getDescription ())) {
239- $ classDes = Annotation ::description ($ ref ->getDocComment ()) ?: 'No description for the console controller ' ;
240+ $ classDes = PhpDoc ::description ($ ref ->getDocComment ()) ?: 'No description for the console controller ' ;
240241 }
241242
242243 $ commands = [];
@@ -248,7 +249,7 @@ final public function showCommandList()
248249 continue ;
249250 }
250251
251- $ desc = Annotation ::firstLine ($ m ->getDocComment ()) ?: $ defaultDes ;
252+ $ desc = PhpDoc ::firstLine ($ m ->getDocComment ()) ?: $ defaultDes ;
252253
253254 // is a annotation tag
254255 if (\strpos ($ desc , '@ ' ) === 0 ) {
@@ -318,7 +319,7 @@ protected function getAllCommandMethods(\ReflectionClass $ref = null, $onlyName
318319 $ ref = $ ref ?: new \ReflectionObject ($ this );
319320
320321 $ suffix = $ this ->actionSuffix ;
321- $ suffixLen = Helper:: strLen ($ suffix );
322+ $ suffixLen = Str:: len ($ suffix );
322323
323324 foreach ($ ref ->getMethods () as $ m ) {
324325 $ mName = $ m ->getName ();
@@ -404,7 +405,7 @@ public function getAction(): string
404405 public function setAction (string $ action ): self
405406 {
406407 if ($ action ) {
407- $ this ->action = FormatUtil ::camelCase ($ action );
408+ $ this ->action = Str ::camelCase ($ action );
408409 }
409410
410411 return $ this ;
0 commit comments