Passed
Push — master ( 6b9c5b...5cfcde )
by Roeland
09:52 queued 11s
created
core/Command/Background/Ajax.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
 namespace OC\Core\Command\Background;
27 27
 
28 28
 class Ajax extends Base {
29
-	protected function getMode() {
30
-		return 'ajax';
31
-	}
29
+    protected function getMode() {
30
+        return 'ajax';
31
+    }
32 32
 }
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
@@ -37,39 +37,39 @@
 block discarded – undo
37 37
  * Subclasses will override the getMode() function to specify the mode to configure.
38 38
  */
39 39
 abstract class Base extends Command {
40
-	abstract protected function getMode();
40
+    abstract protected function getMode();
41 41
 
42
-	/**
43
-	 * @var \OCP\IConfig
44
-	 */
45
-	protected $config;
42
+    /**
43
+     * @var \OCP\IConfig
44
+     */
45
+    protected $config;
46 46
 
47
-	/**
48
-	 * @param \OCP\IConfig $config
49
-	 */
50
-	public function __construct(IConfig $config) {
51
-		$this->config = $config;
52
-		parent::__construct();
53
-	}
47
+    /**
48
+     * @param \OCP\IConfig $config
49
+     */
50
+    public function __construct(IConfig $config) {
51
+        $this->config = $config;
52
+        parent::__construct();
53
+    }
54 54
 
55
-	protected function configure() {
56
-		$mode = $this->getMode();
57
-		$this
58
-			->setName("background:$mode")
59
-			->setDescription("Use $mode to run background jobs");
60
-	}
55
+    protected function configure() {
56
+        $mode = $this->getMode();
57
+        $this
58
+            ->setName("background:$mode")
59
+            ->setDescription("Use $mode to run background jobs");
60
+    }
61 61
 
62
-	/**
63
-	 * Executing this command will set the background job mode for owncloud.
64
-	 * The mode to set is specified by the concrete sub class by implementing the
65
-	 * getMode() function.
66
-	 *
67
-	 * @param InputInterface $input
68
-	 * @param OutputInterface $output
69
-	 */
70
-	protected function execute(InputInterface $input, OutputInterface $output) {
71
-		$mode = $this->getMode();
72
-		$this->config->setAppValue('core', 'backgroundjobs_mode', $mode);
73
-		$output->writeln("Set mode for background jobs to '$mode'");
74
-	}
62
+    /**
63
+     * Executing this command will set the background job mode for owncloud.
64
+     * The mode to set is specified by the concrete sub class by implementing the
65
+     * getMode() function.
66
+     *
67
+     * @param InputInterface $input
68
+     * @param OutputInterface $output
69
+     */
70
+    protected function execute(InputInterface $input, OutputInterface $output) {
71
+        $mode = $this->getMode();
72
+        $this->config->setAppValue('core', 'backgroundjobs_mode', $mode);
73
+        $output->writeln("Set mode for background jobs to '$mode'");
74
+    }
75 75
 }
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
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
 namespace OC\Core\Command\Background;
27 27
 
28 28
 class Cron extends Base {
29
-	protected function getMode() {
30
-		return 'cron';
31
-	}
29
+    protected function getMode() {
30
+        return 'cron';
31
+    }
32 32
 }
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
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
 namespace OC\Core\Command\Background;
27 27
 
28 28
 class WebCron extends Base {
29
-	protected function getMode() {
30
-		return 'webcron';
31
-	}
29
+    protected function getMode() {
30
+        return 'webcron';
31
+    }
32 32
 }
Please login to merge, or discard this patch.
core/Command/Config/System/GetConfig.php 1 patch
Indentation   +61 added lines, -61 removed lines patch added patch discarded remove patch
@@ -29,72 +29,72 @@
 block discarded – undo
29 29
 use Symfony\Component\Console\Output\OutputInterface;
30 30
 
