@@ -36,10 +36,10 @@ discard block |
||
| 36 | 36 | { |
| 37 | 37 | parent::configure(); |
| 38 | 38 | $this->setName('config:add') |
| 39 | - ->setAliases(['add']) |
|
| 40 | - ->setDescription('Add an action to your hook configuration') |
|
| 41 | - ->setHelp('Add an action to your hook configuration') |
|
| 42 | - ->addArgument('hook', InputArgument::REQUIRED, 'Hook you want to add the action to'); |
|
| 39 | + ->setAliases(['add']) |
|
| 40 | + ->setDescription('Add an action to your hook configuration') |
|
| 41 | + ->setHelp('Add an action to your hook configuration') |
|
| 42 | + ->addArgument('hook', InputArgument::REQUIRED, 'Hook you want to add the action to'); |
|
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | /** |
@@ -58,8 +58,8 @@ discard block |
||
| 58 | 58 | |
| 59 | 59 | $editor = new Editor($io, $config); |
| 60 | 60 | $editor->setHook(IOUtil::argToString($input->getArgument('hook'))) |
| 61 | - ->setChange('AddAction') |
|
| 62 | - ->run(); |
|
| 61 | + ->setChange('AddAction') |
|
| 62 | + ->run(); |
|
| 63 | 63 | |
| 64 | 64 | return 0; |
| 65 | 65 | } |
@@ -36,10 +36,10 @@ discard block |
||
| 36 | 36 | { |
| 37 | 37 | parent::configure(); |
| 38 | 38 | $this->setName('config:enable') |
| 39 | - ->setAliases(['enable']) |
|
| 40 | - ->setDescription('Enable the handling for a hook in your configuration') |
|
| 41 | - ->setHelp('Enable the handling for a hook in your configuration') |
|
| 42 | - ->addArgument('hook', InputArgument::REQUIRED, 'Hook you want to enable'); |
|
| 39 | + ->setAliases(['enable']) |
|
| 40 | + ->setDescription('Enable the handling for a hook in your configuration') |
|
| 41 | + ->setHelp('Enable the handling for a hook in your configuration') |
|
| 42 | + ->addArgument('hook', InputArgument::REQUIRED, 'Hook you want to enable'); |
|
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | /** |
@@ -58,8 +58,8 @@ discard block |
||
| 58 | 58 | |
| 59 | 59 | $editor = new Editor($io, $config); |
| 60 | 60 | $editor->setHook(IOUtil::argToString($input->getArgument('hook'))) |
| 61 | - ->setChange('EnableHook') |
|
| 62 | - ->run(); |
|
| 61 | + ->setChange('EnableHook') |
|
| 62 | + ->run(); |
|
| 63 | 63 | |
| 64 | 64 | return 0; |
| 65 | 65 | } |
@@ -37,17 +37,17 @@ discard block |
||
| 37 | 37 | { |
| 38 | 38 | parent::configure(); |
| 39 | 39 | $this->setName('configure') |
| 40 | - ->setDescription('Create or update a captainhook.json configuration') |
|
| 41 | - ->setHelp('Create or update a captainhook.json configuration') |
|
| 42 | - ->addOption('extend', 'e', InputOption::VALUE_NONE, 'Extend existing configuration file') |
|
| 43 | - ->addOption('force', 'f', InputOption::VALUE_NONE, 'Overwrite existing configuration file') |
|
| 44 | - ->addOption('advanced', 'a', InputOption::VALUE_NONE, 'More options, but more to type') |
|
| 45 | - ->addOption( |
|
| 46 | - 'bootstrap', |
|
| 47 | - null, |
|
| 48 | - InputOption::VALUE_OPTIONAL, |
|
| 49 | - 'Path to composers vendor/autoload.php' |
|
| 50 | - ); |
|
| 40 | + ->setDescription('Create or update a captainhook.json configuration') |
|
| 41 | + ->setHelp('Create or update a captainhook.json configuration') |
|
| 42 | + ->addOption('extend', 'e', InputOption::VALUE_NONE, 'Extend existing configuration file') |
|
| 43 | + ->addOption('force', 'f', InputOption::VALUE_NONE, 'Overwrite existing configuration file') |
|
| 44 | + ->addOption('advanced', 'a', InputOption::VALUE_NONE, 'More options, but more to type') |
|
| 45 | + ->addOption( |
|
| 46 | + 'bootstrap', |
|
| 47 | + null, |
|
| 48 | + InputOption::VALUE_OPTIONAL, |
|
| 49 | + 'Path to composers vendor/autoload.php' |
|
| 50 | + ); |
|
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | /** |
@@ -65,10 +65,10 @@ discard block |
||
| 65 | 65 | |
| 66 | 66 | $configurator = new Creator($io, $config); |
| 67 | 67 | $configurator->force(IOUtil::argToBool($input->getOption('force'))) |
| 68 | - ->extend(IOUtil::argToBool($input->getOption('extend'))) |
|
| 69 | - ->advanced(IOUtil::argToBool($input->getOption('advanced'))) |
|
| 70 | - ->setExecutable($this->resolver->getExecutable()) |
|
| 71 | - ->run(); |
|
| 68 | + ->extend(IOUtil::argToBool($input->getOption('extend'))) |
|
| 69 | + ->advanced(IOUtil::argToBool($input->getOption('advanced'))) |
|
| 70 | + ->setExecutable($this->resolver->getExecutable()) |
|
| 71 | + ->run(); |
|
| 72 | 72 | return 0; |
| 73 | 73 | } |
| 74 | 74 | } |
@@ -89,7 +89,7 @@ |
||
| 89 | 89 | $hooks = explode(',', $hook); |
| 90 | 90 | $hooks = array_map('trim', $hooks); |
| 91 | 91 | |
| 92 | - $hooksValidationCallback = static function (string $hook): bool { |
|
| 92 | + $hooksValidationCallback = static function(string $hook): bool { |
|
| 93 | 93 | return !HookUtil::isInstallable($hook); |
| 94 | 94 | }; |
| 95 | 95 | if (!empty(($invalidHooks = array_filter($hooks, $hooksValidationCallback)))) { |
@@ -100,7 +100,7 @@ |
||
| 100 | 100 | |
| 101 | 101 | $executableInclude = substr($executablePath, 0, 1) == '/' |
| 102 | 102 | ? '\'' . $executablePath . '\'' |
| 103 | - : '__DIR__ . \'/../../' . $executablePath . '\''; |
|
| 103 | + : '__DIR__ . \'/../../' . $executablePath . '\''; |
|
| 104 | 104 | return [ |
| 105 | 105 | '#!/usr/bin/env php', |
| 106 | 106 | '<?php', |
@@ -109,10 +109,10 @@ |
||
| 109 | 109 | $options = substr($command, $endExec); |
| 110 | 110 | |
| 111 | 111 | $command = trim($executable) |
| 112 | - . $this->createInteractiveOptions($options) |
|
| 113 | - . $this->createTTYOptions($options) |
|
| 114 | - . $this->createEnvOptions($options, $hook) |
|
| 115 | - . ' ' . trim($options); |
|
| 112 | + . $this->createInteractiveOptions($options) |
|
| 113 | + . $this->createTTYOptions($options) |
|
| 114 | + . $this->createEnvOptions($options, $hook) |
|
| 115 | + . ' ' . trim($options); |
|
| 116 | 116 | } |
| 117 | 117 | return $command; |
| 118 | 118 | } |
@@ -108,7 +108,7 @@ |
||
| 108 | 108 | $executable = substr($command, 0, $endExec); |
| 109 | 109 | $options = substr($command, $endExec); |
| 110 | 110 | |
| 111 | - $command = trim($executable) |
|
| 111 | + $command = trim($executable) |
|
| 112 | 112 | . $this->createInteractiveOptions($options) |
| 113 | 113 | . $this->createTTYOptions($options) |
| 114 | 114 | . $this->createEnvOptions($options, $hook) |
@@ -103,7 +103,7 @@ |
||
| 103 | 103 | $info = explode(' ', $stdIn[0]); |
| 104 | 104 | // If we find a rewritten commit, we return the first commit before the rewritten one. |
| 105 | 105 | // If we do not find any rewritten commits (awkward) we use the last ref-log position. |
| 106 | - return isset($info[1]) ? trim($info[1]) . '^' : 'HEAD@{1}'; |
|
| 106 | + return isset($info[1]) ? trim($info[1]) . '^' : 'HEAD@{1}'; |
|
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | return $io->getArgument(Hooks::ARG_PREVIOUS_HEAD, 'HEAD@{1}'); |
@@ -77,6 +77,6 @@ |
||
| 77 | 77 | ); |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | - return $covered / ((int)$statements * 0.01); |
|
| 80 | + return $covered / ((int) $statements * 0.01); |
|
| 81 | 81 | } |
| 82 | 82 | } |
@@ -31,7 +31,7 @@ |
||
| 31 | 31 | parent::__construct(); |
| 32 | 32 | |
| 33 | 33 | $this->hint = 'A commit message subject should always complete the following sentence.' . PHP_EOL . |
| 34 | - 'This commit will [YOUR COMMIT MESSAGE].'; |
|
| 34 | + 'This commit will [YOUR COMMIT MESSAGE].'; |
|
| 35 | 35 | |
| 36 | 36 | $this->setSubjectBlacklist( |
| 37 | 37 | [ |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | { |
| 31 | 31 | parent::__construct(); |
| 32 | 32 | |
| 33 | - $this->hint = 'A commit message subject should always complete the following sentence.' . PHP_EOL . |
|
| 33 | + $this->hint = 'A commit message subject should always complete the following sentence.' . PHP_EOL . |
|
| 34 | 34 | 'This commit will [YOUR COMMIT MESSAGE].'; |
| 35 | 35 | |
| 36 | 36 | $this->setSubjectBlacklist( |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | |
| 50 | 50 | if ($checkOnlyBeginning) { |
| 51 | 51 | // overwrite the detection logic to only check the beginning og the string |
| 52 | - $this->stringDetection = function (string $content, string $term): bool { |
|
| 52 | + $this->stringDetection = function(string $content, string $term): bool { |
|
| 53 | 53 | return strpos($content, $term) === 0; |
| 54 | 54 | }; |
| 55 | 55 | } |