Passed
Push — master ( b37a49...348454 )
by Joas
15:41 queued 15s
created
apps/dav/lib/Migration/RefreshWebcalJobRegistrar.php 1 patch
Indentation   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -34,52 +34,52 @@
 block discarded – undo
34 34
 
35 35
 class RefreshWebcalJobRegistrar implements IRepairStep {
36 36
 
37
-	/** @var IDBConnection */
38
-	private $connection;
37
+    /** @var IDBConnection */
38
+    private $connection;
39 39
 
40
-	/** @var IJobList */
41
-	private $jobList;
40
+    /** @var IJobList */
41
+    private $jobList;
42 42
 
43
-	/**
44
-	 * FixBirthdayCalendarComponent constructor.
45
-	 *
46
-	 * @param IDBConnection $connection
47
-	 * @param IJobList $jobList
48
-	 */
49
-	public function __construct(IDBConnection $connection, IJobList $jobList) {
50
-		$this->connection = $connection;
51
-		$this->jobList = $jobList;
52
-	}
43
+    /**
44
+     * FixBirthdayCalendarComponent constructor.
45
+     *
46
+     * @param IDBConnection $connection
47
+     * @param IJobList $jobList
48
+     */
49
+    public function __construct(IDBConnection $connection, IJobList $jobList) {
50
+        $this->connection = $connection;
51
+        $this->jobList = $jobList;
52
+    }
53 53
 
54
-	/**
55
-	 * @inheritdoc
56
-	 */
57
-	public function getName() {
58
-		return 'Registering background jobs to update cache for webcal calendars';
59
-	}
54
+    /**
55
+     * @inheritdoc
56
+     */
57
+    public function getName() {
58
+        return 'Registering background jobs to update cache for webcal calendars';
59
+    }
60 60
 
61
-	/**
62
-	 * @inheritdoc
63
-	 */
64
-	public function run(IOutput $output) {
65
-		$query = $this->connection->getQueryBuilder();
66
-		$query->select(['principaluri', 'uri'])
67
-			->from('calendarsubscriptions');
68
-		$stmt = $query->execute();
61
+    /**
62
+     * @inheritdoc
63
+     */
64
+    public function run(IOutput $output) {
65
+        $query = $this->connection->getQueryBuilder();
66
+        $query->select(['principaluri', 'uri'])
67
+            ->from('calendarsubscriptions');
68
+        $stmt = $query->execute();
69 69
 
70
-		$count = 0;
71
-		while ($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
72
-			$args = [
73
-				'principaluri' => $row['principaluri'],
74
-				'uri' => $row['uri'],
75
-			];
70
+        $count = 0;
71
+        while ($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
72
+            $args = [
73
+                'principaluri' => $row['principaluri'],
74
+                'uri' => $row['uri'],
75
+            ];
76 76
 
77
-			if (!$this->jobList->has(RefreshWebcalJob::class, $args)) {
78
-				$this->jobList->add(RefreshWebcalJob::class, $args);
79
-				$count++;
80
-			}
81
-		}
77
+            if (!$this->jobList->has(RefreshWebcalJob::class, $args)) {
78
+                $this->jobList->add(RefreshWebcalJob::class, $args);
79
+                $count++;
80
+            }
81
+        }
82 82
 
83
-		$output->info("Added $count background jobs to update webcal calendars");
84
-	}
83
+        $output->info("Added $count background jobs to update webcal calendars");
84
+    }
85 85
 }
Please login to merge, or discard this patch.
apps/workflowengine/lib/Helper/ScopeContext.php 1 patch
Indentation   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -28,51 +28,51 @@
 block discarded – undo
28 28
 use OCP\WorkflowEngine\IManager;
29 29
 