31 31
 class GetConfig extends Base {
32
-	/** * @var SystemConfig */
33
-	protected $systemConfig;
32
+    /** * @var SystemConfig */
33
+    protected $systemConfig;
34 34
 
35
-	/**
36
-	 * @param SystemConfig $systemConfig
37
-	 */
38
-	public function __construct(SystemConfig $systemConfig) {
39
-		parent::__construct();
40
-		$this->systemConfig = $systemConfig;
41
-	}
35
+    /**
36
+     * @param SystemConfig $systemConfig
37
+     */
38
+    public function __construct(SystemConfig $systemConfig) {
39
+        parent::__construct();
40
+        $this->systemConfig = $systemConfig;
41
+    }
42 42
 
43
-	protected function configure() {
44
-		parent::configure();
43
+    protected function configure() {
44
+        parent::configure();
45 45
 
46
-		$this
47
-			->setName('config:system:get')
48
-			->setDescription('Get a system config value')
49
-			->addArgument(
50
-				'name',
51
-				InputArgument::REQUIRED | InputArgument::IS_ARRAY,
52
-				'Name of the config to get, specify multiple for array parameter'
53
-			)
54
-			->addOption(
55
-				'default-value',
56
-				null,
57
-				InputOption::VALUE_OPTIONAL,
58
-				'If no default value is set and the config does not exist, the command will exit with 1'
59
-			)
60
-		;
61
-	}
46
+        $this
47
+            ->setName('config:system:get')
48
+            ->setDescription('Get a system config value')
49
+            ->addArgument(
50
+                'name',
51
+                InputArgument::REQUIRED | InputArgument::IS_ARRAY,
52
+                'Name of the config to get, specify multiple for array parameter'
53
+            )
54
+            ->addOption(
55
+                'default-value',
56
+                null,
57
+                InputOption::VALUE_OPTIONAL,
58
+                'If no default value is set and the config does not exist, the command will exit with 1'
59
+            )
60
+        ;
61
+    }
62 62
 
63
-	/**
64
-	 * Executes the current command.
65
-	 *
66
-	 * @param InputInterface  $input  An InputInterface instance
67
-	 * @param OutputInterface $output An OutputInterface instance
68
-	 * @return null|int null or 0 if everything went fine, or an error code
69
-	 */
70
-	protected function execute(InputInterface $input, OutputInterface $output) {
71
-		$configNames = $input->getArgument('name');
72
-		$configName = array_shift($configNames);
73
-		$defaultValue = $input->getOption('default-value');
63
+    /**
64
+     * Executes the current command.
65
+     *
66
+     * @param InputInterface  $input  An InputInterface instance
67
+     * @param OutputInterface $output An OutputInterface instance
68
+     * @return null|int null or 0 if everything went fine, or an error code
69
+     */
70
+    protected function execute(InputInterface $input, OutputInterface $output) {
71
+        $configNames = $input->getArgument('name');
72
+        $configName = array_shift($configNames);
73
+        $defaultValue = $input->getOption('default-value');
74 74
 
75
-		if (!in_array($configName, $this->systemConfig->getKeys()) && !$input->hasParameterOption('--default-value')) {
76
-			return 1;
77
-		}
75
+        if (!in_array($configName, $this->systemConfig->getKeys()) && !$input->hasParameterOption('--default-value')) {
76
+            return 1;
77
+        }
78 78
 
79
-		if (!in_array($configName, $this->systemConfig->getKeys())) {
80
-			$configValue = $defaultValue;
81
-		} else {
82
-			$configValue = $this->systemConfig->getValue($configName);
83
-			if (!empty($configNames)) {
84
-				foreach ($configNames as $configName) {
85
-					if (isset($configValue[$configName])) {
86
-						$configValue = $configValue[$configName];
87
-					} elseif (!$input->hasParameterOption('--default-value')) {
88
-						return 1;
89
-					} else {
90
-						$configValue = $defaultValue;
91
-						break;
92
-					}
93
-				}
94
-			}
95
-		}
79
+        if (!in_array($configName, $this->systemConfig->getKeys())) {
80
+            $configValue = $defaultValue;
81
+        } else {
82
+            $configValue = $this->systemConfig->getValue($configName);
83
+            if (!empty($configNames)) {
84
+                foreach ($configNames as $configName) {
85
+                    if (isset($configValue[$configName])) {
86
+                        $configValue = $configValue[$configName];
87
+                    } elseif (!$input->hasParameterOption('--default-value')) {
88
+                        return 1;
89
+                    } else {
90
+                        $configValue = $defaultValue;
91
+                        break;
92
+                    }
93
+                }
94
+            }
95
+        }
96 96
 
97
-		$this->writeMixedInOutputFormat($input, $output, $configValue);
98
-		return 0;
99
-	}
97
+        $this->writeMixedInOutputFormat($input, $output, $configValue);
98
+        return 0;
99
+    }
100 100
 }
Please login to merge, or discard this patch.
core/Command/Status.php 1 patch
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -28,23 +28,23 @@
 block discarded – undo
28 28
 use Symfony\Component\Console\Output\OutputInterface;
29 29
 
