@@ -38,11 +38,11 @@ |
||
38 | 38 | protected function configure() : void |
39 | 39 | { |
40 | 40 | $this->setName('help') |
41 | - ->setDescription('Shows this help message') |
|
42 | - ->setHelp('Shows command instructions') |
|
43 | - ->setDefinition([ |
|
41 | + ->setDescription('Shows this help message') |
|
42 | + ->setHelp('Shows command instructions') |
|
43 | + ->setDefinition([ |
|
44 | 44 | new InputArgument('command_name', InputArgument::OPTIONAL, 'The command name', 'help') |
45 | - ]); |
|
45 | + ]); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | /** |
@@ -35,16 +35,16 @@ discard block |
||
35 | 35 | protected function configure() : void |
36 | 36 | { |
37 | 37 | $this->setName('disable') |
38 | - ->setDescription('Disable a hook execution') |
|
39 | - ->setHelp('This command will disable a hook configuration for a given hook') |
|
40 | - ->addArgument('hook', InputArgument::REQUIRED, 'Hook you want to disable') |
|
41 | - ->addOption( |
|
42 | - 'configuration', |
|
43 | - 'c', |
|
44 | - InputOption::VALUE_OPTIONAL, |
|
45 | - 'Path to your json configuration', |
|
46 | - getcwd() . DIRECTORY_SEPARATOR . CH::CONFIG |
|
47 | - ); |
|
38 | + ->setDescription('Disable a hook execution') |
|
39 | + ->setHelp('This command will disable a hook configuration for a given hook') |
|
40 | + ->addArgument('hook', InputArgument::REQUIRED, 'Hook you want to disable') |
|
41 | + ->addOption( |
|
42 | + 'configuration', |
|
43 | + 'c', |
|
44 | + InputOption::VALUE_OPTIONAL, |
|
45 | + 'Path to your json configuration', |
|
46 | + getcwd() . DIRECTORY_SEPARATOR . CH::CONFIG |
|
47 | + ); |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | /** |
@@ -62,8 +62,8 @@ discard block |
||
62 | 62 | |
63 | 63 | $editor = new Editor($io, $config); |
64 | 64 | $editor->setHook(IOUtil::argToString($input->getArgument('hook'))) |
65 | - ->setChange('DisableHook') |
|
66 | - ->run(); |
|
65 | + ->setChange('DisableHook') |
|
66 | + ->run(); |
|
67 | 67 | |
68 | 68 | return 0; |
69 | 69 | } |
@@ -35,16 +35,16 @@ discard block |
||
35 | 35 | protected function configure() : void |
36 | 36 | { |
37 | 37 | $this->setName('enable') |
38 | - ->setDescription('Enable a hook execution') |
|
39 | - ->setHelp('This command will enable a hook configuration for a given hook') |
|
40 | - ->addArgument('hook', InputArgument::REQUIRED, 'Hook you want to enable') |
|
41 | - ->addOption( |
|
42 | - 'configuration', |
|
43 | - 'c', |
|
44 | - InputOption::VALUE_OPTIONAL, |
|
45 | - 'Path to your json configuration', |
|
46 | - getcwd() . DIRECTORY_SEPARATOR . CH::CONFIG |
|
47 | - ); |
|
38 | + ->setDescription('Enable a hook execution') |
|
39 | + ->setHelp('This command will enable a hook configuration for a given hook') |
|
40 | + ->addArgument('hook', InputArgument::REQUIRED, 'Hook you want to enable') |
|
41 | + ->addOption( |
|
42 | + 'configuration', |
|
43 | + 'c', |
|
44 | + InputOption::VALUE_OPTIONAL, |
|
45 | + 'Path to your json configuration', |
|
46 | + getcwd() . DIRECTORY_SEPARATOR . CH::CONFIG |
|
47 | + ); |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | /** |
@@ -62,8 +62,8 @@ discard block |
||
62 | 62 | |
63 | 63 | $editor = new Editor($io, $config); |
64 | 64 | $editor->setHook(IOUtil::argToString($input->getArgument('hook'))) |
65 | - ->setChange('EnableHook') |
|
66 | - ->run(); |
|
65 | + ->setChange('EnableHook') |
|
66 | + ->run(); |
|
67 | 67 | |
68 | 68 | return 0; |
69 | 69 | } |
@@ -34,24 +34,24 @@ discard block |
||
34 | 34 | protected function configure() : void |
35 | 35 | { |
36 | 36 | $this->setName('configure') |
37 | - ->setDescription('Configure your hooks') |
|
38 | - ->setHelp('This command creates or updates your captainhook configuration') |
|
39 | - ->addOption('extend', 'e', InputOption::VALUE_NONE, 'Extend existing configuration file') |
|
40 | - ->addOption('force', 'f', InputOption::VALUE_NONE, 'Overwrite existing configuration file') |
|
41 | - ->addOption('advanced', 'a', InputOption::VALUE_NONE, 'More options, but more to type') |
|
42 | - ->addOption( |
|
43 | - 'configuration', |
|
44 | - 'c', |
|
45 | - InputOption::VALUE_OPTIONAL, |
|
46 | - 'Path to your json configuration', |
|
47 | - './' . CH::CONFIG |
|
48 | - ) |
|
49 | - ->addOption( |
|
50 | - 'vendor-directory', |
|
51 | - null, |
|
52 | - InputOption::VALUE_OPTIONAL, |
|
53 | - 'Path to composers vendor directory' |
|
54 | - ); |
|
37 | + ->setDescription('Configure your hooks') |
|
38 | + ->setHelp('This command creates or updates your captainhook configuration') |
|
39 | + ->addOption('extend', 'e', InputOption::VALUE_NONE, 'Extend existing configuration file') |
|
40 | + ->addOption('force', 'f', InputOption::VALUE_NONE, 'Overwrite existing configuration file') |
|
41 | + ->addOption('advanced', 'a', InputOption::VALUE_NONE, 'More options, but more to type') |
|
42 | + ->addOption( |
|
43 | + 'configuration', |
|
44 | + 'c', |
|
45 | + InputOption::VALUE_OPTIONAL, |
|
46 | + 'Path to your json configuration', |
|
47 | + './' . CH::CONFIG |
|
48 | + ) |
|
49 | + ->addOption( |
|
50 | + 'vendor-directory', |
|
51 | + null, |
|
52 | + InputOption::VALUE_OPTIONAL, |
|
53 | + 'Path to composers vendor directory' |
|
54 | + ); |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | /** |
@@ -70,9 +70,9 @@ discard block |
||
70 | 70 | |
71 | 71 | $configurator = new Creator($io, $config); |
72 | 72 | $configurator->force(IOUtil::argToBool($input->getOption('force'))) |
73 | - ->extend(IOUtil::argToBool($input->getOption('extend'))) |
|
74 | - ->advanced(IOUtil::argToBool($input->getOption('advanced'))) |
|
75 | - ->run(); |
|
73 | + ->extend(IOUtil::argToBool($input->getOption('extend'))) |
|
74 | + ->advanced(IOUtil::argToBool($input->getOption('advanced'))) |
|
75 | + ->run(); |
|
76 | 76 | return 0; |
77 | 77 | } |
78 | 78 | } |
@@ -68,8 +68,8 @@ |
||
68 | 68 | protected function configure() : void |
69 | 69 | { |
70 | 70 | $this->setName($this->name) |
71 | - ->setDescription('Run git ' . $this->name . ' hook.') |
|
72 | - ->setHelp('This command executes the ' . $this->name . ' hook.'); |
|
71 | + ->setDescription('Run git ' . $this->name . ' hook.') |
|
72 | + ->setHelp('This command executes the ' . $this->name . ' hook.'); |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | /** |
@@ -35,16 +35,16 @@ discard block |
||
35 | 35 | protected function configure() : void |
36 | 36 | { |
37 | 37 | $this->setName('add') |
38 | - ->setDescription('Add an action to a hook configuration') |
|
39 | - ->setHelp('This command will add an action configuration to a given hook configuration') |
|
40 | - ->addArgument('hook', InputArgument::REQUIRED, 'Hook you want to add the action to') |
|
41 | - ->addOption( |
|
42 | - 'configuration', |
|
43 | - 'c', |
|
44 | - InputOption::VALUE_OPTIONAL, |
|
45 | - 'Path to your json configuration', |
|
46 | - getcwd() . DIRECTORY_SEPARATOR . CH::CONFIG |
|
47 | - ); |
|
38 | + ->setDescription('Add an action to a hook configuration') |
|
39 | + ->setHelp('This command will add an action configuration to a given hook configuration') |
|
40 | + ->addArgument('hook', InputArgument::REQUIRED, 'Hook you want to add the action to') |
|
41 | + ->addOption( |
|
42 | + 'configuration', |
|
43 | + 'c', |
|
44 | + InputOption::VALUE_OPTIONAL, |
|
45 | + 'Path to your json configuration', |
|
46 | + getcwd() . DIRECTORY_SEPARATOR . CH::CONFIG |
|
47 | + ); |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | /** |
@@ -62,8 +62,8 @@ discard block |
||
62 | 62 | |
63 | 63 | $editor = new Editor($io, $config); |
64 | 64 | $editor->setHook(IOUtil::argToString($input->getArgument('hook'))) |
65 | - ->setChange('AddAction') |
|
66 | - ->run(); |
|
65 | + ->setChange('AddAction') |
|
66 | + ->run(); |
|
67 | 67 | |
68 | 68 | return 0; |
69 | 69 | } |
@@ -38,46 +38,46 @@ discard block |
||
38 | 38 | protected function configure() : void |
39 | 39 | { |
40 | 40 | $this->setName('install') |
41 | - ->setDescription('Install git hooks') |
|
42 | - ->setHelp('This command will install the git hooks to your .git directory') |
|
43 | - ->addArgument('hook', InputArgument::OPTIONAL, 'Hook you want to install') |
|
44 | - ->addOption( |
|
45 | - 'configuration', |
|
46 | - 'c', |
|
47 | - InputOption::VALUE_OPTIONAL, |
|
48 | - 'Path to your json configuration', |
|
49 | - getcwd() . DIRECTORY_SEPARATOR . CH::CONFIG |
|
50 | - ) |
|
51 | - ->addOption( |
|
52 | - 'force', |
|
53 | - 'f', |
|
54 | - InputOption::VALUE_NONE, |
|
55 | - 'Force to overwrite existing hooks' |
|
56 | - ) |
|
57 | - ->addOption( |
|
58 | - 'git-directory', |
|
59 | - 'g', |
|
60 | - InputOption::VALUE_OPTIONAL, |
|
61 | - 'Path to your .git directory' |
|
62 | - ) |
|
63 | - ->addOption( |
|
64 | - 'vendor-directory', |
|
65 | - null, |
|
66 | - InputOption::VALUE_OPTIONAL, |
|
67 | - 'Path to composers vendor directory' |
|
68 | - ) |
|
69 | - ->addOption( |
|
70 | - 'run-mode', |
|
71 | - 'm', |
|
72 | - InputOption::VALUE_OPTIONAL, |
|
73 | - 'Git hook run mode [local|docker]' |
|
74 | - ) |
|
75 | - ->addOption( |
|
76 | - 'run-exec', |
|
77 | - 'e', |
|
78 | - InputOption::VALUE_OPTIONAL, |
|
79 | - 'The Docker command to start your container e.g. \'docker exec CONTAINER\'' |
|
80 | - ); |
|
41 | + ->setDescription('Install git hooks') |
|
42 | + ->setHelp('This command will install the git hooks to your .git directory') |
|
43 | + ->addArgument('hook', InputArgument::OPTIONAL, 'Hook you want to install') |
|
44 | + ->addOption( |
|
45 | + 'configuration', |
|
46 | + 'c', |
|
47 | + InputOption::VALUE_OPTIONAL, |
|
48 | + 'Path to your json configuration', |
|
49 | + getcwd() . DIRECTORY_SEPARATOR . CH::CONFIG |
|
50 | + ) |
|
51 | + ->addOption( |
|
52 | + 'force', |
|
53 | + 'f', |
|
54 | + InputOption::VALUE_NONE, |
|
55 | + 'Force to overwrite existing hooks' |
|
56 | + ) |
|
57 | + ->addOption( |
|
58 | + 'git-directory', |
|
59 | + 'g', |
|
60 | + InputOption::VALUE_OPTIONAL, |
|
61 | + 'Path to your .git directory' |
|
62 | + ) |
|
63 | + ->addOption( |
|
64 | + 'vendor-directory', |
|
65 | + null, |
|
66 | + InputOption::VALUE_OPTIONAL, |
|
67 | + 'Path to composers vendor directory' |
|
68 | + ) |
|
69 | + ->addOption( |
|
70 | + 'run-mode', |
|
71 | + 'm', |
|
72 | + InputOption::VALUE_OPTIONAL, |
|
73 | + 'Git hook run mode [local|docker]' |
|
74 | + ) |
|
75 | + ->addOption( |
|
76 | + 'run-exec', |
|
77 | + 'e', |
|
78 | + InputOption::VALUE_OPTIONAL, |
|
79 | + 'The Docker command to start your container e.g. \'docker exec CONTAINER\'' |
|
80 | + ); |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | /** |
@@ -106,9 +106,9 @@ discard block |
||
106 | 106 | |
107 | 107 | $installer = new Installer($io, $config, $repo); |
108 | 108 | $installer->setForce(IOUtil::argToBool($input->getOption('force'))) |
109 | - ->setHook(IOUtil::argToString($input->getArgument('hook'))) |
|
110 | - ->setTemplate(Template\Builder::build($config, $repo)) |
|
111 | - ->run(); |
|
109 | + ->setHook(IOUtil::argToString($input->getArgument('hook'))) |
|
110 | + ->setTemplate(Template\Builder::build($config, $repo)) |
|
111 | + ->run(); |
|
112 | 112 | |
113 | 113 | return 0; |
114 | 114 | } |
@@ -55,8 +55,8 @@ |
||
55 | 55 | ); |
56 | 56 | |
57 | 57 | $io = $this->getMockBuilder(DefaultIO::class) |
58 | - ->disableOriginalConstructor() |
|
59 | - ->getMock(); |
|
58 | + ->disableOriginalConstructor() |
|
59 | + ->getMock(); |
|
60 | 60 | $io->expects($this->once())->method('write'); |
61 | 61 | |
62 | 62 | $add->setIO($io); |