Passed
Push — master ( a1ed1d...263a69 )
by John
16:05 queued 13s
created
apps/settings/lib/Settings/Personal/Security/Password.php 1 patch
Indentation   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -34,35 +34,35 @@
 block discarded – undo
34 34
 
35 35
 class Password implements ISettings {
36 36
 
37
-	/** @var IUserManager */
38
-	private $userManager;
37
+    /** @var IUserManager */
38
+    private $userManager;
39 39
 
40
-	/** @var string|null */
41
-	private $uid;
40
+    /** @var string|null */
41
+    private $uid;
42 42
 
43
-	public function __construct(IUserManager $userManager,
44
-								?string $UserId) {
45
-		$this->userManager = $userManager;
46
-		$this->uid = $UserId;
47
-	}
43
+    public function __construct(IUserManager $userManager,
44
+                                ?string $UserId) {
45
+        $this->userManager = $userManager;
46
+        $this->uid = $UserId;
47
+    }
48 48
 
49
-	public function getForm(): TemplateResponse {
50
-		$user = $this->userManager->get($this->uid);
51
-		$passwordChangeSupported = false;
52
-		if ($user !== null) {
53
-			$passwordChangeSupported = $user->canChangePassword();
54
-		}
49
+    public function getForm(): TemplateResponse {
50
+        $user = $this->userManager->get($this->uid);
51
+        $passwordChangeSupported = false;
52
+        if ($user !== null) {
53
+            $passwordChangeSupported = $user->canChangePassword();
54
+        }
55 55
 
56
-		return new TemplateResponse('settings', 'settings/personal/security/password', [
57
-			'passwordChangeSupported' => $passwordChangeSupported,
58
-		]);
59
-	}
56
+        return new TemplateResponse('settings', 'settings/personal/security/password', [
57
+            'passwordChangeSupported' => $passwordChangeSupported,
58
+        ]);
59
+    }
60 60
 
61
-	public function getSection(): string {
62
-		return 'security';
63
-	}
61
+    public function getSection(): string {
62
+        return 'security';
63
+    }
64 64
 
65
-	public function getPriority(): int {
66
-		return 10;
67
-	}
65
+    public function getPriority(): int {
66
+        return 10;
67
+    }
68 68
 }
Please login to merge, or discard this patch.
lib/private/BackgroundJob/Job.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -57,17 +57,17 @@
 block discarded – undo
57 57
 
58 58
 		try {
59 59
 			$jobStartTime = time();
60
-			$logger->debug('Run ' . get_class($this) . ' job with ID ' . $this->getId(), ['app' => 'cron']);
60
+			$logger->debug('Run '.get_class($this).' job with ID '.$this->getId(), ['app' => 'cron']);
61 61
 			$this->run($this->argument);
62 62
 			$timeTaken = time() - $jobStartTime;
63 63
 
64
-			$logger->debug('Finished ' . get_class($this) . ' job with ID ' . $this->getId() . ' in ' . $timeTaken . ' seconds', ['app' => 'cron']);
64
+			$logger->debug('Finished '.get_class($this).' job with ID '.$this->getId().' in '.$timeTaken.' seconds', ['app' => 'cron']);
65 65
 			$jobList->setExecutionTime($this, $timeTaken);
66 66
 		} catch (\Throwable $e) {
67 67
 			if ($logger) {
68 68
 				$logger->logException($e, [
69 69
 					'app' => 'core',
70
-					'message' => 'Error while running background job (class: ' . get_class($this) . ', arguments: ' . print_r($this->argument, true) . ')'
70
+					'message' => 'Error while running background job (class: '.get_class($this).', arguments: '.print_r($this->argument, true).')'
71 71
 				]);
72 72
 			}
73 73
 		}
Please login to merge, or discard this patch.
Indentation   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -33,66 +33,66 @@
 block discarded – undo
33 33
  * @deprecated internal class, use \OCP\BackgroundJob\Job
34 34
  */
35 35
 abstract class Job implements IJob {
36
-	/** @var int */
37
-	protected $id;
36
+    /** @var int */
37
+    protected $id;
38 38
 
39
-	/** @var int */
40
-	protected $lastRun;
39
+    /** @var int */
40
+    protected $lastRun;
41 41
 
42
-	/** @var mixed */
43
-	protected $argument;
42
+    /** @var mixed */
43
+    protected $argument;
44 44
 
45
-	public function execute(IJobList $jobList, ILogger $logger = null) {
46
-		$jobList->setLastRun($this);
47
-		if ($logger === null) {
48
-			$logger = \OC::$server->getLogger();
49
-		}
45
+    public function execute(IJobList $jobList, ILogger $logger = null) {
46
+        $jobList->setLastRun($this);
47
+        if ($logger === null) {
48
+            $logger = \OC::$server->getLogger();
49
+        }
50 50
 
51
-		try {
52
-			$jobStartTime = time();
53
-			$logger->debug('Run ' . get_class($this) . ' job with ID ' . $this->getId(), ['app' => 'cron']);
54
-			$this->run($this->argument);
55
-			$timeTaken = time() - $jobStartTime;
51
+        try {
52
+            $jobStartTime = time();
53
+            $logger->debug('Run ' . get_class($this) . ' job with ID ' . $this->getId(), ['app' => 'cron']);
54
+            $this->run($this->argument);
55
+            $timeTaken = time() - $jobStartTime;
56 56
 
57
-			$logger->debug('Finished ' . get_class($this) . ' job with ID ' . $this->getId() . ' in ' . $timeTaken . ' seconds', ['app' => 'cron']);
58
-			$jobList->setExecutionTime($this, $timeTaken);
59
-		} catch (\Throwable $e) {
60
-			if ($logger) {
61
-				$logger->logException($e, [
62
-					'app' => 'core',
63
-					'message' => 'Error while running background job (class: ' . get_class($this) . ', arguments: ' . print_r($this->argument, true) . ')'
64
-				]);
65
-			}
66
-		}
67
-	}
57
+            $logger->debug('Finished ' . get_class($this) . ' job with ID ' . $this->getId() . ' in ' . $timeTaken . ' seconds', ['app' => 'cron']);
58
+            $jobList->setExecutionTime($this, $timeTaken);
59
+        } catch (\Throwable $e) {
60
+            if ($logger) {
61
+                $logger->logException($e, [
62
+                    'app' => 'core',
63
+                    'message' => 'Error while running background job (class: ' . get_class($this) . ', arguments: ' . print_r($this->argument, true) . ')'
64
+                ]);
65
+            }
66
+        }
67
+    }
68 68
 
69
-	public function start(IJobList $jobList): void {
70
-		$this->execute($jobList);
71
-	}
69
+    public function start(IJobList $jobList): void {
70
+        $this->execute($jobList);
71
+    }
72 72
 
73
-	abstract protected function run($argument);
73
+    abstract protected function run($argument);
74 74
 
75
-	public function setId(int $id) {
76
-		$this->id = $id;
77
-	}
75
+    public function setId(int $id) {
76
+        $this->id = $id;
77
+    }
78 78
 
79
-	public function setLastRun(int $lastRun) {
80
-		$this->lastRun = $lastRun;
81
-	}
79
+    public function setLastRun(int $lastRun) {
80
+        $this->lastRun = $lastRun;
81
+    }
82 82
 
83
-	public function setArgument($argument) {
84
-		$this->argument = $argument;
85
-	}
83
+    public function setArgument($argument) {
84
+        $this->argument = $argument;
85
+    }
86 86
 
87
-	public function getId() {
88
-		return $this->id;
89
-	}
87
+    public function getId() {
88
+        return $this->id;
89
+    }
90 90
 
91
-	public function getLastRun() {
92
-		return $this->lastRun;
93
-	}
91
+    public function getLastRun() {
92
+        return $this->lastRun;
93
+    }
94 94
 
95
-	public function getArgument() {
96
-		return $this->argument;
97
-	}
95
+    public function getArgument() {
96
+        return $this->argument;
97
+    }
98 98
 }