30 30
 class Status extends Base {
31
-	protected function configure() {
32
-		parent::configure();
31
+    protected function configure() {
32
+        parent::configure();
33 33
 
34
-		$this
35
-			->setName('status')
36
-			->setDescription('show some status information')
37
-		;
38
-	}
34
+        $this
35
+            ->setName('status')
36
+            ->setDescription('show some status information')
37
+        ;
38
+    }
39 39
 
40
-	protected function execute(InputInterface $input, OutputInterface $output) {
41
-		$values = [
42
-			'installed' => (bool) \OC::$server->getConfig()->getSystemValue('installed', false),
43
-			'version' => implode('.', \OCP\Util::getVersion()),
44
-			'versionstring' => \OC_Util::getVersionString(),
45
-			'edition' => '',
46
-		];
40
+    protected function execute(InputInterface $input, OutputInterface $output) {
41
+        $values = [
42
+            'installed' => (bool) \OC::$server->getConfig()->getSystemValue('installed', false),
43
+            'version' => implode('.', \OCP\Util::getVersion()),
44
+            'versionstring' => \OC_Util::getVersionString(),
45
+            'edition' => '',
46
+        ];
47 47
 
48
-		$this->writeArrayInOutputFormat($input, $output, $values);
49
-	}
48
+        $this->writeArrayInOutputFormat($input, $output, $values);
49
+    }
50 50
 }
Please login to merge, or discard this patch.
core/Command/User/LastSeen.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -63,13 +63,13 @@
 block discarded – undo
63 63
 
64 64
 		$lastLogin = $user->getLastLogin();
65 65
 		if ($lastLogin === 0) {
66
-			$output->writeln('User ' . $user->getUID() .
66
+			$output->writeln('User '.$user->getUID().
67 67
 				' has never logged in, yet.');
68 68
 		} else {
69 69
 			$date = new \DateTime();
70 70
 			$date->setTimestamp($lastLogin);
71
-			$output->writeln($user->getUID() .
72
-				'`s last login: ' . $date->format('d.m.Y H:i'));
71
+			$output->writeln($user->getUID().
72
+				'`s last login: '.$date->format('d.m.Y H:i'));
73 73
 		}
74 74
 	}
75 75
 }
Please login to merge, or discard this patch.
Indentation   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -33,44 +33,44 @@
 block discarded – undo
33 33
 use Symfony\Component\Console\Output\OutputInterface;
34 34
 
