Passed
Push — master ( 0f9b88...fa914f )
by Roeland
14:25 queued 12s
created
core/Command/Security/ImportCertificate.php 1 patch
Indentation   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -33,36 +33,36 @@
 block discarded – undo
33 33
 
34 34
 class ImportCertificate extends Base {
35 35
 
36
-	/** @var ICertificateManager */
37
-	protected $certificateManager;
36
+    /** @var ICertificateManager */
37
+    protected $certificateManager;
38 38
 
39
-	public function __construct(ICertificateManager $certificateManager) {
40
-		$this->certificateManager = $certificateManager;
41
-		parent::__construct();
42
-	}
39
+    public function __construct(ICertificateManager $certificateManager) {
40
+        $this->certificateManager = $certificateManager;
41
+        parent::__construct();
42
+    }
43 43
 
44
-	protected function configure() {
45
-		$this
46
-			->setName('security:certificates:import')
47
-			->setDescription('import trusted certificate')
48
-			->addArgument(
49
-				'path',
50
-				InputArgument::REQUIRED,
51
-				'path to the certificate to import'
52
-			);
53
-	}
44
+    protected function configure() {
45
+        $this
46
+            ->setName('security:certificates:import')
47
+            ->setDescription('import trusted certificate')
48
+            ->addArgument(
49
+                'path',
50
+                InputArgument::REQUIRED,
51
+                'path to the certificate to import'
52
+            );
53
+    }
54 54
 
55
-	protected function execute(InputInterface $input, OutputInterface $output) {
56
-		$path = $input->getArgument('path');
55
+    protected function execute(InputInterface $input, OutputInterface $output) {
56
+        $path = $input->getArgument('path');
57 57
 
58
-		if (!file_exists($path)) {
59
-			$output->writeln('<error>certificate not found</error>');
60
-			return;
61
-		}
58
+        if (!file_exists($path)) {
59
+            $output->writeln('<error>certificate not found</error>');
60
+            return;
61
+        }
62 62
 
63
-		$certData = file_get_contents($path);
64
-		$name = basename($path);
63
+        $certData = file_get_contents($path);
64
+        $name = basename($path);
65 65
 
66
-		$this->certificateManager->addCertificate($certData, $name);
67
-	}
66
+        $this->certificateManager->addCertificate($certData, $name);
67
+    }
68 68
 }
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.
core/Command/Config/App/DeleteConfig.php 1 patch
Indentation   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -29,53 +29,53 @@
 block discarded – undo
29 29
 use Symfony\Component\Console\Output\OutputInterface;
30 30
 
