@@ -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) { |
@@ -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) { |
@@ -46,8 +46,8 @@ discard block |
||
| 46 | 46 | ->method('getBranchRevFromRefLog') |
| 47 | 47 | ->willReturn('main'); |
| 48 | 48 | $info->expects($this->once()) |
| 49 | - ->method('getCurrentBranch') |
|
| 50 | - ->willReturn('foo'); |
|
| 49 | + ->method('getCurrentBranch') |
|
| 50 | + ->willReturn('foo'); |
|
| 51 | 51 | |
| 52 | 52 | $repo->expects($this->atLeastOnce())->method('getLogOperator')->willReturn($log); |
| 53 | 53 | $repo->expects($this->atLeastOnce())->method('getDiffOperator')->willReturn($diff); |
@@ -98,8 +98,8 @@ discard block |
||
| 98 | 98 | $diff = $this->createGitDiffOperator(['file1.php', 'file2.php', 'README.md', 'foo.txt']); |
| 99 | 99 | |
| 100 | 100 | $info->expects($this->once()) |
| 101 | - ->method('getCurrentBranch') |
|
| 102 | - ->willReturn('foo'); |
|
| 101 | + ->method('getCurrentBranch') |
|
| 102 | + ->willReturn('foo'); |
|
| 103 | 103 | |
| 104 | 104 | $repo->expects($this->atLeastOnce())->method('getDiffOperator')->willReturn($diff); |
| 105 | 105 | $repo->expects($this->atLeastOnce())->method('getInfoOperator')->willReturn($info); |
@@ -122,8 +122,8 @@ discard block |
||
| 122 | 122 | $diff = $this->createGitDiffOperator(['foo/file1.php', 'foo/file2.php', 'README.md', 'foo.txt']); |
| 123 | 123 | |
| 124 | 124 | $info->expects($this->once()) |
| 125 | - ->method('getCurrentBranch') |
|
| 126 | - ->willReturn('foo'); |
|
| 125 | + ->method('getCurrentBranch') |
|
| 126 | + ->willReturn('foo'); |
|
| 127 | 127 | |
| 128 | 128 | $repo->expects($this->atLeastOnce())->method('getDiffOperator')->willReturn($diff); |
| 129 | 129 | $repo->expects($this->atLeastOnce())->method('getInfoOperator')->willReturn($info); |
@@ -56,16 +56,16 @@ |
||
| 56 | 56 | ); |
| 57 | 57 | |
| 58 | 58 | $io = $this->getMockBuilder(DefaultIO::class) |
| 59 | - ->disableOriginalConstructor() |
|
| 60 | - ->getMock(); |
|
| 59 | + ->disableOriginalConstructor() |
|
| 60 | + ->getMock(); |
|
| 61 | 61 | |
| 62 | 62 | $invokedCount = $this->atLeast(2); |
| 63 | 63 | $io->expects($invokedCount) |
| 64 | - ->method('ask') |
|
| 65 | - ->willReturnCallback(function ($parameters) use ($invokedCount) { |
|
| 66 | - $results = ['\\Foo\\Bar', 'n']; |
|
| 67 | - return $results[$invokedCount->numberOfInvocations() - 1] ?? ''; |
|
| 68 | - }); |
|
| 64 | + ->method('ask') |
|
| 65 | + ->willReturnCallback(function ($parameters) use ($invokedCount) { |
|
| 66 | + $results = ['\\Foo\\Bar', 'n']; |
|
| 67 | + return $results[$invokedCount->numberOfInvocations() - 1] ?? ''; |
|
| 68 | + }); |
|
| 69 | 69 | |
| 70 | 70 | $io->expects($this->once())->method('write'); |
| 71 | 71 | |
@@ -62,7 +62,7 @@ |
||
| 62 | 62 | $invokedCount = $this->atLeast(2); |
| 63 | 63 | $io->expects($invokedCount) |
| 64 | 64 | ->method('ask') |
| 65 | - ->willReturnCallback(function ($parameters) use ($invokedCount) { |
|
| 65 | + ->willReturnCallback(function($parameters) use ($invokedCount) { |
|
| 66 | 66 | $results = ['\\Foo\\Bar', 'n']; |
| 67 | 67 | return $results[$invokedCount->numberOfInvocations() - 1] ?? ''; |
| 68 | 68 | }); |
@@ -41,7 +41,7 @@ |
||
| 41 | 41 | |
| 42 | 42 | public function testUninstallPreCommitHook(): void |
| 43 | 43 | { |
| 44 | - $repo = new DummyRepo([ |
|
| 44 | + $repo = new DummyRepo([ |
|
| 45 | 45 | 'config' => '# fake git config', |
| 46 | 46 | 'hooks' => [ |
| 47 | 47 | 'pre-commit' => '# fake pre-commit hook file', |
@@ -42,8 +42,8 @@ |
||
| 42 | 42 | $config = '/foo/bar/fiz/baz/config.json'; |
| 43 | 43 | $input = new ArrayInput(['--configuration' => $config]); |
| 44 | 44 | $output = $this->getMockBuilder(OutputInterface::class) |
| 45 | - ->disableOriginalConstructor() |
|
| 46 | - ->getMock(); |
|
| 45 | + ->disableOriginalConstructor() |
|
| 46 | + ->getMock(); |
|
| 47 | 47 | $output->method('isVerbose')->willReturn(true); |
| 48 | 48 | |
| 49 | 49 | $configure = new Configuration($resolver); |
@@ -48,7 +48,7 @@ |
||
| 48 | 48 | |
| 49 | 49 | public function testFormatHeadlineShort(): void |
| 50 | 50 | { |
| 51 | - $text = str_repeat('x', 70) ; |
|
| 51 | + $text = str_repeat('x', 70); |
|
| 52 | 52 | $expected = '==== ' . $text . ' ===='; |
| 53 | 53 | $headline = IOUtil::formatHeadline($text, 80); |
| 54 | 54 | |