Please login to merge, or discard this patch.
lib/private/DB/SetTransactionIsolationLevel.php 1 patch
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -32,15 +32,15 @@
 block discarded – undo
32 32
 use Doctrine\DBAL\TransactionIsolationLevel;
33 33
 
34 34
 class SetTransactionIsolationLevel implements EventSubscriber {
35
-	/**
36
-	 * @param ConnectionEventArgs $args
37
-	 * @return void
38
-	 */
39
-	public function postConnect(ConnectionEventArgs $args) {
40
-		$args->getConnection()->setTransactionIsolation(TransactionIsolationLevel::READ_COMMITTED);
41
-	}
35
+    /**
36
+     * @param ConnectionEventArgs $args
37
+     * @return void
38
+     */
39
+    public function postConnect(ConnectionEventArgs $args) {
40
+        $args->getConnection()->setTransactionIsolation(TransactionIsolationLevel::READ_COMMITTED);
41
+    }
42 42
 
43
-	public function getSubscribedEvents() {
44
-		return [Events::postConnect];
45
-	}
43
+    public function getSubscribedEvents() {
44
+        return [Events::postConnect];
45
+    }
46 46
 }
Please login to merge, or discard this patch.
apps/dav/lib/CalDAV/Integration/ICalendarProvider.php 1 patch
Indentation   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -32,42 +32,42 @@
 block discarded – undo
32 32
  */
33 33
 interface ICalendarProvider {
34 34
 
35
-	/**
36
-	 * Provides the appId of the plugin
37
-	 *
38
-	 * @since 19.0.0
39
-	 * @return string AppId
40
-	 */
41
-	public function getAppId(): string;
35
+    /**
36
+     * Provides the appId of the plugin
37
+     *
38
+     * @since 19.0.0
39
+     * @return string AppId
40
+     */
41
+    public function getAppId(): string;
42 42
 
43
-	/**
44
-	 * Fetches all calendars for a given principal uri
45
-	 *
46
-	 * @since 19.0.0
47
-	 * @param string $principalUri E.g. principals/users/user1
48
-	 * @return ExternalCalendar[] Array of all calendars
49
-	 */
50
-	public function fetchAllForCalendarHome(string $principalUri): array;
43
+    /**
44
+     * Fetches all calendars for a given principal uri
45
+     *
46
+     * @since 19.0.0
47
+     * @param string $principalUri E.g. principals/users/user1
48
+     * @return ExternalCalendar[] Array of all calendars
49
+     */
50
+    public function fetchAllForCalendarHome(string $principalUri): array;
51 51
 
52
-	/**
53
-	 * Checks whether plugin has a calendar for a given principalUri and calendarUri
54
-	 *
55
-	 * @since 19.0.0
56
-	 * @param string $principalUri E.g. principals/users/user1
57
-	 * @param string $calendarUri E.g. personal
58
-	 * @return bool True if calendar for principalUri and calendarUri exists, false otherwise
59
-	 */
60
-	public function hasCalendarInCalendarHome(string $principalUri, string $calendarUri): bool;
52
+    /**
53
+     * Checks whether plugin has a calendar for a given principalUri and calendarUri
54
+     *
55
+     * @since 19.0.0
56
+     * @param string $principalUri E.g. principals/users/user1
57
+     * @param string $calendarUri E.g. personal
58
+     * @return bool True if calendar for principalUri and calendarUri exists, false otherwise
59
+     */
60
+    public function hasCalendarInCalendarHome(string $principalUri, string $calendarUri): bool;
61 61
 
62
-	/**
63
-	 * Fetches a calendar for a given principalUri and calendarUri
64
-	 * Returns null if calendar does not exist
65
-	 *
66
-	 * @since 19.0.0
67
-	 * @param string $principalUri E.g. principals/users/user1
68
-	 * @param string $calendarUri E.g. personal
69
-	 * @return ExternalCalendar|null Calendar if it exists, null otherwise
70
-	 */
71
-	public function getCalendarInCalendarHome(string $principalUri, string $calendarUri): ?ExternalCalendar;
62
+    /**
63
+     * Fetches a calendar for a given principalUri and calendarUri
64
+     * Returns null if calendar does not exist
65
+     *
66
+     * @since 19.0.0
67
+     * @param string $principalUri E.g. principals/users/user1
68
+     * @param string $calendarUri E.g. personal
69
+     * @return ExternalCalendar|null Calendar if it exists, null otherwise
70
+     */
71
+    public function getCalendarInCalendarHome(string $principalUri, string $calendarUri): ?ExternalCalendar;
72 72
 
73 73
 }
Please login to merge, or discard this patch.
apps/files/lib/Controller/TransferOwnershipController.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 				'targetUser' => $recipient,
113 113
 				'nodeName' => $node->getName(),
114 114
 			])
115
-			->setObject('transfer', (string)$transferOwnership->getId());
115
+			->setObject('transfer', (string) $transferOwnership->getId());
116 116
 
117 117
 		$this->notificationManager->notify($notification);
118 118
 
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
 
136 136
 		$notification = $this->notificationManager->createNotification();
137 137
 		$notification->setApp('files')
138
-			->setObject('transfer', (string)$id);
138
+			->setObject('transfer', (string) $id);
139 139
 		$this->notificationManager->markProcessed($notification);
140 140
 
141 141
 		$newTransferOwnership = new TransferOwnershipEntity();
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
 
