From e579392fb3dfb91210fbe8ed33c70129cd332671 Mon Sep 17 00:00:00 2001 From: Andrew Roslik Date: Tue, 30 Aug 2016 15:14:06 +0300 Subject: [PATCH] Implemented #115: Remove supporting excluding file extensions - Removed deprecated lists. --- .../Console/Command/Config/File/Allow.php | 6 ------ .../Console/Command/Config/File/Protect.php | 20 +++++++++++-------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/src/lib/PreCommit/Console/Command/Config/File/Allow.php b/src/lib/PreCommit/Console/Command/Config/File/Allow.php index 7d9c8da..59494a9 100644 --- a/src/lib/PreCommit/Console/Command/Config/File/Allow.php +++ b/src/lib/PreCommit/Console/Command/Config/File/Allow.php @@ -35,12 +35,6 @@ protected function getKey() */ protected function showSetValues() { - $this->key = 'allow-path'; - $this->processValue(); - - $this->key = 'allow-file'; - $this->processValue(); - $this->key = 'allow'; $this->processValue(); diff --git a/src/lib/PreCommit/Console/Command/Config/File/Protect.php b/src/lib/PreCommit/Console/Command/Config/File/Protect.php index 066e7f4..89800a6 100644 --- a/src/lib/PreCommit/Console/Command/Config/File/Protect.php +++ b/src/lib/PreCommit/Console/Command/Config/File/Protect.php @@ -91,12 +91,6 @@ protected function normalizeValue() */ protected function showSetValues() { - $this->key = 'protect-path'; - $this->processValue(); - - $this->key = 'protect-file'; - $this->processValue(); - $this->key = 'protect'; $this->processValue(); @@ -135,6 +129,16 @@ protected function configureInput() return $this; } + /** + * Removed using scope. + * + * @return bool + */ + protected function useDefaultScopeByDefault() + { + return true; + } + /** * Init default helpers * @@ -177,7 +181,7 @@ protected function writePredefinedOptions($readAll = false) */ protected function getDefaultScope($xpath, $type) { - return 2; + return self::OPTION_SCOPE_PROJECT; } /** @@ -197,7 +201,7 @@ protected function getXpathValue($xpath) */ protected function showValue() { - $value = $this->getShowValue($this->getArgumentXpath()); + $value = (array) $this->getConfig()->getNodesExpr($this->getArgumentXpath().'/*'); $value && $this->io->writeln(implode(PHP_EOL, $value)); return $this;