30 30
 class ScopeContext {
31
-	/** @var int */
32
-	private $scope;
33
-	/** @var string */
34
-	private $scopeId;
35
-	/** @var string */
36
-	private $hash;
31
+    /** @var int */
32
+    private $scope;
33
+    /** @var string */
34
+    private $scopeId;
35
+    /** @var string */
36
+    private $hash;
37 37
 
38
-	public function __construct(int $scope, string $scopeId = null) {
39
-		$this->scope = $this->evaluateScope($scope);
40
-		$this->scopeId = $this->evaluateScopeId($scopeId);
41
-	}
38
+    public function __construct(int $scope, string $scopeId = null) {
39
+        $this->scope = $this->evaluateScope($scope);
40
+        $this->scopeId = $this->evaluateScopeId($scopeId);
41
+    }
42 42
 
43
-	private function evaluateScope(int $scope): int {
44
-		if (in_array($scope, [IManager::SCOPE_ADMIN, IManager::SCOPE_USER], true)) {
45
-			return $scope;
46
-		}
47
-		throw new \InvalidArgumentException('Invalid scope');
48
-	}
43
+    private function evaluateScope(int $scope): int {
44
+        if (in_array($scope, [IManager::SCOPE_ADMIN, IManager::SCOPE_USER], true)) {
45
+            return $scope;
46
+        }
47
+        throw new \InvalidArgumentException('Invalid scope');
48
+    }
49 49
 
50
-	private function evaluateScopeId(string $scopeId = null): string {
51
-		if ($this->scope === IManager::SCOPE_USER
52
-			&& trim((string)$scopeId) === '') {
53
-			throw new \InvalidArgumentException('user scope requires a user id');
54
-		}
55
-		return trim((string)$scopeId);
56
-	}
50
+    private function evaluateScopeId(string $scopeId = null): string {
51
+        if ($this->scope === IManager::SCOPE_USER
52
+            && trim((string)$scopeId) === '') {
53
+            throw new \InvalidArgumentException('user scope requires a user id');
54
+        }
55
+        return trim((string)$scopeId);
56
+    }
57 57
 
58
-	/**
59
-	 * @return int
60
-	 */
61
-	public function getScope(): int {
62
-		return $this->scope;
63
-	}
58
+    /**
59
+     * @return int
60
+     */
61
+    public function getScope(): int {
62
+        return $this->scope;
63
+    }
64 64
 
65
-	/**
66
-	 * @return string
67
-	 */
68
-	public function getScopeId(): string {
69
-		return $this->scopeId;
70
-	}
65
+    /**
66
+     * @return string
67
+     */
68
+    public function getScopeId(): string {
69
+        return $this->scopeId;
70
+    }
71 71
 
72
-	public function getHash(): string {
73
-		if ($this->hash === null) {
74
-			$this->hash = \hash('sha256', $this->getScope() . '::' . $this->getScopeId());
75
-		}
76
-		return $this->hash;
77
-	}
72
+    public function getHash(): string {
73
+        if ($this->hash === null) {
74
+            $this->hash = \hash('sha256', $this->getScope() . '::' . $this->getScopeId());
75
+        }
76
+        return $this->hash;
77
+    }
78 78
 }
Please login to merge, or discard this patch.
apps/workflowengine/lib/Helper/LogContext.php 1 patch
Indentation   +56 added lines, -56 removed lines patch added patch discarded remove patch
@@ -30,67 +30,67 @@
 block discarded – undo
30 30
 use OCP\WorkflowEngine\IOperation;
31 31
 