169 169
 		$notification = $this->notificationManager->createNotification();
170 170
 		$notification->setApp('files')
171
-			->setObject('transfer', (string)$id);
171
+			->setObject('transfer', (string) $id);
172 172
 		$this->notificationManager->markProcessed($notification);
173 173
 
174 174
 		$notification = $this->notificationManager->createNotification();
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
 				'targetUser' => $transferOwnership->getTargetUser(),
181 181
 				'nodeName' => $transferOwnership->getNodeName()
182 182
 			])
183
-			->setObject('transfer', (string)$transferOwnership->getId());
183
+			->setObject('transfer', (string) $transferOwnership->getId());
184 184
 		$this->notificationManager->notify($notification);
185 185
 
186 186
 		$this->mapper->delete($transferOwnership);
Please login to merge, or discard this patch.
Indentation   +149 added lines, -149 removed lines patch added patch discarded remove patch
@@ -44,153 +44,153 @@
 block discarded – undo
44 44
 
45 45
 class TransferOwnershipController extends OCSController {
46 46
 
47
-	/** @var string */
48
-	private $userId;
49
-	/** @var NotificationManager */
50
-	private $notificationManager;
51
-	/** @var ITimeFactory */
52
-	private $timeFactory;
53
-	/** @var IJobList */
54
-	private $jobList;
55
-	/** @var TransferOwnershipMapper */
56
-	private $mapper;
57
-	/** @var IUserManager */
58
-	private $userManager;
59
-	/** @var IRootFolder */
60
-	private $rootFolder;
61
-
62
-	public function __construct(string $appName,
63
-								IRequest $request,
64
-								string $userId,
65
-								NotificationManager $notificationManager,
66
-								ITimeFactory $timeFactory,
67
-								IJobList $jobList,
68
-								TransferOwnershipMapper $mapper,
69
-								IUserManager $userManager,
70
-								IRootFolder $rootFolder) {
71
-		parent::__construct($appName, $request);
72
-
73
-		$this->userId = $userId;
74
-		$this->notificationManager = $notificationManager;
75
-		$this->timeFactory = $timeFactory;
76
-		$this->jobList = $jobList;
77
-		$this->mapper = $mapper;
78
-		$this->userManager = $userManager;
79
-		$this->rootFolder = $rootFolder;
80
-	}
81
-
82
-
83
-	/**
84
-	 * @NoAdminRequired
85
-	 */
86
-	public function transfer(string $recipient, string $path): DataResponse {
87
-		$recipientUser = $this->userManager->get($recipient);
88
-
89
-		if ($recipientUser === null) {
90
-			return new DataResponse([], Http::STATUS_BAD_REQUEST);
91
-		}
92
-
93
-		$userRoot = $this->rootFolder->getUserFolder($this->userId);
94
-
95
-		try {
96
-			$node = $userRoot->get($path);
97
-		} catch (\Exception $e) {
98
-			return new DataResponse([], Http::STATUS_BAD_REQUEST);
99
-		}
100
-
101
-		if ($node->getOwner()->getUID() !== $this->userId || !$node->getStorage()->instanceOfStorage(IHomeStorage::class)) {
102
-			return new DataResponse([], Http::STATUS_FORBIDDEN);
103
-		}
104
-
105
-		$transferOwnership = new TransferOwnershipEntity();
106
-		$transferOwnership->setSourceUser($this->userId);
107
-		$transferOwnership->setTargetUser($recipient);
108
-		$transferOwnership->setFileId($node->getId());
109
-		$transferOwnership->setNodeName($node->getName());
110
-		$transferOwnership = $this->mapper->insert($transferOwnership);
111
-
112
-		$notification = $this->notificationManager->createNotification();
113
-		$notification->setUser($recipient)
114
-			->setApp($this->appName)
115
-			->setDateTime($this->timeFactory->getDateTime())
116
-			->setSubject('transferownershipRequest', [
117
-				'sourceUser' => $this->userId,
118
-				'targetUser' => $recipient,
119
-				'nodeName' => $node->getName(),
120
-			])
121
-			->setObject('transfer', (string)$transferOwnership->getId());
122
-
123
-		$this->notificationManager->notify($notification);
124
-
125
-		return new DataResponse([]);
126
-	}
127
-
128
-	/**
129
-	 * @NoAdminRequired
130
-	 */
131
-	public function accept(int $id): DataResponse {
132
-		try {
133
-			$transferOwnership = $this->mapper->getById($id);
134
-		} catch (DoesNotExistException $e) {
135
-			return new DataResponse([], Http::STATUS_NOT_FOUND);
136
-		}
137
-
138
-		if ($transferOwnership->getTargetUser() !== $this->userId) {
139
-			return new DataResponse([], Http::STATUS_FORBIDDEN);
140
-		}
141
-
142
-		$notification = $this->notificationManager->createNotification();
143
-		$notification->setApp('files')
144
-			->setObject('transfer', (string)$id);
145
-		$this->notificationManager->markProcessed($notification);
146
-
147
-		$newTransferOwnership = new TransferOwnershipEntity();
148
-		$newTransferOwnership->setNodeName($transferOwnership->getNodeName());
149
-		$newTransferOwnership->setFileId($transferOwnership->getFileId());
150
-		$newTransferOwnership->setSourceUser($transferOwnership->getSourceUser());
151
-		$newTransferOwnership->setTargetUser($transferOwnership->getTargetUser());
152
-		$this->mapper->insert($newTransferOwnership);
153
-
154
-		$this->jobList->add(TransferOwnership::class, [
155
-			'id' => $newTransferOwnership->getId(),
156
-		]);
157
-
158
-		return new DataResponse([], Http::STATUS_OK);
159
-	}
160
-
161
-	/**
162
-	 * @NoAdminRequired
163
-	 */
164
-	public function reject(int $id): DataResponse {
165
-		try {
166
-			$transferOwnership = $this->mapper->getById($id);
167
-		} catch (DoesNotExistException $e) {
168
-			return new DataResponse([], Http::STATUS_NOT_FOUND);
169
-		}
170
-
171
-		if ($transferOwnership->getTargetUser() !== $this->userId) {
172
-			return new DataResponse([], Http::STATUS_FORBIDDEN);
173
-		}
174
-
175
-		$notification = $this->notificationManager->createNotification();
176
-		$notification->setApp('files')
177
-			->setObject('transfer', (string)$id);
178
-		$this->notificationManager->markProcessed($notification);
179
-
180
-		$notification = $this->notificationManager->createNotification();
181
-		$notification->setUser($transferOwnership->getSourceUser())
182
-			->setApp($this->appName)
183
-			->setDateTime($this->timeFactory->getDateTime())
184
-			->setSubject('transferownershipRequestDenied', [
185
-				'sourceUser' => $transferOwnership->getSourceUser(),
186
-				'targetUser' => $transferOwnership->getTargetUser(),
187
-				'nodeName' => $transferOwnership->getNodeName()
188
-			])
189
-			->setObject('transfer', (string)$transferOwnership->getId());
190
-		$this->notificationManager->notify($notification);
191
-
192
-		$this->mapper->delete($transferOwnership);
193
-
194
-		return new DataResponse([], Http::STATUS_OK);
195
-	}
47
+    /** @var string */
48
+    private $userId;
49
+    /** @var NotificationManager */
50
+    private $notificationManager;
51
+    /** @var ITimeFactory */
52
+    private $timeFactory;
53
+    /** @var IJobList */
54
+    private $jobList;
55
+    /** @var TransferOwnershipMapper */
56
+    private $mapper;
57
+    /** @var IUserManager */
58
+    private $userManager;
59
+    /** @var IRootFolder */
60
+    private $rootFolder;
61
+
62
+    public function __construct(string $appName,
63
+                                IRequest $request,
64
+                                string $userId,
65
+                                NotificationManager $notificationManager,
66
+                                ITimeFactory $timeFactory,
67
+                                IJobList $jobList,
68
+                                TransferOwnershipMapper $mapper,
69
+                                IUserManager $userManager,
70
+                                IRootFolder $rootFolder) {
71
+        parent::__construct($appName, $request);
72
+
73
+        $this->userId = $userId;
74
+        $this->notificationManager = $notificationManager;
75
+        $this->timeFactory = $timeFactory;
76
+        $this->jobList = $jobList;
77
+        $this->mapper = $mapper;
78
+        $this->userManager = $userManager;
79
+        $this->rootFolder = $rootFolder;
80
+    }
81
+
82
+
83
+    /**
84
+     * @NoAdminRequired
85
+     */
86
+    public function transfer(string $recipient, string $path): DataResponse {
87
+        $recipientUser = $this->userManager->get($recipient);
88
+
89
+        if ($recipientUser === null) {
90
+            return new DataResponse([], Http::STATUS_BAD_REQUEST);
91
+        }
92
+
93
+        $userRoot = $this->rootFolder->getUserFolder($this->userId);
94
+
95
+        try {
96
+            $node = $userRoot->get($path);
97
+        } catch (\Exception $e) {
98
+            return new DataResponse([], Http::STATUS_BAD_REQUEST);
99
+        }
100
+
101
+        if ($node->getOwner()->getUID() !== $this->userId || !$node->getStorage()->instanceOfStorage(IHomeStorage::class)) {
102
+            return new DataResponse([], Http::STATUS_FORBIDDEN);
103
+        }
104
+
105
+        $transferOwnership = new TransferOwnershipEntity();
106
+        $transferOwnership->setSourceUser($this->userId);
107
+        $transferOwnership->setTargetUser($recipient);
108
+        $transferOwnership->setFileId($node->getId());
109
+        $transferOwnership->setNodeName($node->getName());
110
+        $transferOwnership = $this->mapper->insert($transferOwnership);
111
+
112
+        $notification = $this->notificationManager->createNotification();
113
+        $notification->setUser($recipient)
114
+            ->setApp($this->appName)
115
+            ->setDateTime($this->timeFactory->getDateTime())
116
+            ->setSubject('transferownershipRequest', [
117
+                'sourceUser' => $this->userId,
118
+                'targetUser' => $recipient,
119
+                'nodeName' => $node->getName(),
120
+            ])
121
+            ->setObject('transfer', (string)$transferOwnership->getId());
122
+
123
+        $this->notificationManager->notify($notification);
124
+
125
+        return new DataResponse([]);
126
+    }
127
+
128
+    /**
129
+     * @NoAdminRequired
130
+     */
131
+    public function accept(int $id): DataResponse {
132
+        try {
133
+            $transferOwnership = $this->mapper->getById($id);
134
+        } catch (DoesNotExistException $e) {
135
+            return new DataResponse([], Http::STATUS_NOT_FOUND);
136
+        }
137
+
138
+        if ($transferOwnership->getTargetUser() !== $this->userId) {
139
+            return new DataResponse([], Http::STATUS_FORBIDDEN);
140
+        }
141
+
142
+        $notification = $this->notificationManager->createNotification();
143
+        $notification->setApp('files')
144
+            ->setObject('transfer', (string)$id);
145
+        $this->notificationManager->markProcessed($notification);
146
+
147
+        $newTransferOwnership = new TransferOwnershipEntity();
148
+        $newTransferOwnership->setNodeName($transferOwnership->getNodeName());
149
+        $newTransferOwnership->setFileId($transferOwnership->getFileId());
150
+        $newTransferOwnership->setSourceUser($transferOwnership->getSourceUser());
151
+        $newTransferOwnership->setTargetUser($transferOwnership->getTargetUser());
152
+        $this->mapper->insert($newTransferOwnership);
153
+
154
+        $this->jobList->add(TransferOwnership::class, [
155
+            'id' => $newTransferOwnership->getId(),
156
+        ]);
157
+
158
+        return new DataResponse([], Http::STATUS_OK);
159
+    }
160
+
161
+    /**
162
+     * @NoAdminRequired
163
+     */
164
+    public function reject(int $id): DataResponse {
165
+        try {
166
+            $transferOwnership = $this->mapper->getById($id);
167
+        } catch (DoesNotExistException $e) {
168
+            return new DataResponse([], Http::STATUS_NOT_FOUND);
169
+        }
170
+
171
+        if ($transferOwnership->getTargetUser() !== $this->userId) {
172
+            return new DataResponse([], Http::STATUS_FORBIDDEN);
173
+        }
174
+
175
+        $notification = $this->notificationManager->createNotification();
176
+        $notification->setApp('files')
177
+            ->setObject('transfer', (string)$id);
178
+        $this->notificationManager->markProcessed($notification);
179
+
180
+        $notification = $this->notificationManager->createNotification();
181
+        $notification->setUser($transferOwnership->getSourceUser())
182
+            ->setApp($this->appName)
183
+            ->setDateTime($this->timeFactory->getDateTime())
184
+            ->setSubject('transferownershipRequestDenied', [
185
+                'sourceUser' => $transferOwnership->getSourceUser(),
186
+                'targetUser' => $transferOwnership->getTargetUser(),
187
+                'nodeName' => $transferOwnership->getNodeName()
188
+            ])
189
+            ->setObject('transfer', (string)$transferOwnership->getId());
190
+        $this->notificationManager->notify($notification);
191
+
192
+        $this->mapper->delete($transferOwnership);
193
+
194
+        return new DataResponse([], Http::STATUS_OK);
195
+    }
196 196
 }
