@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | |
37 | 37 | $runner = new Reader($io, $config, $repo); |
38 | 38 | $runner->setHook('pre-commit') |
39 | - ->run(); |
|
39 | + ->run(); |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | public function testDoesNotAllowInvalidHookNames(): void |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | |
50 | 50 | $runner = new Reader($io, $config, $repo); |
51 | 51 | $runner->setHook('foo') |
52 | - ->run(); |
|
52 | + ->run(); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | public function testItDisplaysOnlyActions(): void |
@@ -63,8 +63,8 @@ discard block |
||
63 | 63 | |
64 | 64 | $runner = new Reader($io, $config, $repo); |
65 | 65 | $runner->setHook('pre-commit') |
66 | - ->display(Reader::OPT_ACTIONS, true) |
|
67 | - ->run(); |
|
66 | + ->display(Reader::OPT_ACTIONS, true) |
|
67 | + ->run(); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | public function testItDisplaysActionsAndConditions(): void |
@@ -142,9 +142,9 @@ |
||
142 | 142 | |
143 | 143 | // combine all the parts to create a new commit message |
144 | 144 | $msgText = $msgData[self::TARGET_SUBJECT] . PHP_EOL |
145 | - . PHP_EOL |
|
146 | - . $msgData[self::TARGET_BODY] . PHP_EOL |
|
147 | - . $msg->getComments(); |
|
145 | + . PHP_EOL |
|
146 | + . $msgData[self::TARGET_BODY] . PHP_EOL |
|
147 | + . $msg->getComments(); |
|
148 | 148 | |
149 | 149 | return new CommitMessage($msgText, $msg->getCommentCharacter()); |
150 | 150 | } |
@@ -162,9 +162,9 @@ discard block |
||
162 | 162 | $template = $this->createTemplateMock(); |
163 | 163 | |
164 | 164 | $template->expects($this->once()) |
165 | - ->method('getCode') |
|
166 | - ->with('pre-commit') |
|
167 | - ->willReturn(''); |
|
165 | + ->method('getCode') |
|
166 | + ->with('pre-commit') |
|
167 | + ->willReturn(''); |
|
168 | 168 | |
169 | 169 | $runner = new Installer($io, $config, $repo, $template); |
170 | 170 | $runner->setHook('pre-commit'); |
@@ -184,8 +184,8 @@ discard block |
||
184 | 184 | $template = $this->createTemplateMock(); |
185 | 185 | |
186 | 186 | $file = $this->getMockBuilder(File::class) |
187 | - ->disableOriginalConstructor() |
|
188 | - ->getMock(); |
|
187 | + ->disableOriginalConstructor() |
|
188 | + ->getMock(); |
|
189 | 189 | |
190 | 190 | $runner = new FakeInstaller($io, $config, $repo, $template); |
191 | 191 | $file->method('isLink')->willReturn(true); |
@@ -208,8 +208,8 @@ discard block |
||
208 | 208 | $template = $this->createTemplateMock(); |
209 | 209 | |
210 | 210 | $file = $this->getMockBuilder(File::class) |
211 | - ->disableOriginalConstructor() |
|
212 | - ->getMock(); |
|
211 | + ->disableOriginalConstructor() |
|
212 | + ->getMock(); |
|
213 | 213 | |
214 | 214 | $runner = new FakeInstaller($io, $config, $repo, $template); |
215 | 215 | $file->method('isLink')->willReturn(true); |
@@ -265,14 +265,14 @@ discard block |
||
265 | 265 | $repo = new Repository($fakeRepo->getRoot()); |
266 | 266 | |
267 | 267 | $template->expects($this->once()) |
268 | - ->method('getCode') |
|
269 | - ->with('pre-commit') |
|
270 | - ->willReturn(''); |
|
268 | + ->method('getCode') |
|
269 | + ->with('pre-commit') |
|
270 | + ->willReturn(''); |
|
271 | 271 | |
272 | 272 | $runner = new Installer($io, $config, $repo, $template); |
273 | 273 | $runner->setHook('pre-commit') |
274 | - ->setMoveExistingTo('foo/bar/') |
|
275 | - ->run(); |
|
274 | + ->setMoveExistingTo('foo/bar/') |
|
275 | + ->run(); |
|
276 | 276 | |
277 | 277 | $this->assertFileExists($fakeRepo->getHookDir() . '/pre-commit'); |
278 | 278 | $this->assertFileExists($fakeRepo->getRoot() . '/foo/bar/pre-commit'); |
@@ -303,14 +303,14 @@ discard block |
||
303 | 303 | $repo = new Repository($fakeRepo->getRoot()); |
304 | 304 | |
305 | 305 | $template->expects($this->once()) |
306 | - ->method('getCode') |
|
307 | - ->with('pre-commit') |
|
308 | - ->willReturn(''); |
|
306 | + ->method('getCode') |
|
307 | + ->with('pre-commit') |
|
308 | + ->willReturn(''); |
|
309 | 309 | |
310 | 310 | $runner = new Installer($io, $config, $repo, $template); |
311 | 311 | $runner->setHook('pre-commit') |
312 | - ->setMoveExistingTo('foo/bar/') |
|
313 | - ->run(); |
|
312 | + ->setMoveExistingTo('foo/bar/') |
|
313 | + ->run(); |
|
314 | 314 | |
315 | 315 | $this->assertFileExists($fakeRepo->getHookDir() . '/pre-commit'); |
316 | 316 | } |
@@ -344,8 +344,8 @@ discard block |
||
344 | 344 | |
345 | 345 | $runner = new Installer($io, $config, $repo, $template); |
346 | 346 | $runner->setHook('pre-commit') |
347 | - ->setMoveExistingTo('foo') |
|
348 | - ->run(); |
|
347 | + ->setMoveExistingTo('foo') |
|
348 | + ->run(); |
|
349 | 349 | } |
350 | 350 | |
351 | 351 | /** |
@@ -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) { |