31 31
 class DeleteConfig extends Base {
32
-	/** * @var IConfig */
33
-	protected $config;
32
+    /** * @var IConfig */
33
+    protected $config;
34 34
 
35
-	/**
36
-	 * @param IConfig $config
37
-	 */
38
-	public function __construct(IConfig $config) {
39
-		parent::__construct();
40
-		$this->config = $config;
41
-	}
35
+    /**
36
+     * @param IConfig $config
37
+     */
38
+    public function __construct(IConfig $config) {
39
+        parent::__construct();
40
+        $this->config = $config;
41
+    }
42 42
 
43
-	protected function configure() {
44
-		parent::configure();
43
+    protected function configure() {
44
+        parent::configure();
45 45
 
46
-		$this
47
-			->setName('config:app:delete')
48
-			->setDescription('Delete an app config value')
49
-			->addArgument(
50
-				'app',
51
-				InputArgument::REQUIRED,
52
-				'Name of the app'
53
-			)
54
-			->addArgument(
55
-				'name',
56
-				InputArgument::REQUIRED,
57
-				'Name of the config to delete'
58
-			)
59
-			->addOption(
60
-				'error-if-not-exists',
61
-				null,
62
-				InputOption::VALUE_NONE,
63
-				'Checks whether the config exists before deleting it'
64
-			)
65
-		;
66
-	}
46
+        $this
47
+            ->setName('config:app:delete')
48
+            ->setDescription('Delete an app config value')
49
+            ->addArgument(
50
+                'app',
51
+                InputArgument::REQUIRED,
52
+                'Name of the app'
53
+            )
54
+            ->addArgument(
55
+                'name',
56
+                InputArgument::REQUIRED,
57
+                'Name of the config to delete'
58
+            )
59
+            ->addOption(
60
+                'error-if-not-exists',
61
+                null,
62
+                InputOption::VALUE_NONE,
63
+                'Checks whether the config exists before deleting it'
64
+            )
65
+        ;
66
+    }
67 67
 
68
-	protected function execute(InputInterface $input, OutputInterface $output) {
69
-		$appName = $input->getArgument('app');
70
-		$configName = $input->getArgument('name');
68
+    protected function execute(InputInterface $input, OutputInterface $output) {
69
+        $appName = $input->getArgument('app');
70
+        $configName = $input->getArgument('name');
71 71
 
72
-		if ($input->hasParameterOption('--error-if-not-exists') && !in_array($configName, $this->config->getAppKeys($appName))) {
73
-			$output->writeln('<error>Config ' . $configName . ' of app ' . $appName . ' could not be deleted because it did not exist</error>');
74
-			return 1;
75
-		}
72
+        if ($input->hasParameterOption('--error-if-not-exists') && !in_array($configName, $this->config->getAppKeys($appName))) {
73
+            $output->writeln('<error>Config ' . $configName . ' of app ' . $appName . ' could not be deleted because it did not exist</error>');
74
+            return 1;
75
+        }
76 76
 
77
-		$this->config->deleteAppValue($appName, $configName);
78
-		$output->writeln('<info>Config value ' . $configName . ' of app ' . $appName . ' deleted</info>');
79
-		return 0;
80
-	}
77
+        $this->config->deleteAppValue($appName, $configName);
78
+        $output->writeln('<info>Config value ' . $configName . ' of app ' . $appName . ' deleted</info>');
79
+        return 0;
80
+    }
81 81
 }
Please login to merge, or discard this patch.
core/Command/Config/App/Base.php 1 patch
Indentation   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -26,23 +26,23 @@
 block discarded – undo
26 26
 
27 27
 abstract class Base extends \OC\Core\Command\Base {
28 28
 
29
-	/** * @var IConfig */
30
-	protected $config;
29
+    /** * @var IConfig */
30
+    protected $config;
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 === 'app') {
39
-			return \OC_App::getAllApps();
40
-		}
32
+    /**
33
+     * @param string $argumentName
34
+     * @param CompletionContext $context
35
+     * @return string[]
36
+     */
37
+    public function completeArgumentValues($argumentName, CompletionContext $context) {
38
+        if ($argumentName === 'app') {
39
+            return \OC_App::getAllApps();
40
+        }
41 41
 
42
-		if ($argumentName === 'name') {
43
-			$appName = $context->getWordAtIndex($context->getWordIndex() - 1);
44
-			return $this->config->getAppKeys($appName);
45
-		}
46
-		return [];
47
-	}
42
+        if ($argumentName === 'name') {
43
+            $appName = $context->getWordAtIndex($context->getWordIndex() - 1);
44
+            return $this->config->getAppKeys($appName);
45
+        }
46
+        return [];
47
+    }
48 48
 }
Please login to merge, or discard this patch.
core/Command/Config/App/SetConfig.php 1 patch
Indentation   +50 added lines, -50 removed lines patch added patch discarded remove patch
@@ -29,61 +29,61 @@
 block discarded – undo
29 29
 use Symfony\Component\Console\Output\OutputInterface;
30 30
 