Please login to merge, or discard this patch.
apps/files_sharing/lib/Controller/ExternalSharesController.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -135,15 +135,15 @@
 block discarded – undo
135 135
 		}
136 136
 
137 137
 		if (
138
-			$this->testUrl('https://' . $remote . '/ocs-provider/') ||
139
-			$this->testUrl('https://' . $remote . '/ocs-provider/index.php') ||
140
-			$this->testUrl('https://' . $remote . '/status.php', true)
138
+			$this->testUrl('https://'.$remote.'/ocs-provider/') ||
139
+			$this->testUrl('https://'.$remote.'/ocs-provider/index.php') ||
140
+			$this->testUrl('https://'.$remote.'/status.php', true)
141 141
 		) {
142 142
 			return new DataResponse('https');
143 143
 		} elseif (
144
-			$this->testUrl('http://' . $remote . '/ocs-provider/') ||
145
-			$this->testUrl('http://' . $remote . '/ocs-provider/index.php') ||
146
-			$this->testUrl('http://' . $remote . '/status.php', true)
144
+			$this->testUrl('http://'.$remote.'/ocs-provider/') ||
145
+			$this->testUrl('http://'.$remote.'/ocs-provider/index.php') ||
146
+			$this->testUrl('http://'.$remote.'/status.php', true)
147 147
 		) {
148 148
 			return new DataResponse('http');
149 149
 		} else {
Please login to merge, or discard this patch.
Indentation   +103 added lines, -103 removed lines patch added patch discarded remove patch
@@ -40,115 +40,115 @@
 block discarded – undo
40 40
  */
41 41
 class ExternalSharesController extends Controller {
42 42
 
43
-	/** @var \OCA\Files_Sharing\External\Manager */
44
-	private $externalManager;
45
-	/** @var IClientService */
46
-	private $clientService;
43
+    /** @var \OCA\Files_Sharing\External\Manager */
44
+    private $externalManager;
45
+    /** @var IClientService */
46
+    private $clientService;
47 47
 
48
-	/**
49
-	 * @param string $appName
50
-	 * @param IRequest $request
51
-	 * @param \OCA\Files_Sharing\External\Manager $externalManager
52
-	 * @param IClientService $clientService
53
-	 */
54
-	public function __construct($appName,
55
-								IRequest $request,
56
-								\OCA\Files_Sharing\External\Manager $externalManager,
57
-								IClientService $clientService) {
58
-		parent::__construct($appName, $request);
59
-		$this->externalManager = $externalManager;
60
-		$this->clientService = $clientService;
61
-	}
48
+    /**
49
+     * @param string $appName
50
+     * @param IRequest $request
51
+     * @param \OCA\Files_Sharing\External\Manager $externalManager
52
+     * @param IClientService $clientService
53
+     */
54
+    public function __construct($appName,
55
+                                IRequest $request,
56
+                                \OCA\Files_Sharing\External\Manager $externalManager,
57
+                                IClientService $clientService) {
58
+        parent::__construct($appName, $request);
59
+        $this->externalManager = $externalManager;
60
+        $this->clientService = $clientService;
61
+    }
62 62
 
63
-	/**
64
-	 * @NoAdminRequired
65
-	 * @NoOutgoingFederatedSharingRequired
66
-	 *
67
-	 * @return JSONResponse
68
-	 */
69
-	public function index() {
70
-		return new JSONResponse($this->externalManager->getOpenShares());
71
-	}
63
+    /**
64
+     * @NoAdminRequired
65
+     * @NoOutgoingFederatedSharingRequired
66
+     *
67
+     * @return JSONResponse
68
+     */
69
+    public function index() {
70
+        return new JSONResponse($this->externalManager->getOpenShares());
71
+    }
72 72
 
73
-	/**
74
-	 * @NoAdminRequired
75
-	 * @NoOutgoingFederatedSharingRequired
76
-	 *
77
-	 * @param int $id
78
-	 * @return JSONResponse
79
-	 */
80
-	public function create($id) {
81
-		$this->externalManager->acceptShare($id);
82
-		return new JSONResponse();
83
-	}
73
+    /**
74
+     * @NoAdminRequired
75
+     * @NoOutgoingFederatedSharingRequired
76
+     *
77
+     * @param int $id
78
+     * @return JSONResponse
79
+     */
80
+    public function create($id) {
81
+        $this->externalManager->acceptShare($id);
82
+        return new JSONResponse();
83
+    }
84 84
 
85
-	/**
86
-	 * @NoAdminRequired
87
-	 * @NoOutgoingFederatedSharingRequired
88
-	 *
89
-	 * @param integer $id
90
-	 * @return JSONResponse
91
-	 */
92
-	public function destroy($id) {
93
-		$this->externalManager->declineShare($id);
94
-		return new JSONResponse();
95
-	}
85
+    /**
86
+     * @NoAdminRequired
87
+     * @NoOutgoingFederatedSharingRequired
88
+     *
89
+     * @param integer $id
90
+     * @return JSONResponse
91
+     */
92
+    public function destroy($id) {
93
+        $this->externalManager->declineShare($id);
94
+        return new JSONResponse();
95
+    }
96 96
 
97
-	/**
98
-	 * Test whether the specified remote is accessible
99
-	 *
100
-	 * @param string $remote
101
-	 * @param bool $checkVersion
102
-	 * @return bool
103
-	 */
104
-	protected function testUrl($remote, $checkVersion = false) {
105
-		try {
106
-			$client = $this->clientService->newClient();
107
-			$response = json_decode($client->get(
108
-				$remote,
109
-				[
110
-					'timeout' => 3,
111
-					'connect_timeout' => 3,
112
-				]
113
-			)->getBody());
97
+    /**
98
+     * Test whether the specified remote is accessible
99
+     *
100
+     * @param string $remote
101
+     * @param bool $checkVersion
102
+     * @return bool
103
+     */
104
+    protected function testUrl($remote, $checkVersion = false) {
105
+        try {
106
+            $client = $this->clientService->newClient();
107
+            $response = json_decode($client->get(
108
+                $remote,
109
+                [
110
+                    'timeout' => 3,
111
+                    'connect_timeout' => 3,
112
+                ]
113
+            )->getBody());
114 114
 
115
-			if ($checkVersion) {
116
-				return !empty($response->version) && version_compare($response->version, '7.0.0', '>=');
117
-			} else {
118
-				return is_object($response);
119
-			}
120
-		} catch (\Exception $e) {
121
-			return false;
122
-		}
123
-	}
115
+            if ($checkVersion) {
116
+                return !empty($response->version) && version_compare($response->version, '7.0.0', '>=');
117
+            } else {
118
+                return is_object($response);
119
+            }
120
+        } catch (\Exception $e) {
121
+            return false;
122
+        }
123
+    }
124 124
 
125
-	/**
126
-	 * @PublicPage
127
-	 * @NoOutgoingFederatedSharingRequired
128
-	 * @NoIncomingFederatedSharingRequired
129
-	 *
130
-	 * @param string $remote
131
-	 * @return DataResponse
132
-	 */
133
-	public function testRemote($remote) {
134
-		if (strpos($remote, '#') !== false || strpos($remote, '?') !== false || strpos($remote, ';') !== false) {
135
-			return new DataResponse(false);
136
-		}
125
+    /**
126
+     * @PublicPage
127
+     * @NoOutgoingFederatedSharingRequired
128
+     * @NoIncomingFederatedSharingRequired
129
+     *
130
+     * @param string $remote
131
+     * @return DataResponse
132
+     */
133
+    public function testRemote($remote) {
134
+        if (strpos($remote, '#') !== false || strpos($remote, '?') !== false || strpos($remote, ';') !== false) {
135
+            return new DataResponse(false);
136
+        }
137 137
 
138
-		if (
139
-			$this->testUrl('https://' . $remote . '/ocs-provider/') ||
140
-			$this->testUrl('https://' . $remote . '/ocs-provider/index.php') ||
141
-			$this->testUrl('https://' . $remote . '/status.php', true)
142
-		) {
143
-			return new DataResponse('https');
144
-		} elseif (
145
-			$this->testUrl('http://' . $remote . '/ocs-provider/') ||
146
-			$this->testUrl('http://' . $remote . '/ocs-provider/index.php') ||
147
-			$this->testUrl('http://' . $remote . '/status.php', true)
148
-		) {
149
-			return new DataResponse('http');
150
-		} else {
151
-			return new DataResponse(false);
152
-		}
153
-	}
138
+        if (
139
+            $this->testUrl('https://' . $remote . '/ocs-provider/') ||
140
+            $this->testUrl('https://' . $remote . '/ocs-provider/index.php') ||
141
+            $this->testUrl('https://' . $remote . '/status.php', true)
142
+        ) {
143
+            return new DataResponse('https');
144
+        } elseif (
145
+            $this->testUrl('http://' . $remote . '/ocs-provider/') ||
146
+            $this->testUrl('http://' . $remote . '/ocs-provider/index.php') ||
147
+            $this->testUrl('http://' . $remote . '/status.php', true)
148
+        ) {
149
+            return new DataResponse('http');
150
+        } else {
151
+            return new DataResponse(false);
152
+        }
153
+    }
154 154
 }
Please login to merge, or discard this patch.
apps/contactsinteraction/lib/Migration/Version010000Date20200304152605.php 2 patches
Indentation   +54 added lines, -54 removed lines patch added patch discarded remove patch
@@ -33,61 +33,61 @@
 block discarded – undo
33 33
 
34 34
 class Version010000Date20200304152605 extends SimpleMigrationStep {
35 35
 
36
-	/**
37
-	 * @param IOutput $output
38
-	 * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
39
-	 * @param array $options
40
-	 *
41
-	 * @return ISchemaWrapper
42
-	 */
43
-	public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ISchemaWrapper {
44
-		/** @var ISchemaWrapper $schema */
45
-		$schema = $schemaClosure();
36
+    /**
37
+     * @param IOutput $output
38
+     * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
39
+     * @param array $options
40
+     *
41
+     * @return ISchemaWrapper
42
+     */
43
+    public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ISchemaWrapper {
44
+        /** @var ISchemaWrapper $schema */
45
+        $schema = $schemaClosure();
46 46
 
47
-		$table = $schema->createTable(RecentContactMapper::TABLE_NAME);
48
-		$table->addColumn('id', 'integer', [
49
-			'autoincrement' => true,
50
-			'notnull' => true,
51
-			'length' => 4,
52
-		]);
53
-		$table->addColumn('actor_uid', 'string', [
54
-			'notnull' => true,
55
-			'length' => 64,
56
-		]);
57
-		$table->addColumn('uid', 'string', [
58
-			'notnull' => false,
59
-			'length' => 64,
60
-		]);
61
-		$table->addColumn('email', 'string', [
62
-			'notnull' => false,
63
-			'length' => 255,
64
-		]);
65
-		$table->addColumn('federated_cloud_id', 'string', [
66
-			'notnull' => false,
67
-			'length' => 255,
68
-		]);
69
-		$table->addColumn('card', 'blob', [
70
-			'notnull' => true,
71
-		]);
72
-		$table->addColumn('last_contact', 'integer', [
73
-			'notnull' => true,
74
-			'length' => 4,
75
-		]);
76
-		$table->setPrimaryKey(['id']);
77
-		// To find all recent entries
78
-		$table->addIndex(['actor_uid'], RecentContactMapper::TABLE_NAME . '_actor_uid');
79
-		// To find a specific entry
80
-		$table->addIndex(['id', 'actor_uid'], RecentContactMapper::TABLE_NAME . '_id_uid');
81
-		// To find all recent entries with a given UID
82
-		$table->addIndex(['uid'], RecentContactMapper::TABLE_NAME . '_uid');
83
-		// To find all recent entries with a given email address
84
-		$table->addIndex(['email'], RecentContactMapper::TABLE_NAME . '_email');
85
-		// To find all recent entries with a give federated cloud id
86
-		$table->addIndex(['federated_cloud_id'], RecentContactMapper::TABLE_NAME . '_fed_id');
87
-		// For the cleanup
88
-		$table->addIndex(['last_contact'], RecentContactMapper::TABLE_NAME . '_last_contact');
47
+        $table = $schema->createTable(RecentContactMapper::TABLE_NAME);
48
+        $table->addColumn('id', 'integer', [
49
+            'autoincrement' => true,
50
+            'notnull' => true,
51
+            'length' => 4,
52
+        ]);
53
+        $table->addColumn('actor_uid', 'string', [
54
+            'notnull' => true,
55
+            'length' => 64,
56
+        ]);
57
+        $table->addColumn('uid', 'string', [
58
+            'notnull' => false,
59
+            'length' => 64,
60
+        ]);
61
+        $table->addColumn('email', 'string', [
62
+            'notnull' => false,
63
+            'length' => 255,
64
+        ]);
65
+        $table->addColumn('federated_cloud_id', 'string', [
66
+            'notnull' => false,
67
+            'length' => 255,
68
+        ]);
69
+        $table->addColumn('card', 'blob', [
70
+            'notnull' => true,
71
+        ]);
72
+        $table->addColumn('last_contact', 'integer', [
73
+            'notnull' => true,
74
+            'length' => 4,
75
+        ]);
76
+        $table->setPrimaryKey(['id']);
77
+        // To find all recent entries
78
+        $table->addIndex(['actor_uid'], RecentContactMapper::TABLE_NAME . '_actor_uid');
79
+        // To find a specific entry
80
+        $table->addIndex(['id', 'actor_uid'], RecentContactMapper::TABLE_NAME . '_id_uid');
81
+        // To find all recent entries with a given UID
82
+        $table->addIndex(['uid'], RecentContactMapper::TABLE_NAME . '_uid');
83
+        // To find all recent entries with a given email address
84
+        $table->addIndex(['email'], RecentContactMapper::TABLE_NAME . '_email');
85
+        // To find all recent entries with a give federated cloud id
86
+        $table->addIndex(['federated_cloud_id'], RecentContactMapper::TABLE_NAME . '_fed_id');
87
+        // For the cleanup
88
+        $table->addIndex(['last_contact'], RecentContactMapper::TABLE_NAME . '_last_contact');
89 89
 
90
-		return $schema;
91
-	}
90
+        return $schema;
91
+    }
92 92
 
93 93
 }
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -75,17 +75,17 @@
 block discarded – undo
75 75
 		]);
