diff --git a/resources/config/config.yml b/resources/config/config.yml index d2ee7c32..c6b66870 100644 --- a/resources/config/config.yml +++ b/resources/config/config.yml @@ -20,7 +20,6 @@ services: - '%hooks_dir%' - '%hooks_preset%' - '%git_hook_variables%' - - '%git_hooks%' GrumPHP\Configuration\Model\ParallelConfig: factory: ['GrumPHP\Configuration\Model\ParallelConfig', 'fromArray'] arguments: diff --git a/src/Configuration/Configuration.php b/src/Configuration/Configuration.php index ac88c609..2f96fdaa 100644 --- a/src/Configuration/Configuration.php +++ b/src/Configuration/Configuration.php @@ -4,7 +4,6 @@ namespace GrumPHP\Configuration; -use GrumPHP\Console\Command\Git\InitCommand; use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition; use Symfony\Component\Config\Definition\Builder\TreeBuilder; use Symfony\Component\Config\Definition\ConfigurationInterface; @@ -71,14 +70,6 @@ public function getConfigTreeBuilder(): TreeBuilder $ascii->children()->variableNode('failed')->defaultValue('grumphp-grumpy.txt'); $ascii->children()->variableNode('succeeded')->defaultValue('grumphp-happy.txt'); - $rootNode->children()->arrayNode('git_hooks')->defaultValue(InitCommand::$hooks) - ->prototype('scalar') - ->validate() - ->ifNotInArray(InitCommand::$hooks) - ->thenInvalid('Invalid item %s') - ->end() - ->end(); - // parallel $parallel = $rootNode->children()->arrayNode('parallel'); $parallel->canBeDisabled(); diff --git a/src/Configuration/Model/HooksConfig.php b/src/Configuration/Model/HooksConfig.php index 687c26aa..941dd8b1 100644 --- a/src/Configuration/Model/HooksConfig.php +++ b/src/Configuration/Model/HooksConfig.php @@ -27,8 +27,7 @@ class HooksConfig public function __construct( ?string $dir, string $preset, - array $variables, - private array $gitHooks, + array $variables ) { $this->dir = $dir; $this->preset = $preset; @@ -49,9 +48,4 @@ public function getVariables(): array { return $this->variables; } - - public function getGitHooks(): array - { - return $this->gitHooks; - } } diff --git a/src/Console/Command/Git/DeInitCommand.php b/src/Console/Command/Git/DeInitCommand.php index 04ec1b78..ea77d142 100644 --- a/src/Console/Command/Git/DeInitCommand.php +++ b/src/Console/Command/Git/DeInitCommand.php @@ -22,7 +22,6 @@ class DeInitCommand extends Command */ protected static $hooks = [ 'pre-commit', - 'pre-push', 'commit-msg', ]; diff --git a/src/Console/Command/Git/InitCommand.php b/src/Console/Command/Git/InitCommand.php index 58cb41e3..1aadf49b 100644 --- a/src/Console/Command/Git/InitCommand.php +++ b/src/Console/Command/Git/InitCommand.php @@ -27,7 +27,6 @@ class InitCommand extends Command */ public static $hooks = [ 'pre-commit', - 'pre-push', 'commit-msg', ]; @@ -101,9 +100,6 @@ public function execute(InputInterface $input, OutputInterface $output): int } foreach (self::$hooks as $hook) { - if (!in_array($hook, $this->hooksConfig->getGitHooks(), true)) { - continue; - } $gitHook = $this->filesystem->buildPath($gitHooksPath, $hook); $hookTemplate = $this->filesystem->guessFile( [