Completed
Pull Request — master (#8232)
by Joas
49:35 queued 32:43
created
lib/private/App/CodeChecker/InfoChecker.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -48,12 +48,12 @@
 block discarded – undo
48 48
 		}
49 49
 
50 50
 		$xml = new \DOMDocument();
51
-		$xml->load($appPath . '/appinfo/info.xml');
51
+		$xml->load($appPath.'/appinfo/info.xml');
52 52
 
53
-		$schema = \OC::$SERVERROOT . '/resources/app-info.xsd';
53
+		$schema = \OC::$SERVERROOT.'/resources/app-info.xsd';
54 54
 		if ($this->appManager->isShipped($appId)) {
55 55
 			// Shipped apps are allowed to have the public and default_enabled tags
56
-			$schema = \OC::$SERVERROOT . '/resources/app-info-shipped.xsd';
56
+			$schema = \OC::$SERVERROOT.'/resources/app-info-shipped.xsd';
57 57
 		}
58 58
 
59 59
 		$errors = [];
Please login to merge, or discard this patch.
core/Command/App/CheckCode.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 use OC\App\CodeChecker\DeprecationCheck;
43 43
 use OC\App\CodeChecker\PrivateCheck;
44 44
 
45
-class CheckCode extends Command implements CompletionAwareInterface  {
45
+class CheckCode extends Command implements CompletionAwareInterface {
46 46
 
47 47
 	protected $checkers = [
48 48
 		'private' => PrivateCheck::class,
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 				'c',
65 65
 				InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY,
66 66
 				'enable the specified checker(s)',
67
-				[ 'private', 'deprecation', 'strong-comparison' ]
67
+				['private', 'deprecation', 'strong-comparison']
68 68
 			)
69 69
 			->addOption(
70 70
 				'--skip-checkers',
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 		$codeChecker = new CodeChecker($checkList, !$input->getOption('skip-validate-info'));
96 96
 
97 97
 		$codeChecker->listen('CodeChecker', 'analyseFileBegin', function($params) use ($output) {
98
-			if(OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) {
98
+			if (OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) {
99 99
 				$output->writeln("<info>Analysing {$params}</info>");
100 100
 			}
101 101
 		});
@@ -103,29 +103,29 @@  discard block
 block discarded – undo
103 103
 			$count = count($errors);
104 104
 
105 105
 			// show filename if the verbosity is low, but there are errors in a file
106
-			if($count > 0 && OutputInterface::VERBOSITY_VERBOSE > $output->getVerbosity()) {
106
+			if ($count > 0 && OutputInterface::VERBOSITY_VERBOSE > $output->getVerbosity()) {
107 107
 				$output->writeln("<info>Analysing {$filename}</info>");
108 108
 			}
109 109
 
110 110
 			// show error count if there are errors present or the verbosity is high
111
-			if($count > 0 || OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) {
111
+			if ($count > 0 || OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) {
112 112
 				$output->writeln(" {$count} errors");
113 113
 			}
114 114
 			usort($errors, function($a, $b) {
115
-				return $a['line'] >$b['line'];
115
+				return $a['line'] > $b['line'];
116 116
 			});
117 117
 
118
-			foreach($errors as $p) {
118
+			foreach ($errors as $p) {
119 119
 				$line = sprintf("%' 4d", $p['line']);
120 120
 				$output->writeln("    <error>line $line: {$p['disallowedToken']} - {$p['reason']}</error>");
121 121
 			}
122 122
 		});
123 123
 		$errors = [];
124
-		if(!$input->getOption('skip-checkers')) {
124
+		if (!$input->getOption('skip-checkers')) {
125 125
 			$errors = $codeChecker->analyse($appId);
126 126
 		}
127 127
 
128
-		if(!$input->getOption('skip-validate-info')) {
128
+		if (!$input->getOption('skip-validate-info')) {
129 129
 			// Can not inject because of circular dependency
130 130
 			$infoChecker = new InfoChecker(\OC::$server->getAppManager());
131 131
 			$infoChecker->listen('InfoChecker', 'parseError', function($error) use ($output) {
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
 			throw new \RuntimeException("No app with given id <$appId> known.");
180 180
 		}
181 181
 
182
-		$updatePhp = $appPath . '/appinfo/update.php';
182
+		$updatePhp = $appPath.'/appinfo/update.php';
183 183
 		if (file_exists($updatePhp)) {
184 184
 			$output->writeln("<info>Deprecated file found: $updatePhp - please use repair steps</info>");
185 185
 		}
Please login to merge, or discard this patch.
console.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
  *
30 30
  */
31 31
 
32
-require_once __DIR__ . '/lib/versioncheck.php';
32
+require_once __DIR__.'/lib/versioncheck.php';
33 33
 
34 34
 use OC\Console\Application;
35 35
 use Symfony\Component\Console\Input\ArgvInput;
@@ -39,12 +39,12 @@  discard block
 block discarded – undo
39 39
 
40 40
 function exceptionHandler($exception) {
41 41
 
42
-	echo "An unhandled exception has been thrown:" . PHP_EOL;
42
+	echo "An unhandled exception has been thrown:".PHP_EOL;
43 43
 	echo $exception;
44 44
 	exit(1);
45 45
 }
46 46
 try {
47
-	require_once __DIR__ . '/lib/base.php';
47
+	require_once __DIR__.'/lib/base.php';
48 48
 
49 49
 	// set to run indefinitely if needed
50 50
 	if (strpos(@ini_get('disable_functions'), 'set_time_limit') === false) {
@@ -52,38 +52,38 @@  discard block
 block discarded – undo
52 52
 	}
53 53
 
54 54
 	if (!OC::$CLI) {
55
-		echo "This script can be run from the command line only" . PHP_EOL;
55
+		echo "This script can be run from the command line only".PHP_EOL;
56 56
 		exit(1);
57 57
 	}
58 58
 
59 59
 	set_exception_handler('exceptionHandler');
60 60
 
61 61
 	if (!function_exists('posix_getuid')) {
62
-		echo "The posix extensions are required - see http://php.net/manual/en/book.posix.php" . PHP_EOL;
62
+		echo "The posix extensions are required - see http://php.net/manual/en/book.posix.php".PHP_EOL;
63 63
 		exit(1);
64 64
 	}
65 65
 	$user = posix_getpwuid(posix_getuid());
66
-	$configUser = posix_getpwuid(fileowner(OC::$configDir . 'config.php'));
66
+	$configUser = posix_getpwuid(fileowner(OC::$configDir.'config.php'));
67 67
 	if ($user['name'] !== $configUser['name']) {
68
-		echo "Console has to be executed with the user that owns the file config/config.php" . PHP_EOL;
69
-		echo "Current user: " . $user['name'] . PHP_EOL;
70
-		echo "Owner of config.php: " . $configUser['name'] . PHP_EOL;
71
-		echo "Try adding 'sudo -u " . $configUser['name'] . " ' to the beginning of the command (without the single quotes)" . PHP_EOL;
68
+		echo "Console has to be executed with the user that owns the file config/config.php".PHP_EOL;
69
+		echo "Current user: ".$user['name'].PHP_EOL;
70
+		echo "Owner of config.php: ".$configUser['name'].PHP_EOL;
71
+		echo "Try adding 'sudo -u ".$configUser['name']." ' to the beginning of the command (without the single quotes)".PHP_EOL;
72 72
 		exit(1);
73 73
 	}
74 74
 
75 75
 	$oldWorkingDir = getcwd();
76 76
 	if ($oldWorkingDir === false) {
77
-		echo "This script can be run from the Nextcloud root directory only." . PHP_EOL;
78
-		echo "Can't determine current working dir - the script will continue to work but be aware of the above fact." . PHP_EOL;
77
+		echo "This script can be run from the Nextcloud root directory only.".PHP_EOL;
78
+		echo "Can't determine current working dir - the script will continue to work but be aware of the above fact.".PHP_EOL;
79 79
 	} else if ($oldWorkingDir !== __DIR__ && !chdir(__DIR__)) {
80
-		echo "This script can be run from the Nextcloud root directory only." . PHP_EOL;
81
-		echo "Can't change to Nextcloud root directory." . PHP_EOL;
80
+		echo "This script can be run from the Nextcloud root directory only.".PHP_EOL;
81
+		echo "Can't change to Nextcloud root directory.".PHP_EOL;
82 82
 		exit(1);
83 83
 	}
84 84
 
85 85
 	if (!function_exists('pcntl_signal') && !in_array('--no-warnings', $argv)) {
86
-		echo "The process control (PCNTL) extensions are required in case you want to interrupt long running commands - see http://php.net/manual/en/book.pcntl.php" . PHP_EOL;
86
+		echo "The process control (PCNTL) extensions are required in case you want to interrupt long running commands - see http://php.net/manual/en/book.pcntl.php".PHP_EOL;
87 87
 	}
88 88
 
89 89
 	$application = new Application(\OC::$server->getConfig(), \OC::$server->getEventDispatcher(), \OC::$server->getRequest(), \OC::$server->getLogger());
Please login to merge, or discard this patch.