diff options
author | Joas Schilling <nickvergessen@owncloud.com> | 2015-07-07 15:37:56 +0200 |
---|---|---|
committer | Joas Schilling <nickvergessen@owncloud.com> | 2015-07-17 12:34:56 +0200 |
commit | a0c6f2e5e071a287717e58f32c5b3cf6e219f321 (patch) | |
tree | 231363a90e1c8296e8a06a0346078adc3c5e8454 /core/command | |
parent | bba87a2a3b46d20a552efa4a1d00d3253aedf27b (diff) | |
download | nextcloud-server-a0c6f2e5e071a287717e58f32c5b3cf6e219f321.tar.gz nextcloud-server-a0c6f2e5e071a287717e58f32c5b3cf6e219f321.zip |
Use the decorator pattern
Diffstat (limited to 'core/command')
-rw-r--r-- | core/command/app/checkcode.php | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/core/command/app/checkcode.php b/core/command/app/checkcode.php index a533ce767f3..3f4fb95868c 100644 --- a/core/command/app/checkcode.php +++ b/core/command/app/checkcode.php @@ -24,8 +24,10 @@ namespace OC\Core\Command\App; use OC\App\CodeChecker\CodeChecker; -use OC\App\CodeChecker\DeprecationList; -use OC\App\CodeChecker\PrivateList; +use OC\App\CodeChecker\DeprecationCheck; +use OC\App\CodeChecker\EmptyCheck; +use OC\App\CodeChecker\PrivateCheck; +use OC\App\CodeChecker\StrongComparisonCheck; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; @@ -52,12 +54,14 @@ class CheckCode extends Command { protected function execute(InputInterface $input, OutputInterface $output) { $appId = $input->getArgument('app-id'); + $checkList = new EmptyCheck(); if ($input->getOption('deprecated')) { - $list = new DeprecationList(); + $checkList = new DeprecationCheck($checkList); + $checkList = new StrongComparisonCheck($checkList); } else { - $list = new PrivateList(); + $checkList = new PrivateCheck($checkList); } - $codeChecker = new CodeChecker($list); + $codeChecker = new CodeChecker($checkList); $codeChecker->listen('CodeChecker', 'analyseFileBegin', function($params) use ($output) { if(OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) { |