Passed
Push — master ( 1bc65d...fd372a )
by Roeland
11:13 queued 10s
created
core/Command/Integrity/SignApp.php 1 patch
Indentation   +65 added lines, -65 removed lines patch added patch discarded remove patch
@@ -38,76 +38,76 @@
 block discarded – undo
38 38
  * @package OC\Core\Command\Integrity
39 39
  */
40 40
 class SignApp extends Command {
41
-	/** @var Checker */
42
-	private $checker;
43
-	/** @var FileAccessHelper */
44
-	private $fileAccessHelper;
45
-	/** @var IURLGenerator */
46
-	private $urlGenerator;
41
+    /** @var Checker */
42
+    private $checker;
43
+    /** @var FileAccessHelper */
44
+    private $fileAccessHelper;
45
+    /** @var IURLGenerator */
46
+    private $urlGenerator;
47 47
 
48
-	/**
49
-	 * @param Checker $checker
50
-	 * @param FileAccessHelper $fileAccessHelper
51
-	 * @param IURLGenerator $urlGenerator
52
-	 */
53
-	public function __construct(Checker $checker,
54
-								FileAccessHelper $fileAccessHelper,
55
-								IURLGenerator $urlGenerator) {
56
-		parent::__construct(null);
57
-		$this->checker = $checker;
58
-		$this->fileAccessHelper = $fileAccessHelper;
59
-		$this->urlGenerator = $urlGenerator;
60
-	}
48
+    /**
49
+     * @param Checker $checker
50
+     * @param FileAccessHelper $fileAccessHelper
51
+     * @param IURLGenerator $urlGenerator
52
+     */
53
+    public function __construct(Checker $checker,
54
+                                FileAccessHelper $fileAccessHelper,
55
+                                IURLGenerator $urlGenerator) {
56
+        parent::__construct(null);
57
+        $this->checker = $checker;
58
+        $this->fileAccessHelper = $fileAccessHelper;
59
+        $this->urlGenerator = $urlGenerator;
60
+    }
61 61
 
62
-	protected function configure() {
63
-		$this
64
-			->setName('integrity:sign-app')
65
-			->setDescription('Signs an app using a private key.')
66
-			->addOption('path', null, InputOption::VALUE_REQUIRED, 'Application to sign')
67
-			->addOption('privateKey', null, InputOption::VALUE_REQUIRED, 'Path to private key to use for signing')
68
-			->addOption('certificate', null, InputOption::VALUE_REQUIRED, 'Path to certificate to use for signing');
69
-	}
62
+    protected function configure() {
63
+        $this
64
+            ->setName('integrity:sign-app')
65
+            ->setDescription('Signs an app using a private key.')
66
+            ->addOption('path', null, InputOption::VALUE_REQUIRED, 'Application to sign')
67
+            ->addOption('privateKey', null, InputOption::VALUE_REQUIRED, 'Path to private key to use for signing')
68
+            ->addOption('certificate', null, InputOption::VALUE_REQUIRED, 'Path to certificate to use for signing');
69
+    }
70 70
 
71
-	/**
72
-	 * {@inheritdoc }
73
-	 */
74
-	protected function execute(InputInterface $input, OutputInterface $output) {
75
-		$path = $input->getOption('path');
76
-		$privateKeyPath = $input->getOption('privateKey');
77
-		$keyBundlePath = $input->getOption('certificate');
78
-		if(is_null($path) || is_null($privateKeyPath) || is_null($keyBundlePath)) {
79
-			$documentationUrl = $this->urlGenerator->linkToDocs('developer-code-integrity');
80
-			$output->writeln('This command requires the --path, --privateKey and --certificate.');
81
-			$output->writeln('Example: ./occ integrity:sign-app --path="/Users/lukasreschke/Programming/myapp/" --privateKey="/Users/lukasreschke/private/myapp.key" --certificate="/Users/lukasreschke/public/mycert.crt"');
82
-			$output->writeln('For more information please consult the documentation: '. $documentationUrl);
83
-			return null;
84
-		}
71
+    /**
72
+     * {@inheritdoc }
73
+     */
74
+    protected function execute(InputInterface $input, OutputInterface $output) {
75
+        $path = $input->getOption('path');
76
+        $privateKeyPath = $input->getOption('privateKey');
77
+        $keyBundlePath = $input->getOption('certificate');
78
+        if(is_null($path) || is_null($privateKeyPath) || is_null($keyBundlePath)) {
79
+            $documentationUrl = $this->urlGenerator->linkToDocs('developer-code-integrity');
80
+            $output->writeln('This command requires the --path, --privateKey and --certificate.');
81
+            $output->writeln('Example: ./occ integrity:sign-app --path="/Users/lukasreschke/Programming/myapp/" --privateKey="/Users/lukasreschke/private/myapp.key" --certificate="/Users/lukasreschke/public/mycert.crt"');
82
+            $output->writeln('For more information please consult the documentation: '. $documentationUrl);
83
+            return null;
84
+        }
85 85
 
86
-		$privateKey = $this->fileAccessHelper->file_get_contents($privateKeyPath);
87
-		$keyBundle = $this->fileAccessHelper->file_get_contents($keyBundlePath);
86
+        $privateKey = $this->fileAccessHelper->file_get_contents($privateKeyPath);
87
+        $keyBundle = $this->fileAccessHelper->file_get_contents($keyBundlePath);
88 88
 
89
-		if($privateKey === false) {
90
-			$output->writeln(sprintf('Private key "%s" does not exists.', $privateKeyPath));
91
-			return null;
92
-		}
89
+        if($privateKey === false) {
90
+            $output->writeln(sprintf('Private key "%s" does not exists.', $privateKeyPath));
91
+            return null;
92
+        }
93 93
 
94
-		if($keyBundle === false) {
95
-			$output->writeln(sprintf('Certificate "%s" does not exists.', $keyBundlePath));
96
-			return null;
97
-		}
94
+        if($keyBundle === false) {
95
+            $output->writeln(sprintf('Certificate "%s" does not exists.', $keyBundlePath));
96
+            return null;
97
+        }
98 98
 
99
-		$rsa = new RSA();
100
-		$rsa->loadKey($privateKey);
101
-		$x509 = new X509();
102
-		$x509->loadX509($keyBundle);
103
-		$x509->setPrivateKey($rsa);
104
-		try {
105
-			$this->checker->writeAppSignature($path, $x509, $rsa);
106
-			$output->writeln('Successfully signed "'.$path.'"');
107
-		} catch (\Exception $e){
108
-			$output->writeln('Error: ' . $e->getMessage());
109
-			return 1;
110
-		}
111
-		return 0;
112
-	}
99
+        $rsa = new RSA();
100
+        $rsa->loadKey($privateKey);
101
+        $x509 = new X509();
102
+        $x509->loadX509($keyBundle);
103
+        $x509->setPrivateKey($rsa);
104
+        try {
105
+            $this->checker->writeAppSignature($path, $x509, $rsa);
106
+            $output->writeln('Successfully signed "'.$path.'"');
107
+        } catch (\Exception $e){
108
+            $output->writeln('Error: ' . $e->getMessage());
109
+            return 1;
110
+        }
111
+        return 0;
112
+    }
113 113
 }
