@@ -55,7 +55,7 @@ |
||
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); |
@@ -26,48 +26,48 @@ |
||
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 | } |
@@ -25,12 +25,12 @@ |
||
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 | } |
@@ -26,13 +26,13 @@ |
||
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 | } |
@@ -25,12 +25,12 @@ |
||
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 | } |
@@ -25,7 +25,7 @@ |
||
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 |
@@ -29,12 +29,12 @@ |
||
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 | } |
@@ -24,23 +24,23 @@ |
||
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 | } |
@@ -41,6 +41,6 @@ |
||
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 | } |
@@ -26,37 +26,37 @@ |
||
26 | 26 | namespace OC\Template; |
27 | 27 | |
28 | 28 | class TemplateFileLocator { |
29 | - protected $dirs; |
|
30 | - private $path; |
|
29 | + protected $dirs; |
|
30 | + private $path; |
|
31 | 31 | |
32 | - /** |
|
33 | - * @param string[] $dirs |
|
34 | - */ |
|
35 | - public function __construct( $dirs ) { |
|
36 | - $this->dirs = $dirs; |
|
37 | - } |
|
32 | + /** |
|
33 | + * @param string[] $dirs |
|
34 | + */ |
|
35 | + public function __construct( $dirs ) { |
|
36 | + $this->dirs = $dirs; |
|
37 | + } |
|
38 | 38 | |
39 | - /** |
|
40 | - * @param string $template |
|
41 | - * @return string |
|
42 | - * @throws \Exception |
|
43 | - */ |
|
44 | - public function find( $template ) { |
|
45 | - if ($template === '') { |
|
46 | - throw new \InvalidArgumentException('Empty template name'); |
|
47 | - } |
|
39 | + /** |
|
40 | + * @param string $template |
|
41 | + * @return string |
|
42 | + * @throws \Exception |
|
43 | + */ |
|
44 | + public function find( $template ) { |
|
45 | + if ($template === '') { |
|
46 | + throw new \InvalidArgumentException('Empty template name'); |
|
47 | + } |
|
48 | 48 | |
49 | - foreach($this->dirs as $dir) { |
|
50 | - $file = $dir.$template.'.php'; |
|
51 | - if (is_file($file)) { |
|
52 | - $this->path = $dir; |
|
53 | - return $file; |
|
54 | - } |
|
55 | - } |
|
56 | - throw new \Exception('template file not found: template:'.$template); |
|
57 | - } |
|
49 | + foreach($this->dirs as $dir) { |
|
50 | + $file = $dir.$template.'.php'; |
|
51 | + if (is_file($file)) { |
|
52 | + $this->path = $dir; |
|
53 | + return $file; |
|
54 | + } |
|
55 | + } |
|
56 | + throw new \Exception('template file not found: template:'.$template); |
|
57 | + } |
|
58 | 58 | |
59 | - public function getPath() { |
|
60 | - return $this->path; |
|
61 | - } |
|
59 | + public function getPath() { |
|
60 | + return $this->path; |
|
61 | + } |
|
62 | 62 | } |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | /** |
33 | 33 | * @param string[] $dirs |
34 | 34 | */ |
35 | - public function __construct( $dirs ) { |
|
35 | + public function __construct($dirs) { |
|
36 | 36 | $this->dirs = $dirs; |
37 | 37 | } |
38 | 38 | |
@@ -41,12 +41,12 @@ discard block |
||
41 | 41 | * @return string |
42 | 42 | * @throws \Exception |
43 | 43 | */ |
44 | - public function find( $template ) { |
|
44 | + public function find($template) { |
|
45 | 45 | if ($template === '') { |
46 | 46 | throw new \InvalidArgumentException('Empty template name'); |
47 | 47 | } |
48 | 48 | |
49 | - foreach($this->dirs as $dir) { |
|
49 | + foreach ($this->dirs as $dir) { |
|
50 | 50 | $file = $dir.$template.'.php'; |
51 | 51 | if (is_file($file)) { |
52 | 52 | $this->path = $dir; |
@@ -24,5 +24,5 @@ |
||
24 | 24 | namespace OC\Hooks; |
25 | 25 | |
26 | 26 | abstract class BasicEmitter implements Emitter { |
27 | - use EmitterTrait; |
|
27 | + use EmitterTrait; |
|
28 | 28 | } |
@@ -32,19 +32,19 @@ |
||
32 | 32 | * @package OC\Hooks |
33 | 33 | */ |
34 | 34 | interface Emitter { |
35 | - /** |
|
36 | - * @param string $scope |
|
37 | - * @param string $method |
|
38 | - * @param callable $callback |
|
39 | - * @return void |
|
40 | - */ |
|
41 | - public function listen($scope, $method, callable $callback); |
|
35 | + /** |
|
36 | + * @param string $scope |
|
37 | + * @param string $method |
|
38 | + * @param callable $callback |
|
39 | + * @return void |
|
40 | + */ |
|
41 | + public function listen($scope, $method, callable $callback); |
|
42 | 42 | |
43 | - /** |
|
44 | - * @param string $scope optional |
|
45 | - * @param string $method optional |
|
46 | - * @param callable $callback optional |
|
47 | - * @return void |
|
48 | - */ |
|
49 | - public function removeListener($scope = null, $method = null, callable $callback = null); |
|
43 | + /** |
|
44 | + * @param string $scope optional |
|
45 | + * @param string $method optional |
|
46 | + * @param callable $callback optional |
|
47 | + * @return void |
|
48 | + */ |
|
49 | + public function removeListener($scope = null, $method = null, callable $callback = null); |
|
50 | 50 | } |