2525 * @package App\Command\Recipes
2626 * @author moay <[email protected] > 2727 */
28- abstract class RecipeRepoManagerCommand extends Command implements RecipeRepoManagerCommandInterface
28+ abstract class RecipeRepoManagerCommand extends Command
2929{
3030 const ACTION_NAMESPACE = 'recipes: ' ;
3131
3232 /** @var RecipeRepoManager */
3333 private $ repoManager ;
3434
35+ /** @var string */
36+ protected $ action ;
37+
38+ /** @var string */
39+ protected $ description ;
40+
3541 /**
3642 * RecipesInitializeCommand constructor.
3743 * @param RecipeRepoManager $repoManager
@@ -46,13 +52,13 @@ public function __construct(RecipeRepoManager $repoManager)
4652 protected function configure ()
4753 {
4854 $ this
49- ->setName (self ::ACTION_NAMESPACE . $ this ->getAction () )
50- ->setDescription ($ this ->getDescription () );
55+ ->setName (self ::ACTION_NAMESPACE . $ this ->action )
56+ ->setDescription ($ this ->description );
5157
5258 $ description = sprintf (
5359 '%s a single repo by selecting \'private \', \'official \' or \'contrib \'. Don \'t select any in order to %s all configured repos. ' ,
54- ucfirst ($ this ->getAction () ),
55- $ this ->getAction ()
60+ ucfirst ($ this ->action ),
61+ $ this ->action
5662 );
5763
5864 $ this ->addArgument ('repo ' , InputArgument::IS_ARRAY , $ description , []);
@@ -83,8 +89,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
8389 } else {
8490 if ($ this ->repoManager ->isConfiguredByDirName ($ repo )) {
8591 try {
86- $ this ->repoManager ->executeOnRepo ($ this ->getAction () , $ repo );
87- $ actionPast = $ this ->getAction () == 'reset ' ? 'resetted ' : $ this ->getAction () . 'd ' ;
92+ $ this ->repoManager ->executeOnRepo ($ this ->action , $ repo );
93+ $ actionPast = $ this ->action === 'reset ' ? 'resetted ' : $ this ->action . 'd ' ;
8894 $ io ->success (sprintf ('%s recipes repo %s. ' , ucfirst ($ repo ), $ actionPast ));
8995 } catch (RecipeRepoManagerException $ e ) {
9096 $ io ->error ($ e ->getMessage ());
@@ -94,6 +100,5 @@ protected function execute(InputInterface $input, OutputInterface $output)
94100 }
95101 }
96102 }
97-
98103 }
99104}
0 commit comments