@@ -36,42 +36,42 @@ |
||
| 36 | 36 | * @package OC\Core\Command\Integrity |
| 37 | 37 | */ |
| 38 | 38 | class CheckCore extends Base { |
| 39 | - /** |
|
| 40 | - * @var Checker |
|
| 41 | - */ |
|
| 42 | - private $checker; |
|
| 39 | + /** |
|
| 40 | + * @var Checker |
|
| 41 | + */ |
|
| 42 | + private $checker; |
|
| 43 | 43 | |
| 44 | - public function __construct(Checker $checker) { |
|
| 45 | - parent::__construct(); |
|
| 46 | - $this->checker = $checker; |
|
| 47 | - } |
|
| 44 | + public function __construct(Checker $checker) { |
|
| 45 | + parent::__construct(); |
|
| 46 | + $this->checker = $checker; |
|
| 47 | + } |
|
| 48 | 48 | |
| 49 | - /** |
|
| 50 | - * {@inheritdoc } |
|
| 51 | - */ |
|
| 52 | - protected function configure() { |
|
| 53 | - parent::configure(); |
|
| 54 | - $this |
|
| 55 | - ->setName('integrity:check-core') |
|
| 56 | - ->setDescription('Check integrity of core code using a signature.'); |
|
| 57 | - } |
|
| 49 | + /** |
|
| 50 | + * {@inheritdoc } |
|
| 51 | + */ |
|
| 52 | + protected function configure() { |
|
| 53 | + parent::configure(); |
|
| 54 | + $this |
|
| 55 | + ->setName('integrity:check-core') |
|
| 56 | + ->setDescription('Check integrity of core code using a signature.'); |
|
| 57 | + } |
|
| 58 | 58 | |
| 59 | - /** |
|
| 60 | - * {@inheritdoc } |
|
| 61 | - */ |
|
| 62 | - protected function execute(InputInterface $input, OutputInterface $output): int { |
|
| 63 | - if (!$this->checker->isCodeCheckEnforced()) { |
|
| 64 | - $output->writeln('<comment>integrity:check-core can not be used on git checkouts</comment>'); |
|
| 65 | - return 2; |
|
| 66 | - } |
|
| 59 | + /** |
|
| 60 | + * {@inheritdoc } |
|
| 61 | + */ |
|
| 62 | + protected function execute(InputInterface $input, OutputInterface $output): int { |
|
| 63 | + if (!$this->checker->isCodeCheckEnforced()) { |
|
| 64 | + $output->writeln('<comment>integrity:check-core can not be used on git checkouts</comment>'); |
|
| 65 | + return 2; |
|
| 66 | + } |
|
| 67 | 67 | |
| 68 | - $result = $this->checker->verifyCoreSignature(); |
|
| 69 | - $this->writeArrayInOutputFormat($input, $output, $result); |
|
| 70 | - if (count($result) > 0) { |
|
| 71 | - $output->writeln('<error>' . count($result) . ' errors found</error>', OutputInterface::VERBOSITY_VERBOSE); |
|
| 72 | - return 1; |
|
| 73 | - } |
|
| 74 | - $output->writeln('<info>No errors found</info>', OutputInterface::VERBOSITY_VERBOSE); |
|
| 75 | - return 0; |
|
| 76 | - } |
|
| 68 | + $result = $this->checker->verifyCoreSignature(); |
|
| 69 | + $this->writeArrayInOutputFormat($input, $output, $result); |
|
| 70 | + if (count($result) > 0) { |
|
| 71 | + $output->writeln('<error>' . count($result) . ' errors found</error>', OutputInterface::VERBOSITY_VERBOSE); |
|
| 72 | + return 1; |
|
| 73 | + } |
|
| 74 | + $output->writeln('<info>No errors found</info>', OutputInterface::VERBOSITY_VERBOSE); |
|
| 75 | + return 0; |
|
| 76 | + } |
|
| 77 | 77 | } |
@@ -68,7 +68,7 @@ |
||
| 68 | 68 | $result = $this->checker->verifyCoreSignature(); |
| 69 | 69 | $this->writeArrayInOutputFormat($input, $output, $result); |
| 70 | 70 | if (count($result) > 0) { |
| 71 | - $output->writeln('<error>' . count($result) . ' errors found</error>', OutputInterface::VERBOSITY_VERBOSE); |
|
| 71 | + $output->writeln('<error>'.count($result).' errors found</error>', OutputInterface::VERBOSITY_VERBOSE); |
|
| 72 | 72 | return 1; |
| 73 | 73 | } |
| 74 | 74 | $output->writeln('<info>No errors found</info>', OutputInterface::VERBOSITY_VERBOSE); |
@@ -41,41 +41,41 @@ |
||
| 41 | 41 | */ |
| 42 | 42 | class CheckApp extends Base { |
| 43 | 43 | |
| 44 | - /** |
|
| 45 | - * @var Checker |
|
| 46 | - */ |
|
| 47 | - private $checker; |
|
| 44 | + /** |
|
| 45 | + * @var Checker |
|
| 46 | + */ |
|
| 47 | + private $checker; |
|
| 48 | 48 | |
| 49 | - public function __construct(Checker $checker) { |
|
| 50 | - parent::__construct(); |
|
| 51 | - $this->checker = $checker; |
|
| 52 | - } |
|
| 49 | + public function __construct(Checker $checker) { |
|
| 50 | + parent::__construct(); |
|
| 51 | + $this->checker = $checker; |
|
| 52 | + } |
|
| 53 | 53 | |
| 54 | - /** |
|
| 55 | - * {@inheritdoc } |
|
| 56 | - */ |
|
| 57 | - protected function configure() { |
|
| 58 | - parent::configure(); |
|
| 59 | - $this |
|
| 60 | - ->setName('integrity:check-app') |
|
| 61 | - ->setDescription('Check integrity of an app using a signature.') |
|
| 62 | - ->addArgument('appid', InputArgument::REQUIRED, 'Application to check') |
|
| 63 | - ->addOption('path', null, InputOption::VALUE_OPTIONAL, 'Path to application. If none is given it will be guessed.'); |
|
| 64 | - } |
|
| 54 | + /** |
|
| 55 | + * {@inheritdoc } |
|
| 56 | + */ |
|
| 57 | + protected function configure() { |
|
| 58 | + parent::configure(); |
|
| 59 | + $this |
|
| 60 | + ->setName('integrity:check-app') |
|
| 61 | + ->setDescription('Check integrity of an app using a signature.') |
|
| 62 | + ->addArgument('appid', InputArgument::REQUIRED, 'Application to check') |
|
| 63 | + ->addOption('path', null, InputOption::VALUE_OPTIONAL, 'Path to application. If none is given it will be guessed.'); |
|
| 64 | + } |
|
| 65 | 65 | |
| 66 | - /** |
|
| 67 | - * {@inheritdoc } |
|
| 68 | - */ |
|
| 69 | - protected function execute(InputInterface $input, OutputInterface $output): int { |
|
| 70 | - $appid = $input->getArgument('appid'); |
|
| 71 | - $path = (string)$input->getOption('path'); |
|
| 72 | - $result = $this->checker->verifyAppSignature($appid, $path, true); |
|
| 73 | - $this->writeArrayInOutputFormat($input, $output, $result); |
|
| 74 | - if (count($result) > 0) { |
|
| 75 | - $output->writeln('<error>' . count($result) . ' errors found</error>', OutputInterface::VERBOSITY_VERBOSE); |
|
| 76 | - return 1; |
|
| 77 | - } |
|
| 78 | - $output->writeln('<info>No errors found</info>', OutputInterface::VERBOSITY_VERBOSE); |
|
| 79 | - return 0; |
|
| 80 | - } |
|
| 66 | + /** |
|
| 67 | + * {@inheritdoc } |
|
| 68 | + */ |
|
| 69 | + protected function execute(InputInterface $input, OutputInterface $output): int { |
|
| 70 | + $appid = $input->getArgument('appid'); |
|
| 71 | + $path = (string)$input->getOption('path'); |
|
| 72 | + $result = $this->checker->verifyAppSignature($appid, $path, true); |
|
| 73 | + $this->writeArrayInOutputFormat($input, $output, $result); |
|
| 74 | + if (count($result) > 0) { |
|
| 75 | + $output->writeln('<error>' . count($result) . ' errors found</error>', OutputInterface::VERBOSITY_VERBOSE); |
|
| 76 | + return 1; |
|
| 77 | + } |
|
| 78 | + $output->writeln('<info>No errors found</info>', OutputInterface::VERBOSITY_VERBOSE); |
|
| 79 | + return 0; |
|
| 80 | + } |
|
| 81 | 81 | } |
@@ -68,11 +68,11 @@ |
||
| 68 | 68 | */ |
| 69 | 69 | protected function execute(InputInterface $input, OutputInterface $output): int { |
| 70 | 70 | $appid = $input->getArgument('appid'); |
| 71 | - $path = (string)$input->getOption('path'); |
|
| 71 | + $path = (string) $input->getOption('path'); |
|
| 72 | 72 | $result = $this->checker->verifyAppSignature($appid, $path, true); |
| 73 | 73 | $this->writeArrayInOutputFormat($input, $output, $result); |
| 74 | 74 | if (count($result) > 0) { |
| 75 | - $output->writeln('<error>' . count($result) . ' errors found</error>', OutputInterface::VERBOSITY_VERBOSE); |
|
| 75 | + $output->writeln('<error>'.count($result).' errors found</error>', OutputInterface::VERBOSITY_VERBOSE); |
|
| 76 | 76 | return 1; |
| 77 | 77 | } |
| 78 | 78 | $output->writeln('<info>No errors found</info>', OutputInterface::VERBOSITY_VERBOSE); |