Completed
Push — stable10 ( b85e94...1e5021 )
by
unknown
23:18 queued 12:32
created
lib/private/NaturalSort_DefaultCollator.php 1 patch
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -25,14 +25,14 @@
 block discarded – undo
25 25
 namespace OC;
26 26
 
27 27
 class NaturalSort_DefaultCollator {
28
-	public function compare($a, $b) {
29
-		$result = strcasecmp($a, $b);
30
-		if ($result === 0) {
31
-			if ($a === $b) {
32
-				return 0;
33
-			}
34
-			return ($a > $b) ? -1 : 1;
35
-		}
36
-		return ($result < 0) ? -1 : 1;
37
-	}
28
+    public function compare($a, $b) {
29
+        $result = strcasecmp($a, $b);
30
+        if ($result === 0) {
31
+            if ($a === $b) {
32
+                return 0;
33
+            }
34
+            return ($a > $b) ? -1 : 1;
35
+        }
36
+        return ($result < 0) ? -1 : 1;
37
+    }
38 38
 }
Please login to merge, or discard this patch.
lib/private/Migration/BackgroundRepair.php 2 patches
Indentation   +66 added lines, -66 removed lines patch added patch discarded remove patch
@@ -37,81 +37,81 @@
 block discarded – undo
37 37
  */