Please login to merge, or discard this patch.
core/Command/Integrity/CheckCore.php 1 patch
Indentation   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -34,34 +34,34 @@
 block discarded – undo
34 34
  * @package OC\Core\Command\Integrity
35 35
  */
36 36
 class CheckCore extends Base {
37
-	/**
38
-	 * @var Checker
39
-	 */
40
-	private $checker;
37
+    /**
38
+     * @var Checker
39
+     */
40
+    private $checker;
41 41
 
42
-	public function __construct(Checker $checker) {
43
-		parent::__construct();
44
-		$this->checker = $checker;
45
-	}
42
+    public function __construct(Checker $checker) {
43
+        parent::__construct();
44
+        $this->checker = $checker;
45
+    }
46 46
 
47
-	/**
48
-	 * {@inheritdoc }
49
-	 */
50
-	protected function configure() {
51
-		parent::configure();
52
-		$this
53
-			->setName('integrity:check-core')
54
-			->setDescription('Check integrity of core code using a signature.');
55
-	}
47
+    /**
48
+     * {@inheritdoc }
49
+     */
50
+    protected function configure() {
51
+        parent::configure();
52
+        $this
53
+            ->setName('integrity:check-core')
54
+            ->setDescription('Check integrity of core code using a signature.');
55
+    }
56 56
 
57
-	/**
58
-	 * {@inheritdoc }
59
-	 */
60
-	protected function execute(InputInterface $input, OutputInterface $output) {
61
-		$result = $this->checker->verifyCoreSignature();
62
-		$this->writeArrayInOutputFormat($input, $output, $result);
63
-		if (count($result)>0){
64
-			return 1;
65
-		}
66
-	}
57
+    /**
58
+     * {@inheritdoc }
59
+     */
60
+    protected function execute(InputInterface $input, OutputInterface $output) {
61
+        $result = $this->checker->verifyCoreSignature();
62
+        $this->writeArrayInOutputFormat($input, $output, $result);
63
+        if (count($result)>0){
64
+            return 1;
65
+        }
66
+    }
67 67
 }