35 35
 class LastSeen extends Command {
36
-	/** @var IUserManager */
37
-	protected $userManager;
36
+    /** @var IUserManager */
37
+    protected $userManager;
38 38
 
39
-	/**
40
-	 * @param IUserManager $userManager
41
-	 */
42
-	public function __construct(IUserManager $userManager) {
43
-		$this->userManager = $userManager;
44
-		parent::__construct();
45
-	}
39
+    /**
40
+     * @param IUserManager $userManager
41
+     */
42
+    public function __construct(IUserManager $userManager) {
43
+        $this->userManager = $userManager;
44
+        parent::__construct();
45
+    }
46 46
 
47
-	protected function configure() {
48
-		$this
49
-			->setName('user:lastseen')
50
-			->setDescription('shows when the user was logged in last time')
51
-			->addArgument(
52
-				'uid',
53
-				InputArgument::REQUIRED,
54
-				'the username'
55
-			);
56
-	}
47
+    protected function configure() {
48
+        $this
49
+            ->setName('user:lastseen')
50
+            ->setDescription('shows when the user was logged in last time')
51
+            ->addArgument(
52
+                'uid',
53
+                InputArgument::REQUIRED,
54
+                'the username'
55
+            );
56
+    }
57 57
 
58
-	protected function execute(InputInterface $input, OutputInterface $output) {
59
-		$user = $this->userManager->get($input->getArgument('uid'));
60
-		if (is_null($user)) {
61
-			$output->writeln('<error>User does not exist</error>');
62
-			return;
63
-		}
58
+    protected function execute(InputInterface $input, OutputInterface $output) {
59
+        $user = $this->userManager->get($input->getArgument('uid'));
60
+        if (is_null($user)) {
61
+            $output->writeln('<error>User does not exist</error>');
62
+            return;
63
+        }
64 64
 
65
-		$lastLogin = $user->getLastLogin();
66
-		if ($lastLogin === 0) {
67
-			$output->writeln('User ' . $user->getUID() .
68
-				' has never logged in, yet.');
69
-		} else {
70
-			$date = new \DateTime();
71
-			$date->setTimestamp($lastLogin);
72
-			$output->writeln($user->getUID() .
73
-				'`s last login: ' . $date->format('d.m.Y H:i'));
74
-		}
75
-	}
65
+        $lastLogin = $user->getLastLogin();
66
+        if ($lastLogin === 0) {
67
+            $output->writeln('User ' . $user->getUID() .
68
+                ' has never logged in, yet.');
69
+        } else {
70
+            $date = new \DateTime();
71
+            $date->setTimestamp($lastLogin);
72
+            $output->writeln($user->getUID() .
73
+                '`s last login: ' . $date->format('d.m.Y H:i'));
74
+        }
75
+    }
76 76
 }
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(['User Report', '']);
55
-		$userCountArray = $this->countUsers();
56
-		if (!empty($userCountArray)) {
57
-			$total = 0;
58
-			$rows = [];
59
-			foreach ($userCountArray as $classname => $users) {
60
-				$total += $users;
61
-				$rows[] = [$classname, $users];
62
-			}
52
+    protected function execute(InputInterface $input, OutputInterface $output) {
53
+        $table = new Table($output);
54
+        $table->setHeaders(['User Report', '']);
55
+        $userCountArray = $this->countUsers();
56
+        if (!empty($userCountArray)) {
57
+            $total = 0;
58
+            $rows = [];
59
+            foreach ($userCountArray as $classname => $users) {
60
+                $total += $users;
61
+                $rows[] = [$classname, $users];
62
+            }
63 63
 
64
-			$rows[] = [' '];
65
-			$rows[] = ['total users', $total];
66
-		} else {
67
-			$rows[] = ['No backend enabled that supports user counting', ''];
68
-		}
64
+            $rows[] = [' '];
65
+            $rows[] = ['total users', $total];
66
+        } else {
67
+            $rows[] = ['No backend enabled that supports user counting', ''];
68
+        }
69 69
 
70
-		$userDirectoryCount = $this->countUserDirectories();
71
-		$rows[] = [' '];
72
-		$rows[] = ['user directories', $userDirectoryCount];
70
+        $userDirectoryCount = $this->countUserDirectories();
71
+        $rows[] = [' '];
72
+        $rows[] = ['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/Check.php 2 patches
Indentation   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -28,35 +28,35 @@
 block discarded – undo
28 28
 use Symfony\Component\Console\Output\OutputInterface;
29 29
 
30 30
 class Check extends Base {
31
-	/**
32
-	 * @var SystemConfig
33
-	 */
34
-	private $config;
31
+    /**
32
+     * @var SystemConfig
33
+     */
34
+    private $config;
35 35
 
36
-	public function __construct(SystemConfig $config) {
37
-		parent::__construct();
38
-		$this->config = $config;
39
-	}
36
+    public function __construct(SystemConfig $config) {
37
+        parent::__construct();
38
+        $this->config = $config;
39
+    }
40 40
 
41
-	protected function configure() {
42
-		parent::configure();
41
+    protected function configure() {
42
+        parent::configure();
43 43
 
44
-		$this
45
-			->setName('check')
46
-			->setDescription('check dependencies of the server environment')
47
-		;
48
-	}
44
+        $this
45
+            ->setName('check')
46
+            ->setDescription('check dependencies of the server environment')
47
+        ;
48
+    }
49 49
 
50
-	protected function execute(InputInterface $input, OutputInterface $output) {
51
-		$errors = \OC_Util::checkServer($this->config);
52
-		if (!empty($errors)) {
53
-			$errors = array_map(function ($item) {
54
-				return (string) $item['error'];
55
-			}, $errors);
50
+    protected function execute(InputInterface $input, OutputInterface $output) {
51
+        $errors = \OC_Util::checkServer($this->config);
52
+        if (!empty($errors)) {
53
+            $errors = array_map(function ($item) {
54
+                return (string) $item['error'];
55
+            }, $errors);
56 56
 
57
-			$this->writeArrayInOutputFormat($input, $output, $errors);
58
-			return 1;
59
-		}
60
-		return 0;
61
-	}
57
+            $this->writeArrayInOutputFormat($input, $output, $errors);
58
+            return 1;
59
+        }
60
+        return 0;
61
+    }
62 62
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@
 block discarded – undo
50 50
 	protected function execute(InputInterface $input, OutputInterface $output) {
51 51
 		$errors = \OC_Util::checkServer($this->config);
52 52
 		if (!empty($errors)) {
53
-			$errors = array_map(function ($item) {
53
+			$errors = array_map(function($item) {
54 54
 				return (string) $item['error'];
55 55
 			}, $errors);
56 56
 
Please login to merge, or discard this patch.