76 76
 		$table->setPrimaryKey(['id']);
77 77
 		// To find all recent entries
78
-		$table->addIndex(['actor_uid'], RecentContactMapper::TABLE_NAME . '_actor_uid');
78
+		$table->addIndex(['actor_uid'], RecentContactMapper::TABLE_NAME.'_actor_uid');
79 79
 		// To find a specific entry
80
-		$table->addIndex(['id', 'actor_uid'], RecentContactMapper::TABLE_NAME . '_id_uid');
80
+		$table->addIndex(['id', 'actor_uid'], RecentContactMapper::TABLE_NAME.'_id_uid');
81 81
 		// To find all recent entries with a given UID
82
-		$table->addIndex(['uid'], RecentContactMapper::TABLE_NAME . '_uid');
82
+		$table->addIndex(['uid'], RecentContactMapper::TABLE_NAME.'_uid');
83 83
 		// To find all recent entries with a given email address
84
-		$table->addIndex(['email'], RecentContactMapper::TABLE_NAME . '_email');
84
+		$table->addIndex(['email'], RecentContactMapper::TABLE_NAME.'_email');
85 85
 		// To find all recent entries with a give federated cloud id
86
-		$table->addIndex(['federated_cloud_id'], RecentContactMapper::TABLE_NAME . '_fed_id');
86
+		$table->addIndex(['federated_cloud_id'], RecentContactMapper::TABLE_NAME.'_fed_id');
87 87
 		// For the cleanup