Please login to merge, or discard this patch.
core/Command/User/Report.php 1 patch
Indentation   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -32,56 +32,56 @@
 block discarded – undo
32 32
 use Symfony\Component\Console\Output\OutputInterface;
33 33
 
34 34
 class Report extends Command {
35
-	/** @var IUserManager */
36
-	protected $userManager;
35
+    /** @var IUserManager */
36
+    protected $userManager;
37 37
 
38
-	/**
39
-	 * @param IUserManager $userManager
40
-	 */
41
-	public function __construct(IUserManager $userManager) {
42
-		$this->userManager = $userManager;
43
-		parent::__construct();
44
-	}
38
+    /**
39
+     * @param IUserManager $userManager
40
+     */
41
+    public function __construct(IUserManager $userManager) {
42
+        $this->userManager = $userManager;
43
+        parent::__construct();
44
+    }
45 45
 
46
-	protected function configure() {
47
-		$this
48
-			->setName('user:report')
49
-			->setDescription('shows how many users have access');
50
-	}
46
+    protected function configure() {
47
+        $this
48
+            ->setName('user:report')
49
+            ->setDescription('shows how many users have access');
50
+    }
51 51
 
52
-	protected function execute(InputInterface $input, OutputInterface $output) {
53
-		$table = new Table($output);
54
-		$table->setHeaders(array('User Report', ''));
55
-		$userCountArray = $this->countUsers();
56
-		if(!empty($userCountArray)) {
57
-			$total = 0;
58
-			$rows = array();
59
-			foreach($userCountArray as $classname => $users) {
60
-				$total += $users;
61
-				$rows[] = array($classname, $users);
62
-			}
52
+    protected function execute(InputInterface $input, OutputInterface $output) {
53
+        $table = new Table($output);
54
+        $table->setHeaders(array('User Report', ''));
55
+        $userCountArray = $this->countUsers();
56
+        if(!empty($userCountArray)) {
57
+            $total = 0;
58
+            $rows = array();
59
+            foreach($userCountArray as $classname => $users) {
60
+                $total += $users;
61
+                $rows[] = array($classname, $users);
62
+            }
63 63
 
64
-			$rows[] = array(' ');
65
-			$rows[] = array('total users', $total);
66
-		} else {
67
-			$rows[] = array('No backend enabled that supports user counting', '');
68
-		}
64
+            $rows[] = array(' ');
65
+            $rows[] = array('total users', $total);
66
+        } else {
67
+            $rows[] = array('No backend enabled that supports user counting', '');
68
+        }
69 69
 
70
-		$userDirectoryCount = $this->countUserDirectories();
71
-		$rows[] = array(' ');
72
-		$rows[] = array('user directories', $userDirectoryCount);
70
+        $userDirectoryCount = $this->countUserDirectories();
71
+        $rows[] = array(' ');
72
+        $rows[] = array('user directories', $userDirectoryCount);
73 73
 
74
-		$table->setRows($rows);
75
-		$table->render();
76
-	}
74
+        $table->setRows($rows);
75
+        $table->render();
76
+    }
77 77
 
78
-	private function countUsers() {
79
-		return $this->userManager->countUsers();
80
-	}
78
+    private function countUsers() {
79
+        return $this->userManager->countUsers();
80
+    }
81 81
 
82
-	private function countUserDirectories() {
83
-		$dataview = new \OC\Files\View('/');
84
-		$userDirectories = $dataview->getDirectoryContent('/', 'httpd/unix-directory');
85
-		return count($userDirectories);
86
-	}
82
+    private function countUserDirectories() {
83
+        $dataview = new \OC\Files\View('/');
84
+        $userDirectories = $dataview->getDirectoryContent('/', 'httpd/unix-directory');
85
+        return count($userDirectories);
86
+    }
87 87
 }
