Completed
Pull Request — master (#4617)
by Julius
14:00
created
core/Command/Maintenance/Mimetype/UpdateJS.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 		$keys = array_filter(array_keys($aliases), function($k) {
57 57
 			return $k[0] === '_';
58 58
 		});
59
-		foreach($keys as $key) {
59
+		foreach ($keys as $key) {
60 60
 			unset($aliases[$key]);
61 61
 		}
62 62
 
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 		$dir = new \DirectoryIterator(\OC::$SERVERROOT.'/core/img/filetypes');
65 65
 
66 66
 		$files = [];
67
-		foreach($dir as $fileInfo) {
67
+		foreach ($dir as $fileInfo) {
68 68
 			if ($fileInfo->isFile()) {
69 69
 				$file = preg_replace('/.[^.]*$/', '', $fileInfo->getFilename());
70 70
 				$files[] = $file;
@@ -78,14 +78,14 @@  discard block
 block discarded – undo
78 78
 		// Fetch all themes!
79 79
 		$themes = [];
80 80
 		$dirs = new \DirectoryIterator(\OC::$SERVERROOT.'/themes/');
81
-		foreach($dirs as $dir) {
81
+		foreach ($dirs as $dir) {
82 82
 			//Valid theme dir
83 83
 			if ($dir->isFile() || $dir->isDot()) {
84 84
 				continue;
85 85
 			}
86 86
 
87 87
 			$theme = $dir->getFilename();
88
-			$themeDir = $dir->getPath() . '/' . $theme . '/core/img/filetypes/';
88
+			$themeDir = $dir->getPath().'/'.$theme.'/core/img/filetypes/';
89 89
 			// Check if this theme has its own filetype icons
90 90
 			if (!file_exists($themeDir)) {
91 91
 				continue;
@@ -116,9 +116,9 @@  discard block
 block discarded – undo
116 116
 * To regenerate this file run ./occ maintenance:mimetypesjs
117 117
 */
118 118
 OC.MimeTypeList={
119
-	aliases: ' . json_encode($aliases, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) . ',
120
-	files: ' . json_encode($files, JSON_PRETTY_PRINT) . ',
121
-	themes: ' . json_encode($themes, JSON_PRETTY_PRINT) . '
119
+	aliases: ' . json_encode($aliases, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES).',
120
+	files: ' . json_encode($files, JSON_PRETTY_PRINT).',
121
+	themes: ' . json_encode($themes, JSON_PRETTY_PRINT).'
122 122
 };
123 123
 ';
124 124
 
Please login to merge, or discard this patch.
core/Command/App/Enable.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 		$appId = $input->getArgument('app-id');
71 71
 
72 72
 		if (!\OC_App::getAppPath($appId)) {
73
-			$output->writeln($appId . ' not found');
73
+			$output->writeln($appId.' not found');
74 74
 			return 1;
75 75
 		}
76 76
 
@@ -78,10 +78,10 @@  discard block
 block discarded – undo
78 78
 		$appClass = new \OC_App();
79 79
 		if (empty($groups)) {
80 80
 			$appClass->enable($appId);
81
-			$output->writeln($appId . ' enabled');
81
+			$output->writeln($appId.' enabled');
82 82
 		} else {
83 83
 			$appClass->enable($appId, $groups);
84
-			$output->writeln($appId . ' enabled for groups: ' . implode(', ', $groups));
84
+			$output->writeln($appId.' enabled for groups: '.implode(', ', $groups));
85 85
 		}
86 86
 		return 0;
87 87
 	}
Please login to merge, or discard this patch.
core/Command/App/Disable.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -62,13 +62,13 @@
 block discarded – undo
62 62
 		if ($this->manager->isInstalled($appId)) {
63 63
 			try {
64 64
 				$this->manager->disableApp($appId);
65
-				$output->writeln($appId . ' disabled');
66
-			} catch(\Exception $e) {
65
+				$output->writeln($appId.' disabled');
66
+			} catch (\Exception $e) {
67 67
 				$output->writeln($e->getMessage());
68 68
 				return 2;
69 69
 			}
70 70
 		} else {
71
-			$output->writeln('No such app enabled: ' . $appId);
71
+			$output->writeln('No such app enabled: '.$appId);
72 72
 		}
73 73
 	}
74 74
 
Please login to merge, or discard this patch.
core/Command/App/CheckCode.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 use Symfony\Component\Console\Input\InputOption;
38 38
 use Symfony\Component\Console\Output\OutputInterface;
39 39
 
40
-class CheckCode extends Command implements CompletionAwareInterface  {
40
+class CheckCode extends Command implements CompletionAwareInterface {
41 41
 
42 42
 	/** @var InfoParser */
43 43
 	private $infoParser;
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 				'c',
68 68
 				InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY,
69 69
 				'enable the specified checker(s)',
70
-				[ 'private', 'deprecation', 'strong-comparison' ]
70
+				['private', 'deprecation', 'strong-comparison']
71 71
 			)
72 72
 			->addOption(
73 73
 				'--skip-validate-info',
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
 		$codeChecker = new CodeChecker($checkList);
93 93
 
94 94
 		$codeChecker->listen('CodeChecker', 'analyseFileBegin', function($params) use ($output) {
95
-			if(OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) {
95
+			if (OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) {
96 96
 				$output->writeln("<info>Analysing {$params}</info>");
97 97
 			}
98 98
 		});
@@ -100,26 +100,26 @@  discard block
 block discarded – undo
100 100
 			$count = count($errors);
101 101
 
102 102
 			// show filename if the verbosity is low, but there are errors in a file
103
-			if($count > 0 && OutputInterface::VERBOSITY_VERBOSE > $output->getVerbosity()) {
103
+			if ($count > 0 && OutputInterface::VERBOSITY_VERBOSE > $output->getVerbosity()) {
104 104
 				$output->writeln("<info>Analysing {$filename}</info>");
105 105
 			}
106 106
 
107 107
 			// show error count if there are errors present or the verbosity is high
108
-			if($count > 0 || OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) {
108
+			if ($count > 0 || OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) {
109 109
 				$output->writeln(" {$count} errors");
110 110
 			}
111 111
 			usort($errors, function($a, $b) {
112
-				return $a['line'] >$b['line'];
112
+				return $a['line'] > $b['line'];
113 113
 			});
114 114
 
115
-			foreach($errors as $p) {
115
+			foreach ($errors as $p) {
116 116
 				$line = sprintf("%' 4d", $p['line']);
117 117
 				$output->writeln("    <error>line $line: {$p['disallowedToken']} - {$p['reason']}</error>");
118 118
 			}
119 119
 		});
120 120
 		$errors = $codeChecker->analyse($appId);
121 121
 
122
-		if(!$input->getOption('skip-validate-info')) {
122
+		if (!$input->getOption('skip-validate-info')) {
123 123
 			$infoChecker = new InfoChecker($this->infoParser);
124 124
 
125 125
 			$infoChecker->listen('InfoChecker', 'mandatoryFieldMissing', function($key) use ($output) {
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 			});
128 128
 
129 129
 			$infoChecker->listen('InfoChecker', 'deprecatedFieldFound', function($key, $value) use ($output) {
130
-				if($value === [] || is_null($value) || $value === '') {
130
+				if ($value === [] || is_null($value) || $value === '') {
131 131
 					$output->writeln("<info>Deprecated field available: $key</info>");
132 132
 				} else {
133 133
 					$output->writeln("<info>Deprecated field available: $key => $value</info>");
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
 				$output->writeln("<info>Migrate the app version to appinfo/info.xml (add <version>$version</version> to appinfo/info.xml and remove appinfo/version)</info>");
155 155
 			});
156 156
 
157
-			if(OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) {
157
+			if (OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) {
158 158
 				$infoChecker->listen('InfoChecker', 'mandatoryFieldFound', function($key, $value) use ($output) {
159 159
 					$output->writeln("<info>Mandatory field available: $key => $value</info>");
160 160
 				});
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
 			throw new \RuntimeException("No app with given id <$appId> known.");
195 195
 		}
196 196
 
197
-		$updatePhp = $appPath . '/appinfo/update.php';
197
+		$updatePhp = $appPath.'/appinfo/update.php';
198 198
 		if (file_exists($updatePhp)) {
199 199
 			$output->writeln("<info>Deprecated file found: $updatePhp - please use repair steps</info>");
200 200
 		}
Please login to merge, or discard this patch.
core/Command/App/ListApps.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 	}
62 62
 
63 63
 	protected function execute(InputInterface $input, OutputInterface $output) {
64
-		if ($input->getOption('shipped') === 'true' || $input->getOption('shipped') === 'false'){
64
+		if ($input->getOption('shipped') === 'true' || $input->getOption('shipped') === 'false') {
65 65
 			$shippedFilter = $input->getOption('shipped') === 'true';
66 66
 		} else {
67 67
 			$shippedFilter = null;
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 
74 74
 		//sort enabled apps above disabled apps
75 75
 		foreach ($apps as $app) {
76
-			if ($shippedFilter !== null && \OC_App::isShipped($app) !== $shippedFilter){
76
+			if ($shippedFilter !== null && \OC_App::isShipped($app) !== $shippedFilter) {
77 77
 				continue;
78 78
 			}
79 79
 			if ($this->manager->isInstalled($app)) {
Please login to merge, or discard this patch.
core/Command/Db/GenerateChangeScript.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@
 block discarded – undo
41 41
 				'schema-xml',
42 42
 				InputArgument::OPTIONAL,
43 43
 				'the schema xml to be used as target schema',
44
-				\OC::$SERVERROOT . '/db_structure.xml'
44
+				\OC::$SERVERROOT.'/db_structure.xml'
45 45
 			)
46 46
 		;
47 47
 	}
Please login to merge, or discard this patch.
core/Command/Encryption/ShowKeyStorageRoot.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
 use Symfony\Component\Console\Input\InputInterface;
29 29
 use Symfony\Component\Console\Output\OutputInterface;
30 30
 
31
-class ShowKeyStorageRoot extends Command{
31
+class ShowKeyStorageRoot extends Command {
32 32
 
33 33
 	/** @var Util  */
34 34
 	protected $util;
Please login to merge, or discard this patch.
core/Command/Encryption/Enable.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -70,9 +70,9 @@
 block discarded – undo
70 70
 			if ($defaultModule === null) {
71 71
 				$output->writeln('<error>No default module is set</error>');
72 72
 			} else if (!isset($modules[$defaultModule])) {
73
-				$output->writeln('<error>The current default module does not exist: ' . $defaultModule . '</error>');
73
+				$output->writeln('<error>The current default module does not exist: '.$defaultModule.'</error>');
74 74
 			} else {
75
-				$output->writeln('Default module: ' . $defaultModule);
75
+				$output->writeln('Default module: '.$defaultModule);
76 76
 			}
77 77
 		}
78 78
 	}
Please login to merge, or discard this patch.
core/Command/Encryption/ListModules.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@
 block discarded – undo
71 71
 				if (!$item['default']) {
72 72
 					$item = $item['displayName'];
73 73
 				} else {
74
-					$item = $item['displayName'] . ' [default*]';
74
+					$item = $item['displayName'].' [default*]';
75 75
 				}
76 76
 			});
77 77
 		}
Please login to merge, or discard this patch.