88
-		$table->addIndex(['last_contact'], RecentContactMapper::TABLE_NAME . '_last_contact');
88
+		$table->addIndex(['last_contact'], RecentContactMapper::TABLE_NAME.'_last_contact');
89 89
 
90 90
 		return $schema;
91 91
 	}
Please login to merge, or discard this patch.
apps/contactsinteraction/lib/Db/CardSearchDao.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@
 block discarded – undo
67 67
 		}
68 68
 		$addressbooksQuery->selectDistinct('id')
69 69
 			->from('addressbooks')
70
-			->where($addressbooksQuery->expr()->eq('principaluri', $cardQuery->createNamedParameter("principals/users/" . $user->getUID())));
70
+			->where($addressbooksQuery->expr()->eq('principaluri', $cardQuery->createNamedParameter("principals/users/".$user->getUID())));
71 71
 		$propQuery->selectDistinct('cardid')
72 72
 			->from('cards_properties')
73 73
 			->where($propQuery->expr()->in('addressbookid', $propQuery->createFunction($addressbooksQuery->getSQL()), IQueryBuilder::PARAM_INT_ARRAY))
Please login to merge, or discard this patch.
Indentation   +54 added lines, -54 removed lines patch added patch discarded remove patch
@@ -32,63 +32,63 @@
 block discarded – undo