Please login to merge, or discard this patch.
core/Command/Background/WebCron.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
 
28 28
 class WebCron extends Base {
29 29
 
30
-	protected function getMode() {
31
-		return 'webcron';
32
-	}
30
+    protected function getMode() {
31
+        return 'webcron';
32
+    }
33 33
 }
Please login to merge, or discard this patch.
core/Command/Background/Base.php 1 patch
Indentation   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -39,39 +39,39 @@
 block discarded – undo
39 39
 abstract class Base extends Command {
40 40
 
41 41
 
42
-	abstract protected function getMode();
42
+    abstract protected function getMode();
43 43
 
44
-	/**
45
-	* @var \OCP\IConfig
46
-	*/
47
-	protected $config;
44
+    /**
45
+     * @var \OCP\IConfig
46
+     */
47
+    protected $config;
48 48
 
49
-	/**
50
-	* @param \OCP\IConfig $config
51
-	*/
52
-	public function __construct(IConfig $config) {
53
-		$this->config = $config;
54
-		parent::__construct();
55
-	}
49
+    /**
50
+     * @param \OCP\IConfig $config
51
+     */
52
+    public function __construct(IConfig $config) {
53
+        $this->config = $config;
54
+        parent::__construct();
55
+    }
56 56
 
57
-	protected function configure() {
58
-		$mode = $this->getMode();
59
-		$this
60
-			->setName("background:$mode")
61
-			->setDescription("Use $mode to run background jobs");
62
-	}
57
+    protected function configure() {
58
+        $mode = $this->getMode();
59
+        $this
60
+            ->setName("background:$mode")
61
+            ->setDescription("Use $mode to run background jobs");
62
+    }
63 63
 
64
-	/**
65
-	* Executing this command will set the background job mode for owncloud.
66
-	* The mode to set is specified by the concrete sub class by implementing the
67
-	* getMode() function.
68
-	*
69
-	* @param InputInterface $input
70
-	* @param OutputInterface $output
71
-	*/
72
-	protected function execute(InputInterface $input, OutputInterface $output) {
73
-		$mode = $this->getMode();
74
-		$this->config->setAppValue( 'core', 'backgroundjobs_mode', $mode );
75
-		$output->writeln("Set mode for background jobs to '$mode'");
76
-	}
64
+    /**
65
+     * Executing this command will set the background job mode for owncloud.
66
+     * The mode to set is specified by the concrete sub class by implementing the
67
+     * getMode() function.
68
+     *
69
+     * @param InputInterface $input
70
+     * @param OutputInterface $output
71
+     */
72
+    protected function execute(InputInterface $input, OutputInterface $output) {
73
+        $mode = $this->getMode();
74
+        $this->config->setAppValue( 'core', 'backgroundjobs_mode', $mode );
75
+        $output->writeln("Set mode for background jobs to '$mode'");
76
+    }
77 77
 }
Please login to merge, or discard this patch.
core/Command/Background/Cron.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
 
28 28
 class Cron extends Base {
29 29
 
30
-	protected function getMode() {
31
-		return 'cron';
32
-	}
30
+    protected function getMode() {
31
+        return 'cron';
32
+    }
33 33
 }
Please login to merge, or discard this patch.
core/Command/Background/Ajax.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
 
28 28
 class Ajax extends Base {
29 29
 
30
-	protected function getMode() {
31
-		return 'ajax';
32
-	}
30
+    protected function getMode() {
31
+        return 'ajax';
32
+    }
33 33
 }
