@@ -33,8 +33,8 @@ discard block |
||
33 | 33 | public function createResolverMock(string $executable = 'vendor/bin/captainhook', bool $isPhar = false): Resolver |
34 | 34 | { |
35 | 35 | $repo = $this->getMockBuilder(Resolver::class) |
36 | - ->disableOriginalConstructor() |
|
37 | - ->getMock(); |
|
36 | + ->disableOriginalConstructor() |
|
37 | + ->getMock(); |
|
38 | 38 | |
39 | 39 | $repo->method('getExecutable')->willReturn($executable); |
40 | 40 | $repo->method('isPharRelease')->willReturn($isPhar); |
@@ -52,8 +52,8 @@ discard block |
||
52 | 52 | { |
53 | 53 | |
54 | 54 | $repo = $this->getMockBuilder(Repository::class) |
55 | - ->disableOriginalConstructor() |
|
56 | - ->getMock(); |
|
55 | + ->disableOriginalConstructor() |
|
56 | + ->getMock(); |
|
57 | 57 | |
58 | 58 | $repo->method('getRoot')->willReturn($root); |
59 | 59 | $repo->method('getHooksDir')->willReturn(empty($hooksDir) ? $root . '/.git/hooks' : $hooksDir); |
@@ -71,8 +71,8 @@ discard block |
||
71 | 71 | public function createGitInfoOperator(string $tag = 'v1.0.0', string $branch = 'master'): Info |
72 | 72 | { |
73 | 73 | $operator = $this->getMockBuilder(Info::class) |
74 | - ->disableOriginalConstructor() |
|
75 | - ->getMock(); |
|
74 | + ->disableOriginalConstructor() |
|
75 | + ->getMock(); |
|
76 | 76 | |
77 | 77 | $operator->method('getCurrentTag')->willReturn($tag); |
78 | 78 | $operator->method('getCurrentBranch')->willReturn($branch); |
@@ -89,8 +89,8 @@ discard block |
||
89 | 89 | public function createGitDiffOperator(array $changedFiles = []): Diff |
90 | 90 | { |
91 | 91 | $operator = $this->getMockBuilder(Diff::class) |
92 | - ->disableOriginalConstructor() |
|
93 | - ->getMock(); |
|
92 | + ->disableOriginalConstructor() |
|
93 | + ->getMock(); |
|
94 | 94 | |
95 | 95 | $operator->method('getChangedFiles')->willReturn($changedFiles); |
96 | 96 | |
@@ -132,8 +132,8 @@ discard block |
||
132 | 132 | public function createGitIndexOperator(array $stagedFiles = []): Index |
133 | 133 | { |
134 | 134 | $operator = $this->getMockBuilder(Index::class) |
135 | - ->disableOriginalConstructor() |
|
136 | - ->getMock(); |
|
135 | + ->disableOriginalConstructor() |
|
136 | + ->getMock(); |
|
137 | 137 | |
138 | 138 | $operator->method('getStagedFiles')->willReturn($stagedFiles); |
139 | 139 |
@@ -52,8 +52,8 @@ |
||
52 | 52 | $config = '/foo/bar/fiz/baz/config.json'; |
53 | 53 | $input = new ArrayInput(['--configuration' => $config]); |
54 | 54 | $output = $this->getMockBuilder(OutputInterface::class) |
55 | - ->disableOriginalConstructor() |
|
56 | - ->getMock(); |
|
55 | + ->disableOriginalConstructor() |
|
56 | + ->getMock(); |
|
57 | 57 | $output->method('isVerbose')->willReturn(true); |
58 | 58 | |
59 | 59 | $configure = new Configuration($resolver); |
@@ -26,8 +26,8 @@ discard block |
||
26 | 26 | { |
27 | 27 | $input = new ArrayInput(['--version' => true]); |
28 | 28 | $output = $this->getMockBuilder(NullOutput::class) |
29 | - ->disableOriginalConstructor() |
|
30 | - ->getMock(); |
|
29 | + ->disableOriginalConstructor() |
|
30 | + ->getMock(); |
|
31 | 31 | |
32 | 32 | $output->expects($this->once())->method('writeLn'); |
33 | 33 | |
@@ -47,8 +47,8 @@ discard block |
||
47 | 47 | { |
48 | 48 | $input = new ArrayInput(['--help' => true]); |
49 | 49 | $output = $this->getMockBuilder(NullOutput::class) |
50 | - ->disableOriginalConstructor() |
|
51 | - ->getMock(); |
|
50 | + ->disableOriginalConstructor() |
|
51 | + ->getMock(); |
|
52 | 52 | |
53 | 53 | $app = new Application('captainhook'); |
54 | 54 | $app->setAutoExit(false); |
@@ -65,8 +65,8 @@ discard block |
||
65 | 65 | { |
66 | 66 | $input = new ArrayInput(['command' => 'list']); |
67 | 67 | $output = $this->getMockBuilder(NullOutput::class) |
68 | - ->disableOriginalConstructor() |
|
69 | - ->getMock(); |
|
68 | + ->disableOriginalConstructor() |
|
69 | + ->getMock(); |
|
70 | 70 | |
71 | 71 | $app = new Application('captainhook'); |
72 | 72 | $app->setAutoExit(false); |
@@ -37,10 +37,10 @@ discard block |
||
37 | 37 | { |
38 | 38 | parent::configure(); |
39 | 39 | $this->setName('config:add') |
40 | - ->setAliases(['add']) |
|
41 | - ->setDescription('Add an action to your hook configuration') |
|
42 | - ->setHelp('Add an action to your hook configuration') |
|
43 | - ->addArgument('hook', InputArgument::REQUIRED, 'Hook you want to add the action to'); |
|
40 | + ->setAliases(['add']) |
|
41 | + ->setDescription('Add an action to your hook configuration') |
|
42 | + ->setHelp('Add an action to your hook configuration') |
|
43 | + ->addArgument('hook', InputArgument::REQUIRED, 'Hook you want to add the action to'); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | /** |
@@ -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 | } catch (Exception $e) { |
@@ -38,40 +38,40 @@ discard block |
||
38 | 38 | { |
39 | 39 | parent::configure(); |
40 | 40 | $this->setName('config:info') |
41 | - ->setAliases(['info']) |
|
42 | - ->setDescription('Displays information about the configuration') |
|
43 | - ->setHelp('Displays information about the configuration') |
|
44 | - ->addArgument('hook', InputArgument::OPTIONAL, 'Hook you want to investigate') |
|
45 | - ->addOption( |
|
46 | - 'list-actions', |
|
47 | - 'a', |
|
48 | - InputOption::VALUE_NONE, |
|
49 | - 'List all actions' |
|
50 | - ) |
|
51 | - ->addOption( |
|
52 | - 'list-conditions', |
|
53 | - 'p', |
|
54 | - InputOption::VALUE_NONE, |
|
55 | - 'List all conditions' |
|
56 | - ) |
|
57 | - ->addOption( |
|
58 | - 'list-options', |
|
59 | - 'o', |
|
60 | - InputOption::VALUE_NONE, |
|
61 | - 'List all options' |
|
62 | - ) |
|
63 | - ->addOption( |
|
64 | - 'list-config', |
|
65 | - 's', |
|
66 | - InputOption::VALUE_NONE, |
|
67 | - 'List all config settings' |
|
68 | - ) |
|
69 | - ->addOption( |
|
70 | - 'extensive', |
|
71 | - 'e', |
|
72 | - InputOption::VALUE_NONE, |
|
73 | - 'Show more detailed information' |
|
74 | - ); |
|
41 | + ->setAliases(['info']) |
|
42 | + ->setDescription('Displays information about the configuration') |
|
43 | + ->setHelp('Displays information about the configuration') |
|
44 | + ->addArgument('hook', InputArgument::OPTIONAL, 'Hook you want to investigate') |
|
45 | + ->addOption( |
|
46 | + 'list-actions', |
|
47 | + 'a', |
|
48 | + InputOption::VALUE_NONE, |
|
49 | + 'List all actions' |
|
50 | + ) |
|
51 | + ->addOption( |
|
52 | + 'list-conditions', |
|
53 | + 'p', |
|
54 | + InputOption::VALUE_NONE, |
|
55 | + 'List all conditions' |
|
56 | + ) |
|
57 | + ->addOption( |
|
58 | + 'list-options', |
|
59 | + 'o', |
|
60 | + InputOption::VALUE_NONE, |
|
61 | + 'List all options' |
|
62 | + ) |
|
63 | + ->addOption( |
|
64 | + 'list-config', |
|
65 | + 's', |
|
66 | + InputOption::VALUE_NONE, |
|
67 | + 'List all config settings' |
|
68 | + ) |
|
69 | + ->addOption( |
|
70 | + 'extensive', |
|
71 | + 'e', |
|
72 | + InputOption::VALUE_NONE, |
|
73 | + 'Show more detailed information' |
|
74 | + ); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | /** |
@@ -94,11 +94,11 @@ discard block |
||
94 | 94 | |
95 | 95 | $editor = new Reader($io, $config, $repo); |
96 | 96 | $editor->setHook(IOUtil::argToString($input->getArgument('hook'))) |
97 | - ->display(Reader::OPT_ACTIONS, $input->getOption('list-actions')) |
|
98 | - ->display(Reader::OPT_CONDITIONS, $input->getOption('list-conditions')) |
|
99 | - ->display(Reader::OPT_OPTIONS, $input->getOption('list-options')) |
|
100 | - ->extensive($input->getOption('extensive')) |
|
101 | - ->run(); |
|
97 | + ->display(Reader::OPT_ACTIONS, $input->getOption('list-actions')) |
|
98 | + ->display(Reader::OPT_CONDITIONS, $input->getOption('list-conditions')) |
|
99 | + ->display(Reader::OPT_OPTIONS, $input->getOption('list-options')) |
|
100 | + ->extensive($input->getOption('extensive')) |
|
101 | + ->run(); |
|
102 | 102 | |
103 | 103 | return 0; |
104 | 104 | } catch (Exception $e) { |
@@ -37,10 +37,10 @@ discard block |
||
37 | 37 | { |
38 | 38 | parent::configure(); |
39 | 39 | $this->setName('config:enable') |
40 | - ->setAliases(['enable']) |
|
41 | - ->setDescription('Enable the handling for a hook in your configuration') |
|
42 | - ->setHelp('Enable the handling for a hook in your configuration') |
|
43 | - ->addArgument('hook', InputArgument::REQUIRED, 'Hook you want to enable'); |
|
40 | + ->setAliases(['enable']) |
|
41 | + ->setDescription('Enable the handling for a hook in your configuration') |
|
42 | + ->setHelp('Enable the handling for a hook in your configuration') |
|
43 | + ->addArgument('hook', InputArgument::REQUIRED, 'Hook you want to enable'); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | /** |
@@ -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 | } catch (Exception $e) { |
@@ -37,10 +37,10 @@ discard block |
||
37 | 37 | { |
38 | 38 | parent::configure(); |
39 | 39 | $this->setName('config:disable') |
40 | - ->setAliases(['disable']) |
|
41 | - ->setDescription('Disable the handling for a hook in your configuration') |
|
42 | - ->setHelp('Disable the handling for a hook in your configuration') |
|
43 | - ->addArgument('hook', InputArgument::REQUIRED, 'Hook you want to disable'); |
|
40 | + ->setAliases(['disable']) |
|
41 | + ->setDescription('Disable the handling for a hook in your configuration') |
|
42 | + ->setHelp('Disable the handling for a hook in your configuration') |
|
43 | + ->addArgument('hook', InputArgument::REQUIRED, 'Hook you want to disable'); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | /** |
@@ -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 | } catch (Exception $e) { |
@@ -42,64 +42,64 @@ discard block |
||
42 | 42 | { |
43 | 43 | parent::configure(); |
44 | 44 | $this->setName('install') |
45 | - ->setDescription('Install hooks to your .git/hooks directory') |
|
46 | - ->setHelp('Install git hooks to your .git/hooks directory') |
|
47 | - ->addArgument( |
|
48 | - 'hook', |
|
49 | - InputArgument::OPTIONAL, |
|
50 | - 'Limit the hooks you want to install. ' . |
|
51 | - 'You can specify multiple hooks with comma as delimiter. ' . |
|
52 | - 'By default all hooks get installed' |
|
53 | - ) |
|
54 | - ->addOption( |
|
55 | - 'only-enabled', |
|
56 | - null, |
|
57 | - InputOption::VALUE_NONE, |
|
58 | - 'Limit the hooks you want to install to those enabled in your conf. ' . |
|
59 | - 'By default all hooks get installed' |
|
60 | - ) |
|
61 | - ->addOption( |
|
62 | - 'force', |
|
63 | - 'f', |
|
64 | - InputOption::VALUE_NONE, |
|
65 | - 'Force install without confirmation' |
|
66 | - ) |
|
67 | - ->addOption( |
|
68 | - 'skip-existing', |
|
69 | - 's', |
|
70 | - InputOption::VALUE_NONE, |
|
71 | - 'Do not overwrite existing hooks' |
|
72 | - ) |
|
73 | - ->addOption( |
|
74 | - 'move-existing-to', |
|
75 | - null, |
|
76 | - InputOption::VALUE_OPTIONAL, |
|
77 | - 'Move existing hooks to given directory' |
|
78 | - ) |
|
79 | - ->addOption( |
|
80 | - 'bootstrap', |
|
81 | - 'b', |
|
82 | - InputOption::VALUE_OPTIONAL, |
|
83 | - 'Path to composers vendor/autoload.php' |
|
84 | - ) |
|
85 | - ->addOption( |
|
86 | - 'run-mode', |
|
87 | - 'm', |
|
88 | - InputOption::VALUE_OPTIONAL, |
|
89 | - 'Git hook run mode [php|shell|docker]' |
|
90 | - ) |
|
91 | - ->addOption( |
|
92 | - 'run-exec', |
|
93 | - 'e', |
|
94 | - InputOption::VALUE_OPTIONAL, |
|
95 | - 'The Docker command to start your container e.g. \'docker exec CONTAINER\'' |
|
96 | - ) |
|
97 | - ->addOption( |
|
98 | - 'run-path', |
|
99 | - 'p', |
|
100 | - InputOption::VALUE_OPTIONAL, |
|
101 | - 'The path to the CaptainHook executable \'/usr/bin/captainhook\'' |
|
102 | - ); |
|
45 | + ->setDescription('Install hooks to your .git/hooks directory') |
|
46 | + ->setHelp('Install git hooks to your .git/hooks directory') |
|
47 | + ->addArgument( |
|
48 | + 'hook', |
|
49 | + InputArgument::OPTIONAL, |
|
50 | + 'Limit the hooks you want to install. ' . |
|
51 | + 'You can specify multiple hooks with comma as delimiter. ' . |
|
52 | + 'By default all hooks get installed' |
|
53 | + ) |
|
54 | + ->addOption( |
|
55 | + 'only-enabled', |
|
56 | + null, |
|
57 | + InputOption::VALUE_NONE, |
|
58 | + 'Limit the hooks you want to install to those enabled in your conf. ' . |
|
59 | + 'By default all hooks get installed' |
|
60 | + ) |
|
61 | + ->addOption( |
|
62 | + 'force', |
|
63 | + 'f', |
|
64 | + InputOption::VALUE_NONE, |
|
65 | + 'Force install without confirmation' |
|
66 | + ) |
|
67 | + ->addOption( |
|
68 | + 'skip-existing', |
|
69 | + 's', |
|
70 | + InputOption::VALUE_NONE, |
|
71 | + 'Do not overwrite existing hooks' |
|
72 | + ) |
|
73 | + ->addOption( |
|
74 | + 'move-existing-to', |
|
75 | + null, |
|
76 | + InputOption::VALUE_OPTIONAL, |
|
77 | + 'Move existing hooks to given directory' |
|
78 | + ) |
|
79 | + ->addOption( |
|
80 | + 'bootstrap', |
|
81 | + 'b', |
|
82 | + InputOption::VALUE_OPTIONAL, |
|
83 | + 'Path to composers vendor/autoload.php' |
|
84 | + ) |
|
85 | + ->addOption( |
|
86 | + 'run-mode', |
|
87 | + 'm', |
|
88 | + InputOption::VALUE_OPTIONAL, |
|
89 | + 'Git hook run mode [php|shell|docker]' |
|
90 | + ) |
|
91 | + ->addOption( |
|
92 | + 'run-exec', |
|
93 | + 'e', |
|
94 | + InputOption::VALUE_OPTIONAL, |
|
95 | + 'The Docker command to start your container e.g. \'docker exec CONTAINER\'' |
|
96 | + ) |
|
97 | + ->addOption( |
|
98 | + 'run-path', |
|
99 | + 'p', |
|
100 | + InputOption::VALUE_OPTIONAL, |
|
101 | + 'The path to the CaptainHook executable \'/usr/bin/captainhook\'' |
|
102 | + ); |
|
103 | 103 | } |
104 | 104 | |
105 | 105 | /** |
@@ -123,11 +123,11 @@ discard block |
||
123 | 123 | |
124 | 124 | $installer = new Installer($io, $config, $repo, $template); |
125 | 125 | $installer->setHook(IOUtil::argToString($input->getArgument('hook'))) |
126 | - ->setForce(IOUtil::argToBool($input->getOption('force'))) |
|
127 | - ->setSkipExisting(IOUtil::argToBool($input->getOption('skip-existing'))) |
|
128 | - ->setMoveExistingTo(IOUtil::argToString($input->getOption('move-existing-to'))) |
|
129 | - ->setOnlyEnabled(IOUtil::argToBool($input->getOption('only-enabled'))) |
|
130 | - ->run(); |
|
126 | + ->setForce(IOUtil::argToBool($input->getOption('force'))) |
|
127 | + ->setSkipExisting(IOUtil::argToBool($input->getOption('skip-existing'))) |
|
128 | + ->setMoveExistingTo(IOUtil::argToString($input->getOption('move-existing-to'))) |
|
129 | + ->setOnlyEnabled(IOUtil::argToBool($input->getOption('only-enabled'))) |
|
130 | + ->run(); |
|
131 | 131 | |
132 | 132 | return 0; |
133 | 133 | } catch (Exception $e) { |
@@ -38,17 +38,17 @@ discard block |
||
38 | 38 | { |
39 | 39 | parent::configure(); |
40 | 40 | $this->setName('configure') |
41 | - ->setDescription('Create or update a captainhook.json configuration') |
|
42 | - ->setHelp('Create or update a captainhook.json configuration') |
|
43 | - ->addOption('extend', 'e', InputOption::VALUE_NONE, 'Extend existing configuration file') |
|
44 | - ->addOption('force', 'f', InputOption::VALUE_NONE, 'Overwrite existing configuration file') |
|
45 | - ->addOption('advanced', 'a', InputOption::VALUE_NONE, 'More options, but more to type') |
|
46 | - ->addOption( |
|
47 | - 'bootstrap', |
|
48 | - null, |
|
49 | - InputOption::VALUE_OPTIONAL, |
|
50 | - 'Path to composers vendor/autoload.php' |
|
51 | - ); |
|
41 | + ->setDescription('Create or update a captainhook.json configuration') |
|
42 | + ->setHelp('Create or update a captainhook.json configuration') |
|
43 | + ->addOption('extend', 'e', InputOption::VALUE_NONE, 'Extend existing configuration file') |
|
44 | + ->addOption('force', 'f', InputOption::VALUE_NONE, 'Overwrite existing configuration file') |
|
45 | + ->addOption('advanced', 'a', InputOption::VALUE_NONE, 'More options, but more to type') |
|
46 | + ->addOption( |
|
47 | + 'bootstrap', |
|
48 | + null, |
|
49 | + InputOption::VALUE_OPTIONAL, |
|
50 | + 'Path to composers vendor/autoload.php' |
|
51 | + ); |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | /** |
@@ -69,10 +69,10 @@ discard block |
||
69 | 69 | |
70 | 70 | $configurator = new Creator($io, $config); |
71 | 71 | $configurator->force(IOUtil::argToBool($input->getOption('force'))) |
72 | - ->extend(IOUtil::argToBool($input->getOption('extend'))) |
|
73 | - ->advanced(IOUtil::argToBool($input->getOption('advanced'))) |
|
74 | - ->setExecutable($this->resolver->getExecutable()) |
|
75 | - ->run(); |
|
72 | + ->extend(IOUtil::argToBool($input->getOption('extend'))) |
|
73 | + ->advanced(IOUtil::argToBool($input->getOption('advanced'))) |
|
74 | + ->setExecutable($this->resolver->getExecutable()) |
|
75 | + ->run(); |
|
76 | 76 | |
77 | 77 | return 0; |
78 | 78 | } catch (Exception $e) { |