32 32
 use function stream_get_contents;
33 33
 
34 34
 class CardSearchDao {
35
-	private IDBConnection $db;
35
+    private IDBConnection $db;
36 36
 
37
-	public function __construct(IDBConnection $db) {
38
-		$this->db = $db;
39
-	}
37
+    public function __construct(IDBConnection $db) {
38
+        $this->db = $db;
39
+    }
40 40
 
41
-	public function findExisting(IUser $user,
42
-								 ?string $uid,
43
-								 ?string $email,
44
-								 ?string $cloudId): ?string {
45
-		$addressbooksQuery = $this->db->getQueryBuilder();
46
-		$cardQuery = $this->db->getQueryBuilder();
47
-		$propQuery = $this->db->getQueryBuilder();
41
+    public function findExisting(IUser $user,
42
+                                 ?string $uid,
43
+                                 ?string $email,
44
+                                 ?string $cloudId): ?string {
45
+        $addressbooksQuery = $this->db->getQueryBuilder();
46
+        $cardQuery = $this->db->getQueryBuilder();
47
+        $propQuery = $this->db->getQueryBuilder();
48 48
 
49
-		$propOr = $propQuery->expr()->orX();
50
-		if ($uid !== null) {
51
-			$propOr->add($propQuery->expr()->andX(
52
-				$propQuery->expr()->eq('name', $cardQuery->createNamedParameter('UID')),
53
-				$propQuery->expr()->eq('value', $cardQuery->createNamedParameter($uid))
54
-			));
55
-		}
56
-		if ($email !== null) {
57
-			$propOr->add($propQuery->expr()->andX(
58
-				$propQuery->expr()->eq('name', $cardQuery->createNamedParameter('EMAIL')),
59
-				$propQuery->expr()->eq('value', $cardQuery->createNamedParameter($email))
60
-			));
61
-		}
62
-		if ($cloudId !== null) {
63
-			$propOr->add($propQuery->expr()->andX(
64
-				$propQuery->expr()->eq('name', $cardQuery->createNamedParameter('CLOUD')),
65
-				$propQuery->expr()->eq('value', $cardQuery->createNamedParameter($cloudId))
66
-			));
67
-		}
68
-		$addressbooksQuery->selectDistinct('id')
69
-			->from('addressbooks')
70
-			->where($addressbooksQuery->expr()->eq('principaluri', $cardQuery->createNamedParameter("principals/users/" . $user->getUID())));
71
-		$propQuery->selectDistinct('cardid')
72
-			->from('cards_properties')
73
-			->where($propQuery->expr()->in('addressbookid', $propQuery->createFunction($addressbooksQuery->getSQL()), IQueryBuilder::PARAM_INT_ARRAY))
74
-			->andWhere($propOr)
75
-			->groupBy('cardid');
76
-		$cardQuery->select('carddata')
77
-			->from('cards')
78
-			->where($cardQuery->expr()->in('id', $cardQuery->createFunction($propQuery->getSQL()), IQueryBuilder::PARAM_INT_ARRAY))
79
-			->andWhere($cardQuery->expr()->in('addressbookid', $cardQuery->createFunction($addressbooksQuery->getSQL()), IQueryBuilder::PARAM_INT_ARRAY))
80
-			->setMaxResults(1);
81
-		$result = $cardQuery->execute();
82
-		/** @var string|resource|false $card */
83
-		$card = $result->fetchOne();
49
+        $propOr = $propQuery->expr()->orX();
50
+        if ($uid !== null) {
51
+            $propOr->add($propQuery->expr()->andX(
52
+                $propQuery->expr()->eq('name', $cardQuery->createNamedParameter('UID')),
53
+                $propQuery->expr()->eq('value', $cardQuery->createNamedParameter($uid))
54
+            ));
55
+        }
56
+        if ($email !== null) {
57
+            $propOr->add($propQuery->expr()->andX(
58
+                $propQuery->expr()->eq('name', $cardQuery->createNamedParameter('EMAIL')),
59
+                $propQuery->expr()->eq('value', $cardQuery->createNamedParameter($email))
60
+            ));
61
+        }
62
+        if ($cloudId !== null) {
63
+            $propOr->add($propQuery->expr()->andX(
64
+                $propQuery->expr()->eq('name', $cardQuery->createNamedParameter('CLOUD')),
65
+                $propQuery->expr()->eq('value', $cardQuery->createNamedParameter($cloudId))
66
+            ));
67
+        }
68
+        $addressbooksQuery->selectDistinct('id')
69
+            ->from('addressbooks')
70
+            ->where($addressbooksQuery->expr()->eq('principaluri', $cardQuery->createNamedParameter("principals/users/" . $user->getUID())));
71
+        $propQuery->selectDistinct('cardid')
72
+            ->from('cards_properties')
73
+            ->where($propQuery->expr()->in('addressbookid', $propQuery->createFunction($addressbooksQuery->getSQL()), IQueryBuilder::PARAM_INT_ARRAY))
74
+            ->andWhere($propOr)
75
+            ->groupBy('cardid');
76
+        $cardQuery->select('carddata')
77
+            ->from('cards')
78
+            ->where($cardQuery->expr()->in('id', $cardQuery->createFunction($propQuery->getSQL()), IQueryBuilder::PARAM_INT_ARRAY))
79
+            ->andWhere($cardQuery->expr()->in('addressbookid', $cardQuery->createFunction($addressbooksQuery->getSQL()), IQueryBuilder::PARAM_INT_ARRAY))
80
+            ->setMaxResults(1);
81
+        $result = $cardQuery->execute();
82
+        /** @var string|resource|false $card */
83
+        $card = $result->fetchOne();
84 84
 
85
-		if ($card === false) {
86
-			return null;
87
-		}
88
-		if (is_resource($card)) {
89
-			return stream_get_contents($card);
90
-		}
85
+        if ($card === false) {
86
+            return null;
87
+        }
88
+        if (is_resource($card)) {
89
+            return stream_get_contents($card);
90
+        }
91 91
 
92
-		return $card;
93
-	}
92
+        return $card;
93
+    }
94 94
 }