Please login to merge, or discard this patch.
core/Command/Config/ListConfigs.php 1 patch
Indentation   +123 added lines, -123 removed lines patch added patch discarded remove patch
@@ -32,127 +32,127 @@
 block discarded – undo
32 32
 use Symfony\Component\Console\Output\OutputInterface;
33 33
 
34 34
 class ListConfigs extends Base {
35
-	protected $defaultOutputFormat = self::OUTPUT_FORMAT_JSON_PRETTY;
36
-
37
-	/** * @var SystemConfig */
38
-	protected $systemConfig;
39
-
40
-	/** @var IAppConfig */
41
-	protected $appConfig;
42
-
43
-	/**
44
-	 * @param SystemConfig $systemConfig
45
-	 * @param IAppConfig $appConfig
46
-	 */
47
-	public function __construct(SystemConfig $systemConfig, IAppConfig $appConfig) {
48
-		parent::__construct();
49
-		$this->systemConfig = $systemConfig;
50
-		$this->appConfig = $appConfig;
51
-	}
52
-
53
-	protected function configure() {
54
-		parent::configure();
55
-
56
-		$this
57
-			->setName('config:list')
58
-			->setDescription('List all configs')
59
-			->addArgument(
60
-				'app',
61
-				InputArgument::OPTIONAL,
62
-				'Name of the app ("system" to get the config.php values, "all" for all apps and system)',
63
-				'all'
64
-			)
65
-			->addOption(
66
-				'private',
67
-				null,
68
-				InputOption::VALUE_NONE,
69
-				'Use this option when you want to include sensitive configs like passwords, salts, ...'
70
-			)
71
-		;
72
-	}
73
-
74
-	protected function execute(InputInterface $input, OutputInterface $output) {
75
-		$app = $input->getArgument('app');
76
-		$noSensitiveValues = !$input->getOption('private');
77
-
78
-		switch ($app) {
79
-			case 'system':
80
-				$configs = [
81
-					'system' => $this->getSystemConfigs($noSensitiveValues),
82
-				];
83
-			break;
84
-
85
-			case 'all':
86
-				$apps = $this->appConfig->getApps();
87
-				$configs = [
88
-					'system' => $this->getSystemConfigs($noSensitiveValues),
89
-					'apps' => [],
90
-				];
91
-				foreach ($apps as $appName) {
92
-					$configs['apps'][$appName] = $this->getAppConfigs($appName, $noSensitiveValues);
93
-				}
94
-			break;
95
-
96
-			default:
97
-				$configs = [
98
-					'apps' => [
99
-						$app => $this->getAppConfigs($app, $noSensitiveValues),
100
-					],
101
-				];
102
-		}
103
-
104
-		$this->writeArrayInOutputFormat($input, $output, $configs);
105
-	}
106
-
107
-	/**
108
-	 * Get the system configs
109
-	 *
110
-	 * @param bool $noSensitiveValues
111
-	 * @return array
112
-	 */
113
-	protected function getSystemConfigs($noSensitiveValues) {
114
-		$keys = $this->systemConfig->getKeys();
115
-
116
-		$configs = [];
117
-		foreach ($keys as $key) {
118
-			if ($noSensitiveValues) {
119
-				$value = $this->systemConfig->getFilteredValue($key, serialize(null));
120
-			} else {
121
-				$value = $this->systemConfig->getValue($key, serialize(null));
122
-			}
123
-
124
-			if ($value !== 'N;') {
125
-				$configs[$key] = $value;
126
-			}
127
-		}
128
-
129
-		return $configs;
130
-	}
131
-
132
-	/**
133
-	 * Get the app configs
134
-	 *
135
-	 * @param string $app
136
-	 * @param bool $noSensitiveValues
137
-	 * @return array
138
-	 */
139
-	protected function getAppConfigs($app, $noSensitiveValues) {
140
-		if ($noSensitiveValues) {
141
-			return $this->appConfig->getFilteredValues($app, false);
142
-		} else {
143
-			return $this->appConfig->getValues($app, false);
144
-		}
145
-	}
146
-
147
-	/**
148
-	 * @param string $argumentName
149
-	 * @param CompletionContext $context
150
-	 * @return string[]
151
-	 */
152
-	public function completeArgumentValues($argumentName, CompletionContext $context) {
153
-		if ($argumentName === 'app') {
154
-			return array_merge(['all', 'system'], \OC_App::getAllApps());
155
-		}
156
-		return [];
157
-	}
35
+    protected $defaultOutputFormat = self::OUTPUT_FORMAT_JSON_PRETTY;
36
+
37
+    /** * @var SystemConfig */
38
+    protected $systemConfig;
39
+
40
+    /** @var IAppConfig */
41
+    protected $appConfig;
42
+
43
+    /**
44
+     * @param SystemConfig $systemConfig
45
+     * @param IAppConfig $appConfig
46
+     */
47
+    public function __construct(SystemConfig $systemConfig, IAppConfig $appConfig) {
48
+        parent::__construct();
49
+        $this->systemConfig = $systemConfig;
50
+        $this->appConfig = $appConfig;
51
+    }
52
+
53
+    protected function configure() {
54
+        parent::configure();
55
+
56
+        $this
57
+            ->setName('config:list')
58
+            ->setDescription('List all configs')
59
+            ->addArgument(
60
+                'app',
61
+                InputArgument::OPTIONAL,
62
+                'Name of the app ("system" to get the config.php values, "all" for all apps and system)',
63
+                'all'
64
+            )
65
+            ->addOption(
66
+                'private',
67
+                null,
68
+                InputOption::VALUE_NONE,
69
+                'Use this option when you want to include sensitive configs like passwords, salts, ...'
70
+            )
71
+        ;
72
+    }
73
+
74
+    protected function execute(InputInterface $input, OutputInterface $output) {
75
+        $app = $input->getArgument('app');
76
+        $noSensitiveValues = !$input->getOption('private');
77
+
78
+        switch ($app) {
79
+            case 'system':
80
+                $configs = [
81
+                    'system' => $this->getSystemConfigs($noSensitiveValues),
82
+                ];
83
+            break;
84
+
85
+            case 'all':
86
+                $apps = $this->appConfig->getApps();
87
+                $configs = [
88
+                    'system' => $this->getSystemConfigs($noSensitiveValues),
89
+                    'apps' => [],
90
+                ];
91
+                foreach ($apps as $appName) {
92
+                    $configs['apps'][$appName] = $this->getAppConfigs($appName, $noSensitiveValues);
93
+                }
94
+            break;
95
+
96
+            default:
97
+                $configs = [
98
+                    'apps' => [
99
+                        $app => $this->getAppConfigs($app, $noSensitiveValues),
100
+                    ],
101
+                ];
102
+        }
103
+
104
+        $this->writeArrayInOutputFormat($input, $output, $configs);
105
+    }
106
+
107
+    /**
108
+     * Get the system configs
109
+     *
110
+     * @param bool $noSensitiveValues
111
+     * @return array
112
+     */
113
+    protected function getSystemConfigs($noSensitiveValues) {
114
+        $keys = $this->systemConfig->getKeys();
115
+
116
+        $configs = [];
117
+        foreach ($keys as $key) {
118
+            if ($noSensitiveValues) {
119
+                $value = $this->systemConfig->getFilteredValue($key, serialize(null));
120
+            } else {
121
+                $value = $this->systemConfig->getValue($key, serialize(null));
122
+            }
123
+
124
+            if ($value !== 'N;') {
125
+                $configs[$key] = $value;
126
+            }
127
+        }
128
+
129
+        return $configs;
130
+    }
131
+
132
+    /**
133
+     * Get the app configs
134
+     *
135
+     * @param string $app
136
+     * @param bool $noSensitiveValues
137
+     * @return array
138
+     */
139
+    protected function getAppConfigs($app, $noSensitiveValues) {
140
+        if ($noSensitiveValues) {
141
+            return $this->appConfig->getFilteredValues($app, false);
142
+        } else {
143
+            return $this->appConfig->getValues($app, false);
144
+        }
145
+    }
146
+
147
+    /**
148
+     * @param string $argumentName
149
+     * @param CompletionContext $context
150
+     * @return string[]
151
+     */
152
+    public function completeArgumentValues($argumentName, CompletionContext $context) {
153
+        if ($argumentName === 'app') {
154
+            return array_merge(['all', 'system'], \OC_App::getAllApps());
155
+        }
156
+        return [];
157
+    }
158 158
 }