32 32
 class LogContext {
33
-	/** @var array */
34
-	protected $details;
33
+    /** @var array */
34
+    protected $details;
35 35
 
36
-	public function setDescription(string $description): LogContext {
37
-		$this->details['message'] = $description;
38
-		return $this;
39
-	}
36
+    public function setDescription(string $description): LogContext {
37
+        $this->details['message'] = $description;
38
+        return $this;
39
+    }
40 40
 
41
-	public function setScopes(array $scopes): LogContext {
42
-		$this->details['scopes'] = [];
43
-		foreach ($scopes as $scope) {
44
-			if ($scope instanceof ScopeContext) {
45
-				switch ($scope->getScope()) {
46
-					case IManager::SCOPE_ADMIN:
47
-						$this->details['scopes'][] = ['scope' => 'admin'];
48
-						break;
49
-					case IManager::SCOPE_USER:
50
-						$this->details['scopes'][] = [
51
-							'scope' => 'user',
52
-							'uid' => $scope->getScopeId(),
53
-						];
54
-						break;
55
-					default:
56
-						continue 2;
57
-				}
58
-			}
59
-		}
60
-		return $this;
61
-	}
41
+    public function setScopes(array $scopes): LogContext {
42
+        $this->details['scopes'] = [];
43
+        foreach ($scopes as $scope) {
44
+            if ($scope instanceof ScopeContext) {
45
+                switch ($scope->getScope()) {
46
+                    case IManager::SCOPE_ADMIN:
47
+                        $this->details['scopes'][] = ['scope' => 'admin'];
48
+                        break;
49
+                    case IManager::SCOPE_USER:
50
+                        $this->details['scopes'][] = [
51
+                            'scope' => 'user',
52
+                            'uid' => $scope->getScopeId(),
53
+                        ];
54
+                        break;
55
+                    default:
56
+                        continue 2;
57
+                }
58
+            }
59
+        }
60
+        return $this;
61
+    }
62 62
 
63
-	public function setOperation(?IOperation $operation): LogContext {
64
-		if ($operation instanceof IOperation) {
65
-			$this->details['operation'] = [
66
-				'class' => get_class($operation),
67
-				'name' => $operation->getDisplayName(),
68
-			];
69
-		}
70
-		return $this;
71
-	}
63
+    public function setOperation(?IOperation $operation): LogContext {
64
+        if ($operation instanceof IOperation) {
65
+            $this->details['operation'] = [
66
+                'class' => get_class($operation),
67
+                'name' => $operation->getDisplayName(),
68
+            ];
69
+        }
70
+        return $this;
71
+    }
72 72
 
73
-	public function setEntity(?IEntity $entity): LogContext {
74
-		if ($entity instanceof IEntity) {
75
-			$this->details['entity'] = [
76
-				'class' => get_class($entity),
77
-				'name' => $entity->getName(),
78
-			];
79
-		}
80
-		return $this;
81
-	}
73
+    public function setEntity(?IEntity $entity): LogContext {
74
+        if ($entity instanceof IEntity) {
75
+            $this->details['entity'] = [
76
+                'class' => get_class($entity),
77
+                'name' => $entity->getName(),
78
+            ];
79
+        }
80
+        return $this;
81
+    }
82 82
 
83
-	public function setConfiguration(array $configuration): LogContext {
84
-		$this->details['configuration'] = $configuration;
85
-		return $this;
86
-	}
83
+    public function setConfiguration(array $configuration): LogContext {
84
+        $this->details['configuration'] = $configuration;
85
+        return $this;
86
+    }
87 87
 
88
-	public function setEventName(string $eventName): LogContext {
89
-		$this->details['eventName'] = $eventName;
90
-		return $this;
91
-	}
88
+    public function setEventName(string $eventName): LogContext {
89
+        $this->details['eventName'] = $eventName;
90
+        return $this;
91
+    }
92 92
 
93
-	public function getDetails(): array {
94
-		return $this->details;
95
-	}
93
+    public function getDetails(): array {
94
+        return $this->details;
95
+    }
96 96
 }
Please login to merge, or discard this patch.
apps/workflowengine/lib/Controller/GlobalWorkflowsController.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -30,13 +30,13 @@
 block discarded – undo
30 30
 
31 31
 class GlobalWorkflowsController extends AWorkflowController {
32 32
 
33
-	/** @var ScopeContext */
34
-	private $scopeContext;
33
+    /** @var ScopeContext */
34
+    private $scopeContext;
35 35
 
36
-	protected function getScopeContext(): ScopeContext {
37
-		if ($this->scopeContext === null) {
38
-			$this->scopeContext = new ScopeContext(IManager::SCOPE_ADMIN);
39
-		}
40
-		return $this->scopeContext;
41
-	}
36
+    protected function getScopeContext(): ScopeContext {
37
+        if ($this->scopeContext === null) {
38
+            $this->scopeContext = new ScopeContext(IManager::SCOPE_ADMIN);
39
+        }
40
+        return $this->scopeContext;
41
+    }
42 42
 }
Please login to merge, or discard this patch.
apps/files_sharing/lib/Listener/UserShareAcceptanceListener.php 1 patch
Indentation   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -38,47 +38,47 @@
 block discarded – undo
38 38
 
