@@ -31,8 +31,12 @@ protected function setup(Options $options)
3131
3232 $ options ->registerCommand ('init ' , 'Initialize a new plugin or template in the current directory. ' );
3333 $ options ->registerCommand ('addTest ' , 'Add the testing framework files and a test. (_test/) ' );
34- $ options ->registerArgument ('test ' , 'Optional name of the new test. Defaults to the general test. ' , false ,
35- 'addTest ' );
34+ $ options ->registerArgument (
35+ 'test ' ,
36+ 'Optional name of the new test. Defaults to the general test. ' ,
37+ false ,
38+ 'addTest '
39+ );
3640 $ options ->registerCommand ('addConf ' , 'Add the configuration files. (conf/) ' );
3741 $ options ->registerCommand ('addLang ' , 'Add the language files. (lang/) ' );
3842
@@ -45,10 +49,18 @@ function (&$item) {
4549 );
4650
4751 $ options ->registerCommand ('addComponent ' , 'Add a new plugin component. ' );
48- $ options ->registerArgument ('type ' , 'Type of the component. Needs to be one of ' . join (', ' , $ types ), true ,
49- 'addComponent ' );
50- $ options ->registerArgument ('name ' , 'Optional name of the component. Defaults to a base component. ' , false ,
51- 'addComponent ' );
52+ $ options ->registerArgument (
53+ 'type ' ,
54+ 'Type of the component. Needs to be one of ' . implode (', ' , $ types ),
55+ true ,
56+ 'addComponent '
57+ );
58+ $ options ->registerArgument (
59+ 'name ' ,
60+ 'Optional name of the component. Defaults to a base component. ' ,
61+ false ,
62+ 'addComponent '
63+ );
5264
5365 $ options ->registerCommand ('deletedFiles ' , 'Create the list of deleted files based on the git history. ' );
5466 $ options ->registerCommand ('rmObsolete ' , 'Delete obsolete files. ' );
@@ -62,21 +74,41 @@ function (&$item) {
6274 );
6375
6476 $ options ->registerCommand ('downloadSvg ' , 'Download an SVG file from a known icon repository. ' );
65- $ options ->registerArgument ('prefix:name ' ,
66- 'Colon-prefixed name of the icon. Available prefixes: ' . join (', ' , $ prefixes ), true , 'downloadSvg ' );
67- $ options ->registerArgument ('output ' , 'File to save, defaults to <name>.svg in current dir ' , false ,
68- 'downloadSvg ' );
69- $ options ->registerOption ('keep-ns ' , 'Keep the SVG namespace. Use when the file is not inlined into HTML. ' , 'k ' ,
70- false , 'downloadSvg ' );
77+ $ options ->registerArgument (
78+ 'prefix:name ' ,
79+ 'Colon-prefixed name of the icon. Available prefixes: ' . implode (', ' , $ prefixes ),
80+ true ,
81+ 'downloadSvg '
82+ );
83+ $ options ->registerArgument (
84+ 'output ' ,
85+ 'File to save, defaults to <name>.svg in current dir ' ,
86+ false ,
87+ 'downloadSvg '
88+ );
89+ $ options ->registerOption (
90+ 'keep-ns ' ,
91+ 'Keep the SVG namespace. Use when the file is not inlined into HTML. ' ,
92+ 'k ' ,
93+ false ,
94+ 'downloadSvg '
95+ );
7196
7297 $ options ->registerCommand ('cleanSvg ' , 'Clean a existing SVG files to reduce their file size. ' );
7398 $ options ->registerArgument ('files... ' , 'The files to clean (will be overwritten) ' , true , 'cleanSvg ' );
74- $ options ->registerOption ('keep-ns ' , 'Keep the SVG namespace. Use when the file is not inlined into HTML. ' , 'k ' ,
75- false , 'cleanSvg ' );
99+ $ options ->registerOption (
100+ 'keep-ns ' ,
101+ 'Keep the SVG namespace. Use when the file is not inlined into HTML. ' ,
102+ 'k ' ,
103+ false ,
104+ 'cleanSvg '
105+ );
76106
77- $ options ->registerCommand ('cleanLang ' ,
107+ $ options ->registerCommand (
108+ 'cleanLang ' ,
78109 'Clean language files from unused language strings. Detecting which strings are truly in use may ' .
79- 'not always correctly work. Use with caution. ' );
110+ 'not always correctly work. Use with caution. '
111+ );
80112
81113 $ options ->registerCommand ('test ' , 'Run the unit tests for this extension. ' );
82114
@@ -243,7 +275,7 @@ protected function deleteFile($file)
243275 protected function git (...$ args )
244276 {
245277 $ args = array_map ('escapeshellarg ' , $ args );
246- $ cmd = 'git ' . join (' ' , $ args );
278+ $ cmd = 'git ' . implode (' ' , $ args );
247279 $ output = [];
248280 $ result = 0 ;
249281
@@ -363,14 +395,14 @@ protected function cmdDeletedFiles()
363395 });
364396 sort ($ output );
365397
366- if (! count ( $ output) ) {
398+ if ($ output === [] ) {
367399 $ this ->info ('No deleted files found ' );
368400 return 0 ;
369401 }
370402
371403 $ content = "# This is a list of files that were present in previous releases \n" .
372404 "# but were removed later. They should not exist in your installation. \n" .
373- join ("\n" , $ output ) . "\n" ;
405+ implode ("\n" , $ output ) . "\n" ;
374406
375407 file_put_contents ('deleted.files ' , $ content );
376408 $ this ->success ('written deleted.files ' );
@@ -464,7 +496,7 @@ protected function cmdTest()
464496 '--configuration ' , fullpath (__DIR__ . '/../../../_test/phpunit.xml ' ),
465497 '--group ' , $ type . '_ ' . $ base ,
466498 ];
467- $ cmd = join (' ' , array_map ('escapeshellarg ' , $ args ));
499+ $ cmd = implode (' ' , array_map ('escapeshellarg ' , $ args ));
468500 $ this ->info ("Running $ cmd " );
469501
470502 $ result = 0 ;
@@ -492,7 +524,7 @@ protected function cmdCheck($files = [])
492524 $ args [] = fullpath ($ dir );
493525 }
494526
495- $ cmd = join (' ' , array_map ('escapeshellarg ' , $ args ));
527+ $ cmd = implode (' ' , array_map ('escapeshellarg ' , $ args ));
496528 $ this ->info ("Running $ cmd " );
497529
498530 $ result = 0 ;
@@ -522,12 +554,12 @@ protected function cmdFix($files = [])
522554 $ args [] = fullpath ($ dir );
523555 }
524556
525- $ cmd = join (' ' , array_map ('escapeshellarg ' , $ args ));
557+ $ cmd = implode (' ' , array_map ('escapeshellarg ' , $ args ));
526558 $ this ->info ("Running $ cmd " );
527559
528560 $ result = 0 ;
529561 passthru ($ cmd , $ result );
530- if ($ result !== 0 ) return $ result ;
562+ if ($ result !== 0 ) return $ result ;
531563
532564 // now run phpcbf to clean up code style
533565 $ args = [
@@ -543,7 +575,7 @@ protected function cmdFix($files = [])
543575 $ args [] = fullpath ($ dir );
544576 }
545577
546- $ cmd = join (' ' , array_map ('escapeshellarg ' , $ args ));
578+ $ cmd = implode (' ' , array_map ('escapeshellarg ' , $ args ));
547579 $ this ->info ("Running $ cmd " );
548580
549581 $ result = 0 ;
0 commit comments