Please login to merge, or discard this patch.
apps/contactsinteraction/lib/AddressBookProvider.php 1 patch
Indentation   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -33,49 +33,49 @@
 block discarded – undo
33 33
 
34 34
 class AddressBookProvider implements IAddressBookProvider {
35 35
 
36
-	/** @var RecentContactMapper */
37
-	private $mapper;
36
+    /** @var RecentContactMapper */
37
+    private $mapper;
38 38
 
39
-	/** @var IL10N */
40
-	private $l10n;
39
+    /** @var IL10N */
40
+    private $l10n;
41 41
 
42
-	public function __construct(RecentContactMapper $mapper, IL10N $l10n) {
43
-		$this->mapper = $mapper;
44
-		$this->l10n = $l10n;
45
-	}
42
+    public function __construct(RecentContactMapper $mapper, IL10N $l10n) {
43
+        $this->mapper = $mapper;
44
+        $this->l10n = $l10n;
45
+    }
46 46
 
47
-	/**
48
-	 * @inheritDoc
49
-	 */
50
-	public function getAppId(): string {
51
-		return Application::APP_ID;
52
-	}
47
+    /**
48
+     * @inheritDoc
49
+     */
50
+    public function getAppId(): string {
51
+        return Application::APP_ID;
52
+    }
53 53
 
54
-	/**
55
-	 * @inheritDoc
56
-	 */
57
-	public function fetchAllForAddressBookHome(string $principalUri): array {
58
-		return [
59
-			new AddressBook($this->mapper, $this->l10n, $principalUri)
60
-		];
61
-	}
54
+    /**
55
+     * @inheritDoc
56
+     */
57
+    public function fetchAllForAddressBookHome(string $principalUri): array {
58
+        return [
59
+            new AddressBook($this->mapper, $this->l10n, $principalUri)
60
+        ];
61
+    }
62 62
 
63
-	/**
64
-	 * @inheritDoc
65
-	 */
66
-	public function hasAddressBookInAddressBookHome(string $principalUri, string $uri): bool {
67
-		return $uri === AddressBook::URI;
68
-	}
63
+    /**
64
+     * @inheritDoc
65
+     */
66
+    public function hasAddressBookInAddressBookHome(string $principalUri, string $uri): bool {
67
+        return $uri === AddressBook::URI;
68
+    }
69 69
 
70
-	/**
71
-	 * @inheritDoc
72
-	 */
73
-	public function getAddressBookInAddressBookHome(string $principalUri, string $uri): ?ExternalAddressBook {
74
-		if ($uri === AddressBook::URI) {
75
-			return new AddressBook($this->mapper, $this->l10n, $principalUri);
76
-		}
70
+    /**
71
+     * @inheritDoc
72
+     */
73
+    public function getAddressBookInAddressBookHome(string $principalUri, string $uri): ?ExternalAddressBook {
74
+        if ($uri === AddressBook::URI) {
75
+            return new AddressBook($this->mapper, $this->l10n, $principalUri);
76
+        }
77 77
 
78
-		return null;
79
-	}
78
+        return null;
79
+    }
80 80
 
81 81
 }
Please login to merge, or discard this patch.