39 39
 class UserShareAcceptanceListener implements IEventListener {
40 40
 
41
-	/** @var IConfig */
42
-	private $config;
43
-	/** @var IManager */
44
-	private $shareManager;
45
-	/** @var IGroupManager */
46
-	private $groupManager;
41
+    /** @var IConfig */
42
+    private $config;
43
+    /** @var IManager */
44
+    private $shareManager;
45
+    /** @var IGroupManager */
46
+    private $groupManager;
47 47
 
48
-	public function __construct(IConfig $config, IManager $shareManager, IGroupManager $groupManager) {
49
-		$this->config = $config;
50
-		$this->shareManager = $shareManager;
51
-		$this->groupManager = $groupManager;
52
-	}
48
+    public function __construct(IConfig $config, IManager $shareManager, IGroupManager $groupManager) {
49
+        $this->config = $config;
50
+        $this->shareManager = $shareManager;
51
+        $this->groupManager = $groupManager;
52
+    }
53 53
 
54
-	public function handle(Event $event): void {
55
-		if (!($event instanceof ShareCreatedEvent)) {
56
-			return;
57
-		}
54
+    public function handle(Event $event): void {
55
+        if (!($event instanceof ShareCreatedEvent)) {
56
+            return;
57
+        }
58 58
 
59
-		$share = $event->getShare();
59
+        $share = $event->getShare();
60 60
 
61
-		if ($share->getShareType() === IShare::TYPE_USER) {
62
-			$this->handleAutoAccept($share, $share->getSharedWith());
63
-		} elseif ($share->getShareType() === IShare::TYPE_GROUP) {
64
-			$group = $this->groupManager->get($share->getSharedWith());
61
+        if ($share->getShareType() === IShare::TYPE_USER) {
62
+            $this->handleAutoAccept($share, $share->getSharedWith());
63
+        } elseif ($share->getShareType() === IShare::TYPE_GROUP) {
64
+            $group = $this->groupManager->get($share->getSharedWith());
65 65
 
66
-			if ($group === null) {
67
-				return;
68
-			}
66
+            if ($group === null) {
67
+                return;
68
+            }
69 69
 
70
-			$users = $group->getUsers();
71
-			foreach ($users as $user) {
72
-				$this->handleAutoAccept($share, $user->getUID());
73
-			}
74
-		}
75
-	}
70
+            $users = $group->getUsers();
71
+            foreach ($users as $user) {
72
+                $this->handleAutoAccept($share, $user->getUID());
73
+            }
74
+        }
75
+    }
76 76
 
77
-	private function handleAutoAccept(IShare $share, string $userId) {
78
-		$defaultAcceptSystemConfig = $this->config->getSystemValueBool('sharing.enable_share_accept', false) ? 'no' : 'yes';
79
-		$acceptDefault = $this->config->getUserValue($userId, Application::APP_ID, 'default_accept', $defaultAcceptSystemConfig) === 'yes';
80
-		if (!$this->config->getSystemValueBool('sharing.force_share_accept', false) && $acceptDefault) {
81
-			$this->shareManager->acceptShare($share, $userId);
82
-		}
83
-	}
77
+    private function handleAutoAccept(IShare $share, string $userId) {
78
+        $defaultAcceptSystemConfig = $this->config->getSystemValueBool('sharing.enable_share_accept', false) ? 'no' : 'yes';
79
+        $acceptDefault = $this->config->getUserValue($userId, Application::APP_ID, 'default_accept', $defaultAcceptSystemConfig) === 'yes';
80
+        if (!$this->config->getSystemValueBool('sharing.force_share_accept', false) && $acceptDefault) {
81
+            $this->shareManager->acceptShare($share, $userId);
82
+        }
83
+    }
84 84
 }
Please login to merge, or discard this patch.
apps/files_external/lib/Lib/Auth/OAuth1/OAuth1.php 1 patch
Indentation   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -32,23 +32,23 @@
 block discarded – undo
32 32
  * OAuth1 authentication
33 33
  */
34 34
 class OAuth1 extends AuthMechanism {
35
-	public function __construct(IL10N $l) {
36
-		$this
37
-			->setIdentifier('oauth1::oauth1')
38
-			->setScheme(self::SCHEME_OAUTH1)
39
-			->setText($l->t('OAuth1'))
40
-			->addParameters([
41
-				(new DefinitionParameter('configured', 'configured'))
42
-					->setType(DefinitionParameter::VALUE_HIDDEN),
43
-				new DefinitionParameter('app_key', $l->t('App key')),
44
-				(new DefinitionParameter('app_secret', $l->t('App secret')))
45
-					->setType(DefinitionParameter::VALUE_PASSWORD),
46
-				(new DefinitionParameter('token', 'token'))
47
-					->setType(DefinitionParameter::VALUE_HIDDEN),
48
-				(new DefinitionParameter('token_secret', 'token_secret'))
49
-					->setType(DefinitionParameter::VALUE_HIDDEN),
50
-			])
51
-			->addCustomJs('oauth1')
52
-		;
53
-	}
35
+    public function __construct(IL10N $l) {
36
+        $this
37
+            ->setIdentifier('oauth1::oauth1')
38
+            ->setScheme(self::SCHEME_OAUTH1)
39
+            ->setText($l->t('OAuth1'))
40
+            ->addParameters([
41
+                (new DefinitionParameter('configured', 'configured'))
42
+                    ->setType(DefinitionParameter::VALUE_HIDDEN),
43
+                new DefinitionParameter('app_key', $l->t('App key')),
44
+                (new DefinitionParameter('app_secret', $l->t('App secret')))
45
+                    ->setType(DefinitionParameter::VALUE_PASSWORD),
46
+                (new DefinitionParameter('token', 'token'))
47
+                    ->setType(DefinitionParameter::VALUE_HIDDEN),
48
+                (new DefinitionParameter('token_secret', 'token_secret'))
49
+                    ->setType(DefinitionParameter::VALUE_HIDDEN),
50
+            ])
51
+            ->addCustomJs('oauth1')
52
+        ;
53
+    }
54 54
 }