Please login to merge, or discard this patch.
core/Command/Config/System/Base.php 1 patch
Indentation   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -26,53 +26,53 @@
 block discarded – undo
26 26
 
27 27
 abstract class Base extends \OC\Core\Command\Base {
28 28
 
29
-	/** @var SystemConfig */
30
-	protected $systemConfig;
29
+    /** @var SystemConfig */
30
+    protected $systemConfig;
31 31
 
32
-	/**
33
-	 * @param string $argumentName
34
-	 * @param CompletionContext $context
35
-	 * @return string[]
36
-	 */
37
-	public function completeArgumentValues($argumentName, CompletionContext $context) {
38
-		if ($argumentName === 'name') {
39
-			$words = $this->getPreviousNames($context, $context->getWordIndex());
40
-			if (empty($words)) {
41
-				$completions = $this->systemConfig->getKeys();
42
-			} else {
43
-				$key = array_shift($words);
44
-				$value = $this->systemConfig->getValue($key);
45
-				$completions = array_keys($value);
32
+    /**
33
+     * @param string $argumentName
34
+     * @param CompletionContext $context
35
+     * @return string[]
36
+     */
37
+    public function completeArgumentValues($argumentName, CompletionContext $context) {
38
+        if ($argumentName === 'name') {
39
+            $words = $this->getPreviousNames($context, $context->getWordIndex());
40
+            if (empty($words)) {
41
+                $completions = $this->systemConfig->getKeys();
42
+            } else {
43
+                $key = array_shift($words);
44
+                $value = $this->systemConfig->getValue($key);
45
+                $completions = array_keys($value);
46 46
 
47
-				while (!empty($words) && is_array($value)) {
48
-					$key = array_shift($words);
49
-					if (!isset($value[$key]) || !is_array($value[$key])) {
50
-						break;
51
-					}
47
+                while (!empty($words) && is_array($value)) {
48
+                    $key = array_shift($words);
49
+                    if (!isset($value[$key]) || !is_array($value[$key])) {
50
+                        break;
51
+                    }
52 52
 
53
-					$value = $value[$key];
54
-					$completions = array_keys($value);
55
-				}
56
-			}
53
+                    $value = $value[$key];
54
+                    $completions = array_keys($value);
55
+                }
56
+            }
57 57
 
58
-			return $completions;
59
-		}
60
-		return parent::completeArgumentValues($argumentName, $context);
61
-	}
58
+            return $completions;
59
+        }
60
+        return parent::completeArgumentValues($argumentName, $context);
61
+    }
62 62
 
63
-	/**
64
-	 * @param CompletionContext $context
65
-	 * @param int $currentIndex
66
-	 * @return string[]
67
-	 */
68
-	protected function getPreviousNames(CompletionContext $context, $currentIndex) {
69
-		$word = $context->getWordAtIndex($currentIndex - 1);
70
-		if ($word === $this->getName() || $currentIndex <= 0) {
71
-			return [];
72
-		}
63
+    /**
64
+     * @param CompletionContext $context
65
+     * @param int $currentIndex
66
+     * @return string[]
67
+     */
68
+    protected function getPreviousNames(CompletionContext $context, $currentIndex) {
69
+        $word = $context->getWordAtIndex($currentIndex - 1);
70
+        if ($word === $this->getName() || $currentIndex <= 0) {
71
+            return [];
72
+        }
73 73
 
74
-		$words = $this->getPreviousNames($context, $currentIndex - 1);
75
-		$words[] = $word;
76
-		return $words;
77
-	}
74
+        $words = $this->getPreviousNames($context, $currentIndex - 1);
75
+        $words[] = $word;
76
+        return $words;
77
+    }
78 78
 }
Please login to merge, or discard this patch.