@@ -78,8 +78,8 @@ discard block |
||
| 78 | 78 | |
| 79 | 79 | // every action has to get executed |
| 80 | 80 | $actionConfigFail->expects($this->atLeastOnce()) |
| 81 | - ->method('getAction') |
|
| 82 | - ->willReturn(CH_PATH_FILES . '/bin/failure'); |
|
| 81 | + ->method('getAction') |
|
| 82 | + ->willReturn(CH_PATH_FILES . '/bin/failure'); |
|
| 83 | 83 | |
| 84 | 84 | // so even if the first actions fails this action has to get executed |
| 85 | 85 | $actionConfigSuccess->expects($this->atLeastOnce()) |
@@ -88,8 +88,8 @@ discard block |
||
| 88 | 88 | |
| 89 | 89 | $hookConfig->method('isEnabled')->willReturn(true); |
| 90 | 90 | $hookConfig->expects($this->once()) |
| 91 | - ->method('getActions') |
|
| 92 | - ->willReturn([$actionConfigFail, $actionConfigSuccess]); |
|
| 91 | + ->method('getActions') |
|
| 92 | + ->willReturn([$actionConfigFail, $actionConfigSuccess]); |
|
| 93 | 93 | |
| 94 | 94 | $config->expects($this->once())->method('getHookConfigToExecute')->willReturn($hookConfig); |
| 95 | 95 | $config->method('isHookEnabled')->willReturn(true); |
@@ -125,8 +125,8 @@ discard block |
||
| 125 | 125 | |
| 126 | 126 | $hookConfig->method('isEnabled')->willReturn(true); |
| 127 | 127 | $hookConfig->expects($this->once()) |
| 128 | - ->method('getActions') |
|
| 129 | - ->willReturn([$actionConfigFail, $actionConfigSuccess]); |
|
| 128 | + ->method('getActions') |
|
| 129 | + ->willReturn([$actionConfigFail, $actionConfigSuccess]); |
|
| 130 | 130 | |
| 131 | 131 | $config->expects($this->once())->method('getHookConfigToExecute')->willReturn($hookConfig); |
| 132 | 132 | $config->expects($this->atLeastOnce())->method('isHookEnabled')->willReturn(true); |
@@ -45,13 +45,13 @@ |
||
| 45 | 45 | $io = $this->createIOMock(); |
| 46 | 46 | $io->method('getArgument')->willReturn('hook:pre-push'); |
| 47 | 47 | $io->expects($this->atLeastOnce()) |
| 48 | - ->method('getStandardInput') |
|
| 49 | - ->willReturn( |
|
| 50 | - [ |
|
| 51 | - 'refs/heads/main 9dfa0fa6221d75f48b2dfac359127324bedf8409' . |
|
| 52 | - ' refs/heads/main 8309f6e16097754469c485e604900c573bf2c5d8' |
|
| 53 | - ] |
|
| 54 | - ); |
|
| 48 | + ->method('getStandardInput') |
|
| 49 | + ->willReturn( |
|
| 50 | + [ |
|
| 51 | + 'refs/heads/main 9dfa0fa6221d75f48b2dfac359127324bedf8409' . |
|
| 52 | + ' refs/heads/main 8309f6e16097754469c485e604900c573bf2c5d8' |
|
| 53 | + ] |
|
| 54 | + ); |
|
| 55 | 55 | $operator = $this->createGitDiffOperator(['fiz.php', 'foo.txt']); |
| 56 | 56 | $repository = $this->createRepositoryMock(''); |
| 57 | 57 | $repository->expects($this->once())->method('getDiffOperator')->willReturn($operator); |
@@ -81,7 +81,7 @@ |
||
| 81 | 81 | '<fg=red>Warning: Hook script is out of date</>', |
| 82 | 82 | 'The git hook script needs to be updated.', |
| 83 | 83 | 'Required version is <info>' . CH::MIN_REQ_INSTALLER . '</info>' |
| 84 | - . ' found <fg=red>' . $installerVersion . '</>.', |
|
| 84 | + . ' found <fg=red>' . $installerVersion . '</>.', |
|
| 85 | 85 | 'Please re-install your hook by running:', |
| 86 | 86 | ' <comment>captainhook install ' . $this->hook . '</comment>', |
| 87 | 87 | '', |
@@ -37,32 +37,32 @@ |
||
| 37 | 37 | { |
| 38 | 38 | parent::configure(); |
| 39 | 39 | $this->setName('uninstall') |
| 40 | - ->setDescription('Remove all git hooks from your .git/hooks directory') |
|
| 41 | - ->setHelp('Remove all git hooks from your .git/hooks directory') |
|
| 42 | - ->addArgument( |
|
| 43 | - 'hook', |
|
| 44 | - InputArgument::OPTIONAL, |
|
| 45 | - 'Remove only this one hook. By default all hooks get uninstalled' |
|
| 46 | - ) |
|
| 47 | - ->addOption( |
|
| 48 | - 'force', |
|
| 49 | - 'f', |
|
| 50 | - InputOption::VALUE_NONE, |
|
| 51 | - 'Force install without confirmation' |
|
| 52 | - ) |
|
| 53 | - ->addOption( |
|
| 54 | - 'only-disabled', |
|
| 55 | - null, |
|
| 56 | - InputOption::VALUE_NONE, |
|
| 57 | - 'Limit the hooks you want to remove to those that are not enabled in your conf. ' . |
|
| 58 | - 'By default all hooks get uninstalled' |
|
| 59 | - ) |
|
| 60 | - ->addOption( |
|
| 61 | - 'move-existing-to', |
|
| 62 | - null, |
|
| 63 | - InputOption::VALUE_OPTIONAL, |
|
| 64 | - 'Move existing hooks to this directory' |
|
| 65 | - ); |
|
| 40 | + ->setDescription('Remove all git hooks from your .git/hooks directory') |
|
| 41 | + ->setHelp('Remove all git hooks from your .git/hooks directory') |
|
| 42 | + ->addArgument( |
|
| 43 | + 'hook', |
|
| 44 | + InputArgument::OPTIONAL, |
|
| 45 | + 'Remove only this one hook. By default all hooks get uninstalled' |
|
| 46 | + ) |
|
| 47 | + ->addOption( |
|
| 48 | + 'force', |
|
| 49 | + 'f', |
|
| 50 | + InputOption::VALUE_NONE, |
|
| 51 | + 'Force install without confirmation' |
|
| 52 | + ) |
|
| 53 | + ->addOption( |
|
| 54 | + 'only-disabled', |
|
| 55 | + null, |
|
| 56 | + InputOption::VALUE_NONE, |
|
| 57 | + 'Limit the hooks you want to remove to those that are not enabled in your conf. ' . |
|
| 58 | + 'By default all hooks get uninstalled' |
|
| 59 | + ) |
|
| 60 | + ->addOption( |
|
| 61 | + 'move-existing-to', |
|
| 62 | + null, |
|
| 63 | + InputOption::VALUE_OPTIONAL, |
|
| 64 | + 'Move existing hooks to this directory' |
|
| 65 | + ); |
|
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | /** |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | public function testStdInValue(): void |
| 29 | 29 | { |
| 30 | 30 | $expected = 'refs/heads/main 9dfa0fa6221d75f48b2dfac359127324bedf8409' |
| 31 | - . ' refs/heads/main 8309f6e16097754469c485e604900c573bf2c5d8'; |
|
| 31 | + . ' refs/heads/main 8309f6e16097754469c485e604900c573bf2c5d8'; |
|
| 32 | 32 | |
| 33 | 33 | $io = $this->createIOMock(); |
| 34 | 34 | $repo = $this->createRepositoryMock(); |
@@ -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 | } |
@@ -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 | |
@@ -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); |