|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* @copyright Copyright (c) 2016, ownCloud, Inc. |
|
4
|
|
|
* |
|
5
|
|
|
* @author Christoph Wurst <[email protected]> |
|
6
|
|
|
* @author Joas Schilling <[email protected]> |
|
7
|
|
|
* @author Morris Jobke <[email protected]> |
|
8
|
|
|
* @author Robin McCorkell <[email protected]> |
|
9
|
|
|
* @author Roeland Jago Douma <[email protected]> |
|
10
|
|
|
* @author Thomas Müller <[email protected]> |
|
11
|
|
|
* |
|
12
|
|
|
* @license AGPL-3.0 |
|
13
|
|
|
* |
|
14
|
|
|
* This code is free software: you can redistribute it and/or modify |
|
15
|
|
|
* it under the terms of the GNU Affero General Public License, version 3, |
|
16
|
|
|
* as published by the Free Software Foundation. |
|
17
|
|
|
* |
|
18
|
|
|
* This program is distributed in the hope that it will be useful, |
|
19
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
20
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
21
|
|
|
* GNU Affero General Public License for more details. |
|
22
|
|
|
* |
|
23
|
|
|
* You should have received a copy of the GNU Affero General Public License, version 3, |
|
24
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/> |
|
25
|
|
|
* |
|
26
|
|
|
*/ |
|
27
|
|
|
|
|
28
|
|
|
namespace OC\Core\Command\App; |
|
29
|
|
|
|
|
30
|
|
|
use Symfony\Component\Console\Command\Command; |
|
31
|
|
|
use Symfony\Component\Console\Input\InputArgument; |
|
32
|
|
|
use Symfony\Component\Console\Input\InputInterface; |
|
33
|
|
|
use Symfony\Component\Console\Input\InputOption; |
|
34
|
|
|
use Symfony\Component\Console\Output\OutputInterface; |
|
35
|
|
|
|
|
36
|
|
|
class CheckCode extends Command { |
|
37
|
|
|
protected $checkers = []; |
|
38
|
|
|
|
|
39
|
|
|
protected function configure() { |
|
40
|
|
|
$this |
|
41
|
|
|
->setName('app:check-code') |
|
42
|
|
|
->setDescription('check code to be compliant') |
|
43
|
|
|
->addArgument( |
|
44
|
|
|
'app-id', |
|
45
|
|
|
InputArgument::REQUIRED, |
|
46
|
|
|
'check the specified app' |
|
47
|
|
|
) |
|
48
|
|
|
->addOption( |
|
49
|
|
|
'checker', |
|
50
|
|
|
'c', |
|
51
|
|
|
InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, |
|
52
|
|
|
'enable the specified checker(s)', |
|
53
|
|
|
[ 'private', 'deprecation', 'strong-comparison' ] |
|
54
|
|
|
) |
|
55
|
|
|
->addOption( |
|
56
|
|
|
'--skip-checkers', |
|
57
|
|
|
null, |
|
58
|
|
|
InputOption::VALUE_NONE, |
|
59
|
|
|
'skips the the code checkers to only check info.xml, language and database schema' |
|
60
|
|
|
) |
|
61
|
|
|
->addOption( |
|
62
|
|
|
'--skip-validate-info', |
|
63
|
|
|
null, |
|
64
|
|
|
InputOption::VALUE_NONE, |
|
65
|
|
|
'skips the info.xml/version check' |
|
66
|
|
|
); |
|
67
|
|
|
} |
|
68
|
|
|
|
|
69
|
|
|
protected function execute(InputInterface $input, OutputInterface $output): int { |
|
70
|
|
|
$output->writeln('<error>The app code checker doesn\t check anything and this command will be removed in Nextcloud 23</error>'); |
|
71
|
|
|
|
|
72
|
|
|
return 0; |
|
73
|
|
|
} |
|
74
|
|
|
} |
|
75
|
|
|
|