diff options
author | Joas Schilling <nickvergessen@owncloud.com> | 2015-06-15 12:51:22 +0200 |
---|---|---|
committer | Joas Schilling <nickvergessen@owncloud.com> | 2015-07-17 12:34:55 +0200 |
commit | 4e95031ec4e74bb99dc2dc819ddb77893564e01c (patch) | |
tree | 1ba2dc23561b21afa4164985754b36e69859fb96 /core/command/app | |
parent | 3fae984b561e59db62e5ad15d7da417ed957ef8d (diff) | |
download | nextcloud-server-4e95031ec4e74bb99dc2dc819ddb77893564e01c.tar.gz nextcloud-server-4e95031ec4e74bb99dc2dc819ddb77893564e01c.zip |
Allow app:check-code to check for deprecated methods
Diffstat (limited to 'core/command/app')
-rw-r--r-- | core/command/app/checkcode.php | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/core/command/app/checkcode.php b/core/command/app/checkcode.php index ecec51e5768..8bd079eaad1 100644 --- a/core/command/app/checkcode.php +++ b/core/command/app/checkcode.php @@ -23,9 +23,12 @@ namespace OC\Core\Command\App; +use OC\App\CodeChecker; +use OC\App\DeprecationCodeChecker; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; class CheckCode extends Command { @@ -37,12 +40,22 @@ class CheckCode extends Command { 'app-id', InputArgument::REQUIRED, 'check the specified app' + ) + ->addOption( + 'deprecated', + 'd', + InputOption::VALUE_NONE, + 'check the specified app' ); } protected function execute(InputInterface $input, OutputInterface $output) { $appId = $input->getArgument('app-id'); - $codeChecker = new \OC\App\CodeChecker(); + if ($input->getOption('deprecated')) { + $codeChecker = new DeprecationCodeChecker(); + } else { + $codeChecker = new CodeChecker(); + } $codeChecker->listen('CodeChecker', 'analyseFileBegin', function($params) use ($output) { if(OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) { $output->writeln("<info>Analysing {$params}</info>"); @@ -72,6 +85,8 @@ class CheckCode extends Command { $errors = $codeChecker->analyse($appId); if (empty($errors)) { $output->writeln('<info>App is compliant - awesome job!</info>'); + } elseif ($input->getOption('deprecated')) { + $output->writeln('<comment>App uses deprecated functionality</comment>'); } else { $output->writeln('<error>App is not compliant</error>'); return 1; |