31 31
 class SetConfig extends Base {
32
-	/** * @var IConfig */
33
-	protected $config;
32
+    /** * @var IConfig */
33
+    protected $config;
34 34
 
35
-	/**
36
-	 * @param IConfig $config
37
-	 */
38
-	public function __construct(IConfig $config) {
39
-		parent::__construct();
40
-		$this->config = $config;
41
-	}
35
+    /**
36
+     * @param IConfig $config
37
+     */
38
+    public function __construct(IConfig $config) {
39
+        parent::__construct();
40
+        $this->config = $config;
41
+    }
42 42
 
43
-	protected function configure() {
44
-		parent::configure();
43
+    protected function configure() {
44
+        parent::configure();
45 45
 
46
-		$this
47
-			->setName('config:app:set')
48
-			->setDescription('Set an app config value')
49
-			->addArgument(
50
-				'app',
51
-				InputArgument::REQUIRED,
52
-				'Name of the app'
53
-			)
54
-			->addArgument(
55
-				'name',
56
-				InputArgument::REQUIRED,
57
-				'Name of the config to set'
58
-			)
59
-			->addOption(
60
-				'value',
61
-				null,
62
-				InputOption::VALUE_REQUIRED,
63
-				'The new value of the config'
64
-			)
65
-			->addOption(
66
-				'update-only',
67
-				null,
68
-				InputOption::VALUE_NONE,
69
-				'Only updates the value, if it is not set before, it is not being added'
70
-			)
71
-		;
72
-	}
46
+        $this
47
+            ->setName('config:app:set')
48
+            ->setDescription('Set an app config value')
49
+            ->addArgument(
50
+                'app',
51
+                InputArgument::REQUIRED,
52
+                'Name of the app'
53
+            )
54
+            ->addArgument(
55
+                'name',
56
+                InputArgument::REQUIRED,
57
+                'Name of the config to set'
58
+            )
59
+            ->addOption(
60
+                'value',
61
+                null,
62
+                InputOption::VALUE_REQUIRED,
63
+                'The new value of the config'
64
+            )
65
+            ->addOption(
66
+                'update-only',
67
+                null,
68
+                InputOption::VALUE_NONE,
69
+                'Only updates the value, if it is not set before, it is not being added'
70
+            )
71
+        ;
72
+    }
73 73
 
74
-	protected function execute(InputInterface $input, OutputInterface $output) {
75
-		$appName = $input->getArgument('app');
76
-		$configName = $input->getArgument('name');
74
+    protected function execute(InputInterface $input, OutputInterface $output) {
75
+        $appName = $input->getArgument('app');
76
+        $configName = $input->getArgument('name');
77 77
 
78
-		if (!in_array($configName, $this->config->getAppKeys($appName)) && $input->hasParameterOption('--update-only')) {
79
-			$output->writeln('<comment>Config value ' . $configName . ' for app ' . $appName . ' not updated, as it has not been set before.</comment>');
80
-			return 1;
81
-		}
78
+        if (!in_array($configName, $this->config->getAppKeys($appName)) && $input->hasParameterOption('--update-only')) {
79
+            $output->writeln('<comment>Config value ' . $configName . ' for app ' . $appName . ' not updated, as it has not been set before.</comment>');
80
+            return 1;
81
+        }
82 82
 
83
-		$configValue = $input->getOption('value');
84
-		$this->config->setAppValue($appName, $configName, $configValue);
83
+        $configValue = $input->getOption('value');
84
+        $this->config->setAppValue($appName, $configName, $configValue);
85 85
 
86
-		$output->writeln('<info>Config value ' . $configName . ' for app ' . $appName . ' set to ' . $configValue . '</info>');
87
-		return 0;
88
-	}
86
+        $output->writeln('<info>Config value ' . $configName . ' for app ' . $appName . ' set to ' . $configValue . '</info>');
87
+        return 0;
88
+    }
89 89
 }
Please login to merge, or discard this patch.
core/Command/Config/App/GetConfig.php 1 patch
Indentation   +54 added lines, -54 removed lines patch added patch discarded remove patch
@@ -29,65 +29,65 @@
 block discarded – undo
29 29
 use Symfony\Component\Console\Output\OutputInterface;
30 30
 