38 38
 class BackgroundRepair extends TimedJob {
39 39
 
40
-	/** @var IJobList */
41
-	private $jobList;
40
+    /** @var IJobList */
41
+    private $jobList;
42 42
 
43
-	/** @var ILogger */
44
-	private $logger;
43
+    /** @var ILogger */
44
+    private $logger;
45 45
 
46
-	/** @var EventDispatcher */
47
-	private $dispatcher;
46
+    /** @var EventDispatcher */
47
+    private $dispatcher;
48 48
 
49
-	public function setDispatcher(EventDispatcher $dispatcher) {
50
-		$this->dispatcher = $dispatcher;
51
-	}
52
-	/**
53
-	 * run the job, then remove it from the job list
54
-	 *
55
-	 * @param JobList $jobList
56
-	 * @param ILogger $logger
57
-	 */
58
-	public function execute($jobList, ILogger $logger = null) {
59
-		// add an interval of 15 mins
60
-		$this->setInterval(15*60);
49
+    public function setDispatcher(EventDispatcher $dispatcher) {
50
+        $this->dispatcher = $dispatcher;
51
+    }
52
+    /**
53
+     * run the job, then remove it from the job list
54
+     *
55
+     * @param JobList $jobList
56
+     * @param ILogger $logger
57
+     */
58
+    public function execute($jobList, ILogger $logger = null) {
59
+        // add an interval of 15 mins
60
+        $this->setInterval(15*60);
61 61
 
62
-		$this->jobList = $jobList;
63
-		$this->logger = $logger;
64
-		parent::execute($jobList, $logger);
65
-	}
62
+        $this->jobList = $jobList;
63
+        $this->logger = $logger;
64
+        parent::execute($jobList, $logger);
65
+    }
66 66
 
67
-	/**
68
-	 * @param array $argument
69
-	 * @throws \Exception
70
-	 * @throws \OC\NeedsUpdateException
71
-	 */
72
-	protected function run($argument) {
73
-		if (!isset($argument['app']) || !isset($argument['step'])) {
74
-			// remove the job - we can never execute it
75
-			$this->jobList->remove($this, $this->argument);
76
-			return;
77
-		}
78
-		$app = $argument['app'];
67
+    /**
68
+     * @param array $argument
69
+     * @throws \Exception
70
+     * @throws \OC\NeedsUpdateException
71
+     */
72
+    protected function run($argument) {
73
+        if (!isset($argument['app']) || !isset($argument['step'])) {
74
+            // remove the job - we can never execute it
75
+            $this->jobList->remove($this, $this->argument);
76
+            return;
77
+        }
78
+        $app = $argument['app'];
79 79
 
80
-		try {
81
-			$this->loadApp($app);
82
-		} catch (NeedsUpdateException $ex) {
83
-			// as long as the app is not yet done with it's offline migration
84
-			// we better not start with the live migration
85
-			return;
86
-		}
80
+        try {
81
+            $this->loadApp($app);
82
+        } catch (NeedsUpdateException $ex) {
83
+            // as long as the app is not yet done with it's offline migration
84
+            // we better not start with the live migration
85
+            return;
86
+        }
87 87
 
88
-		$step = $argument['step'];
89
-		$repair = new Repair([], $this->dispatcher);
90
-		try {
91
-			$repair->addStep($step);
92
-		} catch (\Exception $ex) {
93
-			$this->logger->logException($ex,[
94
-				'app' => 'migration'
95
-			]);
88
+        $step = $argument['step'];
89
+        $repair = new Repair([], $this->dispatcher);
90
+        try {
91
+            $repair->addStep($step);
92
+        } catch (\Exception $ex) {
93
+            $this->logger->logException($ex,[
94
+                'app' => 'migration'
95
+            ]);
96 96
 
97
-			// remove the job - we can never execute it
98
-			$this->jobList->remove($this, $this->argument);
99
-			return;
100
-		}
97
+            // remove the job - we can never execute it
98
+            $this->jobList->remove($this, $this->argument);
99
+            return;
100
+        }
101 101
 
102
-		// execute the repair step
103
-		$repair->run();
102
+        // execute the repair step
103
+        $repair->run();
104 104
 
105
-		// remove the job once executed successfully
106
-		$this->jobList->remove($this, $this->argument);
107
-	}
105
+        // remove the job once executed successfully
106
+        $this->jobList->remove($this, $this->argument);
107
+    }
108 108
 
109
-	/**
110
-	 * @codeCoverageIgnore
111
-	 * @param $app
112
-	 * @throws NeedsUpdateException
113
-	 */
114
-	protected function loadApp($app) {
115
-		OC_App::loadApp($app);
116
-	}
109
+    /**
110
+     * @codeCoverageIgnore
111
+     * @param $app
112
+     * @throws NeedsUpdateException
113
+     */
114
+    protected function loadApp($app) {
115
+        OC_App::loadApp($app);
116
+    }
117 117
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 	 */
58 58
 	public function execute($jobList, ILogger $logger = null) {
59 59
 		// add an interval of 15 mins
60
-		$this->setInterval(15*60);
60
+		$this->setInterval(15 * 60);
61 61
 
62 62
 		$this->jobList = $jobList;
63 63
 		$this->logger = $logger;
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 		try {
91 91
 			$repair->addStep($step);
92 92
 		} catch (\Exception $ex) {
93
-			$this->logger->logException($ex,[
93
+			$this->logger->logException($ex, [
94 94
 				'app' => 'migration'
95 95
 			]);
96 96
 
Please login to merge, or discard this patch.
lib/private/Command/AsyncBus.php 1 patch
Indentation   +99 added lines, -99 removed lines patch added patch discarded remove patch
@@ -30,112 +30,112 @@
 block discarded – undo
30 30
  * Asynchronous command bus that uses the background job system as backend
31 31
  */
32 32
 class AsyncBus implements IBus {
33
-	/**
34
-	 * @var \OCP\BackgroundJob\IJobList
35
-	 */
36
-	private $jobList;
33
+    /**
34
+     * @var \OCP\BackgroundJob\IJobList
35
+     */
36
+    private $jobList;
37 37
 
38
-	/**
39
-	 * List of traits for command which require sync execution
40
-	 *
41
-	 * @var string[]
42
-	 */
43
-	private $syncTraits = [];
38
+    /**
39
+     * List of traits for command which require sync execution
40
+     *
41
+     * @var string[]
42
+     */
43
+    private $syncTraits = [];
44 44
 
45
-	/**
46
-	 * @param \OCP\BackgroundJob\IJobList $jobList
47
-	 */
48
-	function __construct($jobList) {
49
-		$this->jobList = $jobList;
50
-	}
45
+    /**
46
+     * @param \OCP\BackgroundJob\IJobList $jobList
47
+     */
48
+    function __construct($jobList) {
49
+        $this->jobList = $jobList;
50
+    }
51 51
 
52
-	/**
53
-	 * Schedule a command to be fired
54
-	 *
55
-	 * @param \OCP\Command\ICommand | callable $command
56
-	 */
57
-	public function push($command) {
58
-		if ($this->canRunAsync($command)) {
59
-			$this->jobList->add($this->getJobClass($command), $this->serializeCommand($command));
60
-		} else {
61
-			$this->runCommand($command);
62
-		}
63
-	}
52
+    /**
53
+     * Schedule a command to be fired
54
+     *
55
+     * @param \OCP\Command\ICommand | callable $command
56
+     */
57
+    public function push($command) {
58
+        if ($this->canRunAsync($command)) {
59
+            $this->jobList->add($this->getJobClass($command), $this->serializeCommand($command));
60
+        } else {
61
+            $this->runCommand($command);
62
+        }
63
+    }
64 64
 
65
-	/**
66
-	 * Require all commands using a trait to be run synchronous
67
-	 *
68
-	 * @param string $trait
69
-	 */
70
-	public function requireSync($trait) {
71
-		$this->syncTraits[] = trim($trait, '\\');
72
-	}
65
+    /**
66
+     * Require all commands using a trait to be run synchronous
67
+     *
68
+     * @param string $trait
69
+     */
70
+    public function requireSync($trait) {
71
+        $this->syncTraits[] = trim($trait, '\\');
72
+    }
73 73
 
74
-	/**
75
-	 * @param \OCP\Command\ICommand | callable $command
76
-	 */
77
-	private function runCommand($command) {
78
-		if ($command instanceof ICommand) {
79
-			$command->handle();
80
-		} else {
81
-			$command();
82
-		}
83
-	}
74
+    /**
75
+     * @param \OCP\Command\ICommand | callable $command
76
+     */
77
+    private function runCommand($command) {
78
+        if ($command instanceof ICommand) {
79
+            $command->handle();
80
+        } else {
81
+            $command();
82
+        }
83
+    }
84 84
 
85
-	/**
86
-	 * @param \OCP\Command\ICommand | callable $command
87
-	 * @return string
88
-	 */
89
-	private function getJobClass($command) {
90
-		if ($command instanceof \Closure) {
91
-			return 'OC\Command\ClosureJob';
92
-		} else if (is_callable($command)) {
93
-			return 'OC\Command\CallableJob';
94
-		} else if ($command instanceof ICommand) {
95
-			return 'OC\Command\CommandJob';
96
-		} else {
97
-			throw new \InvalidArgumentException('Invalid command');
98
-		}
99
-	}
85
+    /**
86
+     * @param \OCP\Command\ICommand | callable $command
87
+     * @return string
88
+     */
89
+    private function getJobClass($command) {
90
+        if ($command instanceof \Closure) {
91
+            return 'OC\Command\ClosureJob';
92
+        } else if (is_callable($command)) {
93
+            return 'OC\Command\CallableJob';
94
+        } else if ($command instanceof ICommand) {
95
+            return 'OC\Command\CommandJob';
96
+        } else {
97
+            throw new \InvalidArgumentException('Invalid command');
98
+        }
99
+    }
100 100
 
101
-	/**
102
-	 * @param \OCP\Command\ICommand | callable $command
103
-	 * @return string
104
-	 */
105
-	private function serializeCommand($command) {
106
-		if ($command instanceof \Closure) {
107
-			$serializer = new Serializer();
108
-			return $serializer->serialize($command);
109
-		} else if (is_callable($command) or $command instanceof ICommand) {
110
-			return serialize($command);
111
-		} else {
112
-			throw new \InvalidArgumentException('Invalid command');
113
-		}
114
-	}
101
+    /**
102
+     * @param \OCP\Command\ICommand | callable $command
103
+     * @return string
104
+     */
105
+    private function serializeCommand($command) {
106
+        if ($command instanceof \Closure) {
107
+            $serializer = new Serializer();
108
+            return $serializer->serialize($command);
109
+        } else if (is_callable($command) or $command instanceof ICommand) {
110
+            return serialize($command);
111
+        } else {
112
+            throw new \InvalidArgumentException('Invalid command');
113
+        }
114
+    }
115 115
 
116
-	/**
117
-	 * @param \OCP\Command\ICommand | callable $command
118
-	 * @return bool
119
-	 */
120
-	private function canRunAsync($command) {
121
-		$traits = $this->getTraits($command);
122
-		foreach ($traits as $trait) {
123
-			if (array_search($trait, $this->syncTraits) !== false) {
124
-				return false;
125
-			}
126
-		}
127
-		return true;
128
-	}
116
+    /**
117
+     * @param \OCP\Command\ICommand | callable $command
118
+     * @return bool
119
+     */
120
+    private function canRunAsync($command) {
121
+        $traits = $this->getTraits($command);
122
+        foreach ($traits as $trait) {
123
+            if (array_search($trait, $this->syncTraits) !== false) {
124
+                return false;
125
+            }
126
+        }
127
+        return true;
128
+    }
129 129
 
130
-	/**
131
-	 * @param \OCP\Command\ICommand | callable $command
132
-	 * @return string[]
133
-	 */
134
-	private function getTraits($command) {
135
-		if ($command instanceof ICommand) {
136
-			return class_uses($command);
137
-		} else {
138
-			return [];
139
-		}
140
-	}
130
+    /**
131
+     * @param \OCP\Command\ICommand | callable $command
132
+     * @return string[]
133
+     */
134
+    private function getTraits($command) {
135
+        if ($command instanceof ICommand) {
136
+            return class_uses($command);
137
+        } else {
138
+            return [];
139
+        }
140
+    }
141 141
 }
Please login to merge, or discard this patch.
lib/private/Command/QueueBus.php 2 patches
Indentation   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -26,48 +26,48 @@
 block discarded – undo
26 26
 use OCP\Command\ICommand;
27 27
 
28 28
 class QueueBus implements IBus {
29
-	/**
30
-	 * @var (ICommand|callable)[]
31
-	 */
32
-	private $queue = [];
29
+    /**
30
+     * @var (ICommand|callable)[]
31
+     */
32
+    private $queue = [];
33 33
 
34
-	/**
35
-	 * Schedule a command to be fired
36
-	 *
37
-	 * @param \OCP\Command\ICommand | callable $command
38
-	 */
39
-	public function push($command) {
40
-		$this->queue[] = $command;
41
-	}
34
+    /**
35
+     * Schedule a command to be fired
36
+     *
37
+     * @param \OCP\Command\ICommand | callable $command
38
+     */
39
+    public function push($command) {
40
+        $this->queue[] = $command;
41
+    }
42 42
 
43
-	/**
44
-	 * Require all commands using a trait to be run synchronous
45
-	 *
46
-	 * @param string $trait
47
-	 */
48
-	public function requireSync($trait) {
49
-	}
43
+    /**
44
+     * Require all commands using a trait to be run synchronous
45
+     *
46
+     * @param string $trait
47
+     */
48
+    public function requireSync($trait) {
49
+    }
50 50
 
51
-	/**
52
-	 * @param \OCP\Command\ICommand | callable $command
53
-	 */
54
-	private function runCommand($command) {
55
-		if ($command instanceof ICommand) {
56
-			// ensure the command can be serialized
57
-			$serialized = serialize($command);
58
-			if(strlen($serialized) > 4000) {
59
-				throw new \InvalidArgumentException('Trying to push a command which serialized form can not be stored in the database (>4000 character)');
60
-			}
61
-			$unserialized = unserialize($serialized);
62
-			$unserialized->handle();
63
-		} else {
64
-			$command();
65
-		}
66
-	}
51
+    /**
52
+     * @param \OCP\Command\ICommand | callable $command
53
+     */
54
+    private function runCommand($command) {
55
+        if ($command instanceof ICommand) {
56
+            // ensure the command can be serialized
57
+            $serialized = serialize($command);
58
+            if(strlen($serialized) > 4000) {
59
+                throw new \InvalidArgumentException('Trying to push a command which serialized form can not be stored in the database (>4000 character)');
60
+            }
61
+            $unserialized = unserialize($serialized);
62
+            $unserialized->handle();
63
+        } else {
64
+            $command();
65
+        }
66
+    }
67 67
 
68
-	public function run() {
69
-		while ($command = array_shift($this->queue)) {
70
-			$this->runCommand($command);
71
-		}
72
-	}
68
+    public function run() {
69
+        while ($command = array_shift($this->queue)) {
70
+            $this->runCommand($command);
71
+        }
72
+    }
73 73
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@
 block discarded – undo
55 55
 		if ($command instanceof ICommand) {
56 56
 			// ensure the command can be serialized
57 57
 			$serialized = serialize($command);
58
-			if(strlen($serialized) > 4000) {
58
+			if (strlen($serialized) > 4000) {
59 59
 				throw new \InvalidArgumentException('Trying to push a command which serialized form can not be stored in the database (>4000 character)');
60 60
 			}
61 61
 			$unserialized = unserialize($serialized);
Please login to merge, or discard this patch.
lib/private/Command/CallableJob.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -25,12 +25,12 @@
 block discarded – undo
25 25
 use OC\BackgroundJob\QueuedJob;
26 26
 
27 27
 class CallableJob extends QueuedJob {
28
-	protected function run($serializedCallable) {
29
-		$callable = unserialize($serializedCallable);
30
-		if (is_callable($callable)) {
31
-			$callable();
32
-		} else {
33
-			throw new \InvalidArgumentException('Invalid serialized callable');
34
-		}
35
-	}
28
+    protected function run($serializedCallable) {
29
+        $callable = unserialize($serializedCallable);
30
+        if (is_callable($callable)) {
31
+            $callable();
32
+        } else {
33
+            throw new \InvalidArgumentException('Invalid serialized callable');
34
+        }
35
+    }
36 36
 }
Please login to merge, or discard this patch.
lib/private/Command/ClosureJob.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -26,13 +26,13 @@
 block discarded – undo
26 26
 use SuperClosure\Serializer;
27 27
 
28 28
 class ClosureJob extends QueuedJob {
29
-	protected function run($serializedCallable) {
30
-		$serializer = new Serializer();
31
-		$callable = $serializer->unserialize($serializedCallable);
32
-		if (is_callable($callable)) {
33
-			$callable();
34
-		} else {
35
-			throw new \InvalidArgumentException('Invalid serialized callable');
36
-		}
37
-	}
29
+    protected function run($serializedCallable) {
30
+        $serializer = new Serializer();
31
+        $callable = $serializer->unserialize($serializedCallable);
32
+        if (is_callable($callable)) {
33
+            $callable();
34
+        } else {
35
+            throw new \InvalidArgumentException('Invalid serialized callable');
36
+        }
37
+    }
38 38
 }
Please login to merge, or discard this patch.
lib/private/Command/FileAccess.php 2 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -25,12 +25,12 @@
 block discarded – undo
25 25
 use OCP\IUser;
26 26
 
27 27
 trait FileAccess {
28
-	protected function setupFS(IUser $user){
29
-		\OC_Util::setupFS($user->getUID());
30
-	}
28
+    protected function setupFS(IUser $user){
29
+        \OC_Util::setupFS($user->getUID());
30
+    }
31 31
 
32
-	protected function getUserFolder(IUser $user) {
33
-		$this->setupFS($user);
34
-		return \OC::$server->getUserFolder($user->getUID());
35
-	}
32
+    protected function getUserFolder(IUser $user) {
33
+        $this->setupFS($user);
34
+        return \OC::$server->getUserFolder($user->getUID());
35
+    }
36 36
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
 use OCP\IUser;
26 26
 
27 27
 trait FileAccess {
28
-	protected function setupFS(IUser $user){
28
+	protected function setupFS(IUser $user) {
29 29
 		\OC_Util::setupFS($user->getUID());
30 30
 	}
31 31
 
Please login to merge, or discard this patch.
lib/private/Command/CommandJob.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -29,12 +29,12 @@
 block discarded – undo
29 29
  * Wrap a command in the background job interface
30 30
  */
31 31
 class CommandJob extends QueuedJob {
32
-	protected function run($serializedCommand) {
33
-		$command = unserialize($serializedCommand);
34
-		if ($command instanceof ICommand) {
35
-			$command->handle();
36
-		} else {
37
-			throw new \InvalidArgumentException('Invalid serialized command');
38
-		}
39
-	}
32
+    protected function run($serializedCommand) {
33
+        $command = unserialize($serializedCommand);
34
+        if ($command instanceof ICommand) {
35
+            $command->handle();
36
+        } else {
37
+            throw new \InvalidArgumentException('Invalid serialized command');
38
+        }
39
+    }
40 40
 }
Please login to merge, or discard this patch.
lib/private/Template/ResourceNotFoundException.php 2 patches
Indentation   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -24,23 +24,23 @@
 block discarded – undo
24 24
 namespace OC\Template;
25 25
 
26 26
 class ResourceNotFoundException extends \LogicException {
27
-	protected $resource;
28
-	protected $webPath;
27
+    protected $resource;
28
+    protected $webPath;
29 29
 
30
-	/**
31
-	 * @param string $resource
32
-	 * @param string $webPath
33
-	 */
34
-	public function __construct($resource, $webPath) {
35
-		parent::__construct('Resource not found');
36
-		$this->resource = $resource;
37
-		$this->webPath = $webPath;
38
-	}
30
+    /**
31
+     * @param string $resource
32
+     * @param string $webPath
33
+     */
34
+    public function __construct($resource, $webPath) {
35
+        parent::__construct('Resource not found');
36
+        $this->resource = $resource;
37
+        $this->webPath = $webPath;
38
+    }
39 39
 
40
-	/**
41
-	 * @return string
42
-	 */
43
-	public function getResourcePath() {
44
-		return $this->webPath . '/' . $this->resource;
45
-	}
40
+    /**
41
+     * @return string
42
+     */
43
+    public function getResourcePath() {
44
+        return $this->webPath . '/' . $this->resource;
45
+    }
46 46
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,6 +41,6 @@
 block discarded – undo
41 41
 	 * @return string
42 42
 	 */
43 43
 	public function getResourcePath() {
44
-		return $this->webPath . '/' . $this->resource;
44
+		return $this->webPath.'/'.$this->resource;
45 45
 	}
46 46
 }
Please login to merge, or discard this patch.