Please login to merge, or discard this patch.
apps/files_external/lib/Lib/Auth/OpenStack/OpenStackV2.php 1 patch
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -33,18 +33,18 @@
 block discarded – undo
33 33
  * OpenStack Keystone authentication
34 34
  */
35 35
 class OpenStackV2 extends AuthMechanism {
36
-	public function __construct(IL10N $l) {
37
-		$this
38
-			->setIdentifier('openstack::openstack')
39
-			->setScheme(self::SCHEME_OPENSTACK)
40
-			->setText($l->t('OpenStack v2'))
41
-			->addParameters([
42
-				new DefinitionParameter('user', $l->t('Username')),
43
-				(new DefinitionParameter('password', $l->t('Password')))
44
-					->setType(DefinitionParameter::VALUE_PASSWORD),
45
-				new DefinitionParameter('tenant', $l->t('Tenant name')),
46
-				new DefinitionParameter('url', $l->t('Identity endpoint URL')),
47
-			])
48
-		;
49
-	}
36
+    public function __construct(IL10N $l) {
37
+        $this
38
+            ->setIdentifier('openstack::openstack')
39
+            ->setScheme(self::SCHEME_OPENSTACK)
40
+            ->setText($l->t('OpenStack v2'))
41
+            ->addParameters([
42
+                new DefinitionParameter('user', $l->t('Username')),
43
+                (new DefinitionParameter('password', $l->t('Password')))
44
+                    ->setType(DefinitionParameter::VALUE_PASSWORD),
45
+                new DefinitionParameter('tenant', $l->t('Tenant name')),
46
+                new DefinitionParameter('url', $l->t('Identity endpoint URL')),
47
+            ])
48
+        ;
49
+    }
50 50
 }
Please login to merge, or discard this patch.
apps/files_external/lib/Lib/Auth/OpenStack/Rackspace.php 1 patch
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -32,16 +32,16 @@
 block discarded – undo
32 32
  * Rackspace authentication
33 33
  */
34 34
 class Rackspace extends AuthMechanism {
35
-	public function __construct(IL10N $l) {
36
-		$this
37
-			->setIdentifier('openstack::rackspace')
38
-			->setScheme(self::SCHEME_OPENSTACK)
39
-			->setText($l->t('Rackspace'))
40
-			->addParameters([
41
-				new DefinitionParameter('user', $l->t('Username')),
42
-				(new DefinitionParameter('key', $l->t('API key')))
43
-					->setType(DefinitionParameter::VALUE_PASSWORD),
44
-			])
45
-		;
46
-	}
35
+    public function __construct(IL10N $l) {
36
+        $this
37
+            ->setIdentifier('openstack::rackspace')
38
+            ->setScheme(self::SCHEME_OPENSTACK)
39
+            ->setText($l->t('Rackspace'))
40
+            ->addParameters([
41
+                new DefinitionParameter('user', $l->t('Username')),
42
+                (new DefinitionParameter('key', $l->t('API key')))
43
+                    ->setType(DefinitionParameter::VALUE_PASSWORD),
44
+            ])
45
+        ;
46
+    }
47 47
 }
Please login to merge, or discard this patch.
apps/files_external/lib/Lib/Auth/Password/Password.php 1 patch
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -32,15 +32,15 @@
 block discarded – undo
32 32
  * Basic password authentication mechanism
33 33
  */
34 34
 class Password extends AuthMechanism {
35
-	public function __construct(IL10N $l) {
36
-		$this
37
-			->setIdentifier('password::password')
38
-			->setScheme(self::SCHEME_PASSWORD)
39
-			->setText($l->t('Username and password'))
40
-			->addParameters([
41
-				new DefinitionParameter('user', $l->t('Username')),
42
-				(new DefinitionParameter('password', $l->t('Password')))
43
-					->setType(DefinitionParameter::VALUE_PASSWORD),
44
-			]);
45
-	}
35
+    public function __construct(IL10N $l) {
36
+        $this
37
+            ->setIdentifier('password::password')
38
+            ->setScheme(self::SCHEME_PASSWORD)
39
+            ->setText($l->t('Username and password'))
40
+            ->addParameters([
41
+                new DefinitionParameter('user', $l->t('Username')),
42
+                (new DefinitionParameter('password', $l->t('Password')))
43
+                    ->setType(DefinitionParameter::VALUE_PASSWORD),
44
+            ]);
45
+    }
46 46
 }
Please login to merge, or discard this patch.