31 31
 class GetConfig extends Base {
32
-	/** * @var IConfig */
33
-	protected $config;
32
+    /** * @var IConfig */
33
+    protected $config;
34 34
 
35
-	/**
36
-	 * @param IConfig $config
37
-	 */
38
-	public function __construct(IConfig $config) {
39
-		parent::__construct();
40
-		$this->config = $config;
41
-	}
35
+    /**
36
+     * @param IConfig $config
37
+     */
38
+    public function __construct(IConfig $config) {
39
+        parent::__construct();
40
+        $this->config = $config;
41
+    }
42 42
 
43
-	protected function configure() {
44
-		parent::configure();
43
+    protected function configure() {
44
+        parent::configure();
45 45
 
46
-		$this
47
-			->setName('config:app:get')
48
-			->setDescription('Get an app config value')
49
-			->addArgument(
50
-				'app',
51
-				InputArgument::REQUIRED,
52
-				'Name of the app'
53
-			)
54
-			->addArgument(
55
-				'name',
56
-				InputArgument::REQUIRED,
57
-				'Name of the config to get'
58
-			)
59
-			->addOption(
60
-				'default-value',
61
-				null,
62
-				InputOption::VALUE_OPTIONAL,
63
-				'If no default value is set and the config does not exist, the command will exit with 1'
64
-			)
65
-		;
66
-	}
46
+        $this
47
+            ->setName('config:app:get')
48
+            ->setDescription('Get an app config value')
49
+            ->addArgument(
50
+                'app',
51
+                InputArgument::REQUIRED,
52
+                'Name of the app'
53
+            )
54
+            ->addArgument(
55
+                'name',
56
+                InputArgument::REQUIRED,
57
+                'Name of the config to get'
58
+            )
59
+            ->addOption(
60
+                'default-value',
61
+                null,
62
+                InputOption::VALUE_OPTIONAL,
63
+                'If no default value is set and the config does not exist, the command will exit with 1'
64
+            )
65
+        ;
66
+    }
67 67
 
68
-	/**
69
-	 * Executes the current command.
70
-	 *
71
-	 * @param InputInterface  $input  An InputInterface instance
72
-	 * @param OutputInterface $output An OutputInterface instance
73
-	 * @return null|int null or 0 if everything went fine, or an error code
74
-	 */
75
-	protected function execute(InputInterface $input, OutputInterface $output) {
76
-		$appName = $input->getArgument('app');
77
-		$configName = $input->getArgument('name');
78
-		$defaultValue = $input->getOption('default-value');
68
+    /**
69
+     * Executes the current command.
70
+     *
71
+     * @param InputInterface  $input  An InputInterface instance
72
+     * @param OutputInterface $output An OutputInterface instance
73
+     * @return null|int null or 0 if everything went fine, or an error code
74
+     */
75
+    protected function execute(InputInterface $input, OutputInterface $output) {
76
+        $appName = $input->getArgument('app');
77
+        $configName = $input->getArgument('name');
78
+        $defaultValue = $input->getOption('default-value');
79 79
 
80
-		if (!in_array($configName, $this->config->getAppKeys($appName)) && !$input->hasParameterOption('--default-value')) {
81
-			return 1;
82
-		}
80
+        if (!in_array($configName, $this->config->getAppKeys($appName)) && !$input->hasParameterOption('--default-value')) {
81
+            return 1;
82
+        }
83 83
 
84
-		if (!in_array($configName, $this->config->getAppKeys($appName))) {
85
-			$configValue = $defaultValue;
86
-		} else {
87
-			$configValue = $this->config->getAppValue($appName, $configName);
88
-		}
84
+        if (!in_array($configName, $this->config->getAppKeys($appName))) {
85
+            $configValue = $defaultValue;
86
+        } else {
87
+            $configValue = $this->config->getAppValue($appName, $configName);
88
+        }
89 89
 
90
-		$this->writeMixedInOutputFormat($input, $output, $configValue);
91
-		return 0;
92
-	}
90
+        $this->writeMixedInOutputFormat($input, $output, $configValue);
91
+        return 0;
92
+    }
93 93
 }
Please login to merge, or discard this patch.
core/Command/Maintenance/DataFingerprint.php 1 patch
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -30,25 +30,25 @@
 block discarded – undo
30 30
 
31 31
 class DataFingerprint extends Command {
32 32
 
33
-	/** @var IConfig */
34
-	protected $config;
35
-	/** @var ITimeFactory */
36
-	protected $timeFactory;
33
+    /** @var IConfig */
34
+    protected $config;
35
+    /** @var ITimeFactory */
36
+    protected $timeFactory;
37 37
 
38
-	public function __construct(IConfig $config,
39
-								ITimeFactory $timeFactory) {
40
-		$this->config = $config;
41
-		$this->timeFactory = $timeFactory;
42
-		parent::__construct();
43
-	}
38
+    public function __construct(IConfig $config,
39
+                                ITimeFactory $timeFactory) {
40
+        $this->config = $config;
41
+        $this->timeFactory = $timeFactory;
42
+        parent::__construct();
43
+    }
44 44
 
45
-	protected function configure() {
46
-		$this
47
-			->setName('maintenance:data-fingerprint')
48
-			->setDescription('update the systems data-fingerprint after a backup is restored');
49
-	}
45
+    protected function configure() {
46
+        $this
47
+            ->setName('maintenance:data-fingerprint')
48
+            ->setDescription('update the systems data-fingerprint after a backup is restored');
49
+    }
50 50
 
51
-	protected function execute(InputInterface $input, OutputInterface $output) {
52
-		$this->config->setSystemValue('data-fingerprint', md5($this->timeFactory->getTime()));
53
-	}
51
+    protected function execute(InputInterface $input, OutputInterface $output) {
52
+        $this->config->setSystemValue('data-fingerprint', md5($this->timeFactory->getTime()));
53
+    }
54 54
 }
Please login to merge, or discard this patch.
core/Command/App/GetPath.php 1 patch
Indentation   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -29,48 +29,48 @@
 block discarded – undo
29 29
 use Symfony\Component\Console\Output\OutputInterface;
30 30
 
31 31
 class GetPath extends Base {
32
-	protected function configure() {
33
-		parent::configure();
32
+    protected function configure() {
33
+        parent::configure();
34 34
 
35
-		$this
36
-			->setName('app:getpath')
37
-			->setDescription('Get an absolute path to the app directory')
38
-			->addArgument(
39
-				'app',
40
-				InputArgument::REQUIRED,
41
-				'Name of the app'
42
-			)
43
-		;
44
-	}
35
+        $this
36
+            ->setName('app:getpath')
37
+            ->setDescription('Get an absolute path to the app directory')
38
+            ->addArgument(
39
+                'app',
40
+                InputArgument::REQUIRED,
41
+                'Name of the app'
42
+            )
43
+        ;
44
+    }
45 45
 
46
-	/**
47
-	 * Executes the current command.
48
-	 *
49
-	 * @param InputInterface  $input  An InputInterface instance
50
-	 * @param OutputInterface $output An OutputInterface instance
51
-	 * @return null|int null or 0 if everything went fine, or an error code
52
-	 */
53
-	protected function execute(InputInterface $input, OutputInterface $output) {
54
-		$appName = $input->getArgument('app');
55
-		$path = \OC_App::getAppPath($appName);
56
-		if ($path !== false) {
57
-			$output->writeln($path);
58
-			return 0;
59
-		}
46
+    /**
47
+     * Executes the current command.
48
+     *
49
+     * @param InputInterface  $input  An InputInterface instance
50
+     * @param OutputInterface $output An OutputInterface instance
51
+     * @return null|int null or 0 if everything went fine, or an error code
52
+     */
53
+    protected function execute(InputInterface $input, OutputInterface $output) {
54
+        $appName = $input->getArgument('app');
55
+        $path = \OC_App::getAppPath($appName);
56
+        if ($path !== false) {
57
+            $output->writeln($path);
58
+            return 0;
59
+        }
60 60
 
61
-		// App not found, exit with non-zero
62
-		return 1;
63
-	}
61
+        // App not found, exit with non-zero
62
+        return 1;
63
+    }
64 64
 
65
-	/**
66
-	 * @param string $argumentName
67
-	 * @param CompletionContext $context
68
-	 * @return string[]
69
-	 */
70
-	public function completeArgumentValues($argumentName, CompletionContext $context) {
71
-		if ($argumentName === 'app') {
72
-			return \OC_App::getAllApps();
73
-		}
74
-		return [];
75
-	}
65
+    /**
66
+     * @param string $argumentName
67
+     * @param CompletionContext $context
68
+     * @return string[]
69
+     */
70
+    public function completeArgumentValues($argumentName, CompletionContext $context) {
71
+        if ($argumentName === 'app') {
72
+            return \OC_App::getAllApps();
73
+        }
74
+        return [];
75
+    }
76 76
 }
Please login to merge, or discard this patch.