Passed
Push — master ( a1ed1d...263a69 )
by John
16:05 queued 13s
created
apps/files/lib/BackgroundJob/TransferOwnership.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 		$destinationUserObject = $this->userManager->get($destinationUser);
99 99
 
100 100
 		if (!$sourceUserObject instanceof IUser) {
101
-			$this->logger->alert('Could not transfer ownership: Unknown source user ' . $sourceUser);
101
+			$this->logger->alert('Could not transfer ownership: Unknown source user '.$sourceUser);
102 102
 			$this->failedNotication($transfer);
103 103
 			return;
104 104
 		}
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
 				'targetUser' => $transfer->getTargetUser(),
137 137
 				'nodeName' => $transfer->getNodeName(),
138 138
 			])
139
-			->setObject('transfer', (string)$transfer->getId());
139
+			->setObject('transfer', (string) $transfer->getId());
140 140
 		$this->notificationManager->notify($notification);
141 141
 
142 142
 		// Send notification to source user
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 				'targetUser' => $transfer->getTargetUser(),
150 150
 				'nodeName' => $transfer->getNodeName(),
151 151
 			])
152
-			->setObject('transfer', (string)$transfer->getId());
152
+			->setObject('transfer', (string) $transfer->getId());
153 153
 		$this->notificationManager->notify($notification);
154 154
 	}
155 155
 
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
 				'targetUser' => $transfer->getTargetUser(),
165 165
 				'nodeName' => $transfer->getNodeName(),
166 166
 			])
167
-			->setObject('transfer', (string)$transfer->getId());
167
+			->setObject('transfer', (string) $transfer->getId());
168 168
 		$this->notificationManager->notify($notification);
169 169
 
170 170
 		// Send notification to source user
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
 				'targetUser' => $transfer->getTargetUser(),
178 178
 				'nodeName' => $transfer->getNodeName(),
179 179
 			])
180
-			->setObject('transfer', (string)$transfer->getId());
180
+			->setObject('transfer', (string) $transfer->getId());
181 181
 		$this->notificationManager->notify($notification);
182 182
 	}
183 183
 }
Please login to merge, or discard this patch.
Indentation   +137 added lines, -137 removed lines patch added patch discarded remove patch
@@ -42,141 +42,141 @@
 block discarded – undo
42 42
 
43 43
 class TransferOwnership extends QueuedJob {
44 44
 
45
-	/** @var IUserManager $userManager */
46
-	private $userManager;
47
-
48
-	/** @var OwnershipTransferService */
49
-	private $transferService;
50
-
51
-	/** @var ILogger */
52
-	private $logger;
53
-
54
-	/** @var NotificationManager */
55
-	private $notificationManager;
56
-
57
-	/** @var TransferOwnershipMapper */
58
-	private $mapper;
59
-	/** @var IRootFolder */
60
-	private $rootFolder;
61
-
62
-	public function __construct(ITimeFactory $timeFactory,
63
-								IUserManager $userManager,
64
-								OwnershipTransferService $transferService,
65
-								ILogger $logger,
66
-								NotificationManager $notificationManager,
67
-								TransferOwnershipMapper $mapper,
68
-								IRootFolder $rootFolder) {
69
-		parent::__construct($timeFactory);
70
-
71
-		$this->userManager = $userManager;
72
-		$this->transferService = $transferService;
73
-		$this->logger = $logger;
74
-		$this->notificationManager = $notificationManager;
75
-		$this->mapper = $mapper;
76
-		$this->rootFolder = $rootFolder;
77
-	}
78
-
79
-	protected function run($argument) {
80
-		$id = $argument['id'];
81
-
82
-		$transfer = $this->mapper->getById($id);
83
-		$sourceUser = $transfer->getSourceUser();
84
-		$destinationUser = $transfer->getTargetUser();
85
-		$fileId = $transfer->getFileId();
86
-
87
-		$userFolder = $this->rootFolder->getUserFolder($sourceUser);
88
-		$nodes = $userFolder->getById($fileId);
89
-
90
-		if (empty($nodes)) {
91
-			$this->logger->alert('Could not transfer ownership: Node not found');
92
-			$this->failedNotication($transfer);
93
-			return;
94
-		}
95
-		$path = $userFolder->getRelativePath($nodes[0]->getPath());
96
-
97
-		$sourceUserObject = $this->userManager->get($sourceUser);
98
-		$destinationUserObject = $this->userManager->get($destinationUser);
99
-
100
-		if (!$sourceUserObject instanceof IUser) {
101
-			$this->logger->alert('Could not transfer ownership: Unknown source user ' . $sourceUser);
102
-			$this->failedNotication($transfer);
103
-			return;
104
-		}
105
-
106
-		if (!$destinationUserObject instanceof IUser) {
107
-			$this->logger->alert("Unknown destination user $destinationUser");
108
-			$this->failedNotication($transfer);
109
-			return;
110
-		}
111
-
112
-		try {
113
-			$this->transferService->transfer(
114
-				$sourceUserObject,
115
-				$destinationUserObject,
116
-				ltrim($path, '/')
117
-			);
118
-			$this->successNotification($transfer);
119
-		} catch (TransferOwnershipException $e) {
120
-			$this->logger->logException($e);
121
-			$this->failedNotication($transfer);
122
-		}
123
-
124
-		$this->mapper->delete($transfer);
125
-	}
126
-
127
-	private function failedNotication(Transfer $transfer): void {
128
-		// Send notification to source user
129
-		$notification = $this->notificationManager->createNotification();
130
-		$notification->setUser($transfer->getSourceUser())
131
-			->setApp(Application::APP_ID)
132
-			->setDateTime($this->time->getDateTime())
133
-			->setSubject('transferOwnershipFailedSource', [
134
-				'sourceUser' => $transfer->getSourceUser(),
135
-				'targetUser' => $transfer->getTargetUser(),
136
-				'nodeName' => $transfer->getNodeName(),
137
-			])
138
-			->setObject('transfer', (string)$transfer->getId());
139
-		$this->notificationManager->notify($notification);
140
-
141
-		// Send notification to source user
142
-		$notification = $this->notificationManager->createNotification();
143
-		$notification->setUser($transfer->getTargetUser())
144
-			->setApp(Application::APP_ID)
145
-			->setDateTime($this->time->getDateTime())
146
-			->setSubject('transferOwnershipFailedTarget', [
147
-				'sourceUser' => $transfer->getSourceUser(),
148
-				'targetUser' => $transfer->getTargetUser(),
149
-				'nodeName' => $transfer->getNodeName(),
150
-			])
151
-			->setObject('transfer', (string)$transfer->getId());
152
-		$this->notificationManager->notify($notification);
153
-	}
154
-
155
-	private function successNotification(Transfer $transfer): void {
156
-		// Send notification to source user
157
-		$notification = $this->notificationManager->createNotification();
158
-		$notification->setUser($transfer->getSourceUser())
159
-			->setApp(Application::APP_ID)
160
-			->setDateTime($this->time->getDateTime())
161
-			->setSubject('transferOwnershipDoneSource', [
162
-				'sourceUser' => $transfer->getSourceUser(),
163
-				'targetUser' => $transfer->getTargetUser(),
164
-				'nodeName' => $transfer->getNodeName(),
165
-			])
166
-			->setObject('transfer', (string)$transfer->getId());
167
-		$this->notificationManager->notify($notification);
168
-
169
-		// Send notification to source user
170
-		$notification = $this->notificationManager->createNotification();
171
-		$notification->setUser($transfer->getTargetUser())
172
-			->setApp(Application::APP_ID)
173
-			->setDateTime($this->time->getDateTime())
174
-			->setSubject('transferOwnershipDoneTarget', [
175
-				'sourceUser' => $transfer->getSourceUser(),
176
-				'targetUser' => $transfer->getTargetUser(),
177
-				'nodeName' => $transfer->getNodeName(),
178
-			])
179
-			->setObject('transfer', (string)$transfer->getId());
180
-		$this->notificationManager->notify($notification);
181
-	}
45
+    /** @var IUserManager $userManager */
46
+    private $userManager;
47
+
48
+    /** @var OwnershipTransferService */
49
+    private $transferService;
50
+
51
+    /** @var ILogger */
52
+    private $logger;
53
+
54
+    /** @var NotificationManager */
55
+    private $notificationManager;
56
+
57
+    /** @var TransferOwnershipMapper */
58
+    private $mapper;
59
+    /** @var IRootFolder */
60
+    private $rootFolder;
61
+
62
+    public function __construct(ITimeFactory $timeFactory,
63
+                                IUserManager $userManager,
64
+                                OwnershipTransferService $transferService,
65
+                                ILogger $logger,
66
+                                NotificationManager $notificationManager,
67
+                                TransferOwnershipMapper $mapper,
68
+                                IRootFolder $rootFolder) {
69
+        parent::__construct($timeFactory);
70
+
71
+        $this->userManager = $userManager;
72
+        $this->transferService = $transferService;
73
+        $this->logger = $logger;
74
+        $this->notificationManager = $notificationManager;
75
+        $this->mapper = $mapper;
76
+        $this->rootFolder = $rootFolder;
77
+    }
78
+
79
+    protected function run($argument) {
80
+        $id = $argument['id'];
81
+
82
+        $transfer = $this->mapper->getById($id);
83
+        $sourceUser = $transfer->getSourceUser();
84
+        $destinationUser = $transfer->getTargetUser();
85
+        $fileId = $transfer->getFileId();
86
+
87
+        $userFolder = $this->rootFolder->getUserFolder($sourceUser);
88
+        $nodes = $userFolder->getById($fileId);
89
+
90
+        if (empty($nodes)) {
91
+            $this->logger->alert('Could not transfer ownership: Node not found');
92
+            $this->failedNotication($transfer);
93
+            return;
94
+        }
95
+        $path = $userFolder->getRelativePath($nodes[0]->getPath());
96
+
97
+        $sourceUserObject = $this->userManager->get($sourceUser);
98
+        $destinationUserObject = $this->userManager->get($destinationUser);
99
+
100
+        if (!$sourceUserObject instanceof IUser) {
101
+            $this->logger->alert('Could not transfer ownership: Unknown source user ' . $sourceUser);
102
+            $this->failedNotication($transfer);
103
+            return;
104
+        }
105
+
106
+        if (!$destinationUserObject instanceof IUser) {
107
+            $this->logger->alert("Unknown destination user $destinationUser");
108
+            $this->failedNotication($transfer);
109
+            return;
110
+        }
111
+
112
+        try {
113
+            $this->transferService->transfer(
114
+                $sourceUserObject,
115
+                $destinationUserObject,
116
+                ltrim($path, '/')
117
+            );
118
+            $this->successNotification($transfer);
119
+        } catch (TransferOwnershipException $e) {
120
+            $this->logger->logException($e);
121
+            $this->failedNotication($transfer);
122
+        }
123
+
124
+        $this->mapper->delete($transfer);
125
+    }
126
+
127
+    private function failedNotication(Transfer $transfer): void {
128
+        // Send notification to source user
129
+        $notification = $this->notificationManager->createNotification();
130
+        $notification->setUser($transfer->getSourceUser())
131
+            ->setApp(Application::APP_ID)
132
+            ->setDateTime($this->time->getDateTime())
133
+            ->setSubject('transferOwnershipFailedSource', [
134
+                'sourceUser' => $transfer->getSourceUser(),
135
+                'targetUser' => $transfer->getTargetUser(),
136
+                'nodeName' => $transfer->getNodeName(),
137
+            ])
138
+            ->setObject('transfer', (string)$transfer->getId());
139
+        $this->notificationManager->notify($notification);
140
+
141
+        // Send notification to source user
142
+        $notification = $this->notificationManager->createNotification();
143
+        $notification->setUser($transfer->getTargetUser())
144
+            ->setApp(Application::APP_ID)
145
+            ->setDateTime($this->time->getDateTime())
146
+            ->setSubject('transferOwnershipFailedTarget', [
147
+                'sourceUser' => $transfer->getSourceUser(),
148
+                'targetUser' => $transfer->getTargetUser(),
149
+                'nodeName' => $transfer->getNodeName(),
150
+            ])
151
+            ->setObject('transfer', (string)$transfer->getId());
152
+        $this->notificationManager->notify($notification);
153
+    }
154
+
155
+    private function successNotification(Transfer $transfer): void {
156
+        // Send notification to source user
157
+        $notification = $this->notificationManager->createNotification();
158
+        $notification->setUser($transfer->getSourceUser())
159
+            ->setApp(Application::APP_ID)
160
+            ->setDateTime($this->time->getDateTime())
161
+            ->setSubject('transferOwnershipDoneSource', [
162
+                'sourceUser' => $transfer->getSourceUser(),
163
+                'targetUser' => $transfer->getTargetUser(),
164
+                'nodeName' => $transfer->getNodeName(),
165
+            ])
166
+            ->setObject('transfer', (string)$transfer->getId());
167
+        $this->notificationManager->notify($notification);
168
+
169
+        // Send notification to source user
170
+        $notification = $this->notificationManager->createNotification();
171
+        $notification->setUser($transfer->getTargetUser())
172
+            ->setApp(Application::APP_ID)
173
+            ->setDateTime($this->time->getDateTime())
174
+            ->setSubject('transferOwnershipDoneTarget', [
175
+                'sourceUser' => $transfer->getSourceUser(),
176
+                'targetUser' => $transfer->getTargetUser(),
177
+                'nodeName' => $transfer->getNodeName(),
178
+            ])
179
+            ->setObject('transfer', (string)$transfer->getId());
180
+        $this->notificationManager->notify($notification);
181
+    }
182 182
 }
Please login to merge, or discard this patch.
apps/twofactor_backupcodes/lib/Notifications/Notifier.php 1 patch
Indentation   +59 added lines, -59 removed lines patch added patch discarded remove patch
@@ -35,63 +35,63 @@
 block discarded – undo
35 35
 
36 36
 class Notifier implements INotifier {
37 37
 
38
-	/** @var IFactory */
39
-	private $factory;
40
-
41
-	/** @var IURLGenerator */
42
-	private $url;
43
-
44
-	public function __construct(IFactory $factory, IURLGenerator $url) {
45
-		$this->factory = $factory;
46
-		$this->url = $url;
47
-	}
48
-
49
-	/**
50
-	 * Identifier of the notifier, only use [a-z0-9_]
51
-	 *
52
-	 * @return string
53
-	 * @since 17.0.0
54
-	 */
55
-	public function getID(): string {
56
-		return 'twofactor_backupcodes';
57
-	}
58
-
59
-	/**
60
-	 * Human readable name describing the notifier
61
-	 *
62
-	 * @return string
63
-	 * @since 17.0.0
64
-	 */
65
-	public function getName(): string {
66
-		return $this->factory->get('twofactor_backupcodes')->t('Second-factor backup codes');
67
-	}
68
-
69
-	public function prepare(INotification $notification, string $languageCode): INotification {
70
-		if ($notification->getApp() !== 'twofactor_backupcodes') {
71
-			// Not my app => throw
72
-			throw new \InvalidArgumentException();
73
-		}
74
-
75
-		// Read the language from the notification
76
-		$l = $this->factory->get('twofactor_backupcodes', $languageCode);
77
-
78
-		switch ($notification->getSubject()) {
79
-			case 'create_backupcodes':
80
-				$notification->setParsedSubject(
81
-					$l->t('Generate backup codes')
82
-				)->setParsedMessage(
83
-					$l->t('You enabled two-factor authentication but did not generate backup codes yet. They are needed to restore access to your account in case you lose your second factor.')
84
-				);
85
-
86
-				$notification->setLink($this->url->linkToRouteAbsolute('settings.PersonalSettings.index', ['section' => 'security']));
87
-
88
-				$notification->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/password.svg')));
89
-
90
-				return $notification;
91
-
92
-			default:
93
-				// Unknown subject => Unknown notification => throw
94
-				throw new \InvalidArgumentException();
95
-		}
96
-	}
38
+    /** @var IFactory */
39
+    private $factory;
40
+
41
+    /** @var IURLGenerator */
42
+    private $url;
43
+
44
+    public function __construct(IFactory $factory, IURLGenerator $url) {
45
+        $this->factory = $factory;
46
+        $this->url = $url;
47
+    }
48
+
49
+    /**
50
+     * Identifier of the notifier, only use [a-z0-9_]
51
+     *
52
+     * @return string
53
+     * @since 17.0.0
54
+     */
55
+    public function getID(): string {
56
+        return 'twofactor_backupcodes';
57
+    }
58
+
59
+    /**
60
+     * Human readable name describing the notifier
61
+     *
62
+     * @return string
63
+     * @since 17.0.0
64
+     */
65
+    public function getName(): string {
66
+        return $this->factory->get('twofactor_backupcodes')->t('Second-factor backup codes');
67
+    }
68
+
69
+    public function prepare(INotification $notification, string $languageCode): INotification {
70
+        if ($notification->getApp() !== 'twofactor_backupcodes') {
71
+            // Not my app => throw
72
+            throw new \InvalidArgumentException();
73
+        }
74
+
75
+        // Read the language from the notification
76
+        $l = $this->factory->get('twofactor_backupcodes', $languageCode);
77
+
78
+        switch ($notification->getSubject()) {
79
+            case 'create_backupcodes':
80
+                $notification->setParsedSubject(
81
+                    $l->t('Generate backup codes')
82
+                )->setParsedMessage(
83
+                    $l->t('You enabled two-factor authentication but did not generate backup codes yet. They are needed to restore access to your account in case you lose your second factor.')
84
+                );
85
+
86
+                $notification->setLink($this->url->linkToRouteAbsolute('settings.PersonalSettings.index', ['section' => 'security']));
87
+
88
+                $notification->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/password.svg')));
89
+
90
+                return $notification;
91
+
92
+            default:
93
+                // Unknown subject => Unknown notification => throw
94
+                throw new \InvalidArgumentException();
95
+        }
96
+    }
97 97
 }
Please login to merge, or discard this patch.
apps/files/lib/Migration/Version11301Date20191205150729.php 1 patch
Indentation   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -31,47 +31,47 @@
 block discarded – undo
31 31
 
32 32
 class Version11301Date20191205150729 extends SimpleMigrationStep {
33 33
 
34
-	/**
35
-	 * @param IOutput $output
36
-	 * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
37
-	 * @param array $options
38
-	 * @return null|ISchemaWrapper
39
-	 */
40
-	public function changeSchema(IOutput $output, Closure $schemaClosure, array $options) {
41
-		/** @var ISchemaWrapper $schema */
42
-		$schema = $schemaClosure();
34
+    /**
35
+     * @param IOutput $output
36
+     * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
37
+     * @param array $options
38
+     * @return null|ISchemaWrapper
39
+     */
40
+    public function changeSchema(IOutput $output, Closure $schemaClosure, array $options) {
41
+        /** @var ISchemaWrapper $schema */
42
+        $schema = $schemaClosure();
43 43
 
44
-		$table = $schema->createTable('user_transfer_owner');
45
-		$table->addColumn('id', 'bigint', [
46
-			'autoincrement' => true,
47
-			'notnull' => true,
48
-			'length' => 20,
49
-			'unsigned' => true,
50
-		]);
51
-		$table->addColumn('source_user', 'string', [
52
-			'notnull' => true,
53
-			'length' => 64,
54
-		]);
55
-		$table->addColumn('target_user', 'string', [
56
-			'notnull' => true,
57
-			'length' => 64,
58
-		]);
59
-		$table->addColumn('file_id', 'bigint', [
60
-			'notnull' => true,
61
-			'length' => 20,
62
-		]);
63
-		$table->addColumn('node_name', 'string', [
64
-			'notnull' => true,
65
-			'length' => 255,
66
-		]);
67
-		$table->setPrimaryKey(['id']);
44
+        $table = $schema->createTable('user_transfer_owner');
45
+        $table->addColumn('id', 'bigint', [
46
+            'autoincrement' => true,
47
+            'notnull' => true,
48
+            'length' => 20,
49
+            'unsigned' => true,
50
+        ]);
51
+        $table->addColumn('source_user', 'string', [
52
+            'notnull' => true,
53
+            'length' => 64,
54
+        ]);
55
+        $table->addColumn('target_user', 'string', [
56
+            'notnull' => true,
57
+            'length' => 64,
58
+        ]);
59
+        $table->addColumn('file_id', 'bigint', [
60
+            'notnull' => true,
61
+            'length' => 20,
62
+        ]);
63
+        $table->addColumn('node_name', 'string', [
64
+            'notnull' => true,
65
+            'length' => 255,
66
+        ]);
67
+        $table->setPrimaryKey(['id']);
68 68
 
69
-		// Quite radical, we just assume no one updates cross beta with a pending request.
70
-		// Do not try this at home
71
-		if ($schema->hasTable('user_transfer_ownership')) {
72
-			$schema->dropTable('user_transfer_ownership');
73
-		}
69
+        // Quite radical, we just assume no one updates cross beta with a pending request.
70
+        // Do not try this at home
71
+        if ($schema->hasTable('user_transfer_ownership')) {
72
+            $schema->dropTable('user_transfer_ownership');
73
+        }
74 74
 
75
-		return $schema;
76
-	}
75
+        return $schema;
76
+    }
77 77
 }
Please login to merge, or discard this patch.
lib/private/Hooks/BasicEmitter.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,5 +27,5 @@
 block discarded – undo
27 27
  * @deprecated 18.0.0 use \OCP\EventDispatcher\IEventDispatcher
28 28
  */
29 29
 abstract class BasicEmitter implements Emitter {
30
-	use EmitterTrait;
30
+    use EmitterTrait;
31 31
 }
Please login to merge, or discard this patch.
lib/public/WorkflowEngine/IFileCheck.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -36,12 +36,12 @@
 block discarded – undo
36 36
  * @since 18.0.0
37 37
  */
38 38
 interface IFileCheck extends IEntityCheck {
39
-	/**
40
-	 * @param IStorage $storage
41
-	 * @param string $path
42
-	 * @param bool $isDir
43
-	 * @since 18.0.0
44
-	 */
45
-	public function setFileInfo(IStorage $storage, string $path, bool $isDir = false): void;
39
+    /**
40
+     * @param IStorage $storage
41
+     * @param string $path
42
+     * @param bool $isDir
43
+     * @since 18.0.0
44
+     */
45
+    public function setFileInfo(IStorage $storage, string $path, bool $isDir = false): void;
46 46
 
47 47
 }
Please login to merge, or discard this patch.
apps/workflowengine/lib/Check/TFileCheck.php 1 patch
Indentation   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -31,40 +31,40 @@
 block discarded – undo
31 31
 use OCP\WorkflowEngine\IEntity;
32 32
 
33 33
 trait TFileCheck {
34
-	/** @var IStorage */
35
-	protected $storage;
34
+    /** @var IStorage */
35
+    protected $storage;
36 36
 
37
-	/** @var string */
38
-	protected $path;
37
+    /** @var string */
38
+    protected $path;
39 39
 
40
-	/** @var bool */
41
-	protected $isDir;
40
+    /** @var bool */
41
+    protected $isDir;
42 42
 
43
-	/**
44
-	 * @param IStorage $storage
45
-	 * @param string $path
46
-	 * @param bool $isDir
47
-	 * @since 18.0.0
48
-	 */
49
-	public function setFileInfo(IStorage $storage, string $path, bool $isDir = false): void {
50
-		$this->storage = $storage;
51
-		$this->path = $path;
52
-		$this->isDir = $isDir;
53
-	}
43
+    /**
44
+     * @param IStorage $storage
45
+     * @param string $path
46
+     * @param bool $isDir
47
+     * @since 18.0.0
48
+     */
49
+    public function setFileInfo(IStorage $storage, string $path, bool $isDir = false): void {
50
+        $this->storage = $storage;
51
+        $this->path = $path;
52
+        $this->isDir = $isDir;
53
+    }
54 54
 
55
-	/**
56
-	 * @throws \OCP\Files\NotFoundException
57
-	 */
58
-	public function setEntitySubject(IEntity $entity, $subject): void {
59
-		if ($entity instanceof File) {
60
-			if (!$subject instanceof Node) {
61
-				throw new \UnexpectedValueException(
62
-					'Expected Node subject for File entity, got {class}',
63
-					['app' => Application::APP_ID, 'class' => get_class($subject)]
64
-				);
65
-			}
66
-			$this->storage = $subject->getStorage();
67
-			$this->path = $subject->getPath();
68
-		}
69
-	}
55
+    /**
56
+     * @throws \OCP\Files\NotFoundException
57
+     */
58
+    public function setEntitySubject(IEntity $entity, $subject): void {
59
+        if ($entity instanceof File) {
60
+            if (!$subject instanceof Node) {
61
+                throw new \UnexpectedValueException(
62
+                    'Expected Node subject for File entity, got {class}',
63
+                    ['app' => Application::APP_ID, 'class' => get_class($subject)]
64
+                );
65
+            }
66
+            $this->storage = $subject->getStorage();
67
+            $this->path = $subject->getPath();
68
+        }
69
+    }
70 70
 }
Please login to merge, or discard this patch.
apps/comments/lib/Search/Result.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -105,7 +105,7 @@
 block discarded – undo
105 105
 			$suffix = '…';
106 106
 		}
107 107
 
108
-		return $prefix . mb_substr($message, $start, $end - $start) . $suffix;
108
+		return $prefix.mb_substr($message, $start, $end - $start).$suffix;
109 109
 	}
110 110
 
111 111
 }
Please login to merge, or discard this patch.
Indentation   +87 added lines, -87 removed lines patch added patch discarded remove patch
@@ -32,101 +32,101 @@
 block discarded – undo
32 32
  * @deprecated 20.0.0
33 33
  */
34 34
 class Result extends BaseResult {
35
-	/**
36
-	 * @deprecated 20.0.0
37
-	 */
38
-	public $type = 'comment';
39
-	/**
40
-	 * @deprecated 20.0.0
41
-	 */
42
-	public $comment;
43
-	/**
44
-	 * @deprecated 20.0.0
45
-	 */
46
-	public $authorId;
47
-	/**
48
-	 * @deprecated 20.0.0
49
-	 */
50
-	public $authorName;
51
-	/**
52
-	 * @deprecated 20.0.0
53
-	 */
54
-	public $path;
55
-	/**
56
-	 * @deprecated 20.0.0
57
-	 */
58
-	public $fileName;
35
+    /**
36
+     * @deprecated 20.0.0
37
+     */
38
+    public $type = 'comment';
39
+    /**
40
+     * @deprecated 20.0.0
41
+     */
42
+    public $comment;
43
+    /**
44
+     * @deprecated 20.0.0
45
+     */
46
+    public $authorId;
47
+    /**
48
+     * @deprecated 20.0.0
49
+     */
50
+    public $authorName;
51
+    /**
52
+     * @deprecated 20.0.0
53
+     */
54
+    public $path;
55
+    /**
56
+     * @deprecated 20.0.0
57
+     */
58
+    public $fileName;
59 59
 
60
-	/**
61
-	 * @param string $search
62
-	 * @param IComment $comment
63
-	 * @param string $authorName
64
-	 * @param string $path
65
-	 * @throws NotFoundException
66
-	 * @deprecated 20.0.0
67
-	 */
68
-	public function __construct(string $search,
69
-								IComment $comment,
70
-								string $authorName,
71
-								string $path) {
72
-		parent::__construct(
73
-			(int) $comment->getId(),
74
-			$comment->getMessage()
75
-		/* @todo , [link to file] */
76
-		);
60
+    /**
61
+     * @param string $search
62
+     * @param IComment $comment
63
+     * @param string $authorName
64
+     * @param string $path
65
+     * @throws NotFoundException
66
+     * @deprecated 20.0.0
67
+     */
68
+    public function __construct(string $search,
69
+                                IComment $comment,
70
+                                string $authorName,
71
+                                string $path) {
72
+        parent::__construct(
73
+            (int) $comment->getId(),
74
+            $comment->getMessage()
75
+        /* @todo , [link to file] */
76
+        );
77 77
 
78
-		$this->comment = $this->getRelevantMessagePart($comment->getMessage(), $search);
79
-		$this->authorId = $comment->getActorId();
80
-		$this->authorName = $authorName;
81
-		$this->fileName = basename($path);
82
-		$this->path = $this->getVisiblePath($path);
83
-	}
78
+        $this->comment = $this->getRelevantMessagePart($comment->getMessage(), $search);
79
+        $this->authorId = $comment->getActorId();
80
+        $this->authorName = $authorName;
81
+        $this->fileName = basename($path);
82
+        $this->path = $this->getVisiblePath($path);
83
+    }
84 84
 
85
-	/**
86
-	 * @param string $path
87
-	 * @return string
88
-	 * @throws NotFoundException
89
-	 */
90
-	protected function getVisiblePath(string $path): string {
91
-		$segments = explode('/', trim($path, '/'), 3);
85
+    /**
86
+     * @param string $path
87
+     * @return string
88
+     * @throws NotFoundException
89
+     */
90
+    protected function getVisiblePath(string $path): string {
91
+        $segments = explode('/', trim($path, '/'), 3);
92 92
 
93
-		if (!isset($segments[2])) {
94
-			throw new NotFoundException('Path not inside visible section');
95
-		}
93
+        if (!isset($segments[2])) {
94
+            throw new NotFoundException('Path not inside visible section');
95
+        }
96 96
 
97
-		return $segments[2];
98
-	}
97
+        return $segments[2];
98
+    }
99 99
 
100
-	/**
101
-	 * @param string $message
102
-	 * @param string $search
103
-	 * @return string
104
-	 * @throws NotFoundException
105
-	 */
106
-	protected function getRelevantMessagePart(string $message, string $search): string {
107
-		$start = mb_stripos($message, $search);
108
-		if ($start === false) {
109
-			throw new NotFoundException('Comment section not found');
110
-		}
100
+    /**
101
+     * @param string $message
102
+     * @param string $search
103
+     * @return string
104
+     * @throws NotFoundException
105
+     */
106
+    protected function getRelevantMessagePart(string $message, string $search): string {
107
+        $start = mb_stripos($message, $search);
108
+        if ($start === false) {
109
+            throw new NotFoundException('Comment section not found');
110
+        }
111 111
 
112
-		$end = $start + mb_strlen($search);
112
+        $end = $start + mb_strlen($search);
113 113
 
114
-		if ($start <= 25) {
115
-			$start = 0;
116
-			$prefix = '';
117
-		} else {
118
-			$start -= 25;
119
-			$prefix = '…';
120
-		}
114
+        if ($start <= 25) {
115
+            $start = 0;
116
+            $prefix = '';
117
+        } else {
118
+            $start -= 25;
119
+            $prefix = '…';
120
+        }
121 121
 
122
-		if ((mb_strlen($message) - $end) <= 25) {
123
-			$end = mb_strlen($message);
124
-			$suffix = '';
125
-		} else {
126
-			$end += 25;
127
-			$suffix = '…';
128
-		}
122
+        if ((mb_strlen($message) - $end) <= 25) {
123
+            $end = mb_strlen($message);
124
+            $suffix = '';
125
+        } else {
126
+            $end += 25;
127
+            $suffix = '…';
128
+        }
129 129
 
130
-		return $prefix . mb_substr($message, $start, $end - $start) . $suffix;
131
-	}
130
+        return $prefix . mb_substr($message, $start, $end - $start) . $suffix;
131
+    }
132 132
 }
Please login to merge, or discard this patch.
apps/files_sharing/lib/Controller/AcceptController.php 1 patch
Indentation   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -37,47 +37,47 @@
 block discarded – undo
37 37
 
38 38
 class AcceptController extends Controller {
39 39
 
40
-	/** @var ShareManager */
41
-	private $shareManager;
40
+    /** @var ShareManager */
41
+    private $shareManager;
42 42
 
43
-	/** @var IUserSession */
44
-	private $userSession;
43
+    /** @var IUserSession */
44
+    private $userSession;
45 45
 
46
-	/** @var IURLGenerator */
47
-	private $urlGenerator;
46
+    /** @var IURLGenerator */
47
+    private $urlGenerator;
48 48
 
49
-	public function __construct(IRequest $request, ShareManager $shareManager, IUserSession $userSession, IURLGenerator $urlGenerator) {
50
-		parent::__construct(Application::APP_ID, $request);
49
+    public function __construct(IRequest $request, ShareManager $shareManager, IUserSession $userSession, IURLGenerator $urlGenerator) {
50
+        parent::__construct(Application::APP_ID, $request);
51 51
 
52
-		$this->shareManager = $shareManager;
53
-		$this->userSession = $userSession;
54
-		$this->urlGenerator = $urlGenerator;
55
-	}
52
+        $this->shareManager = $shareManager;
53
+        $this->userSession = $userSession;
54
+        $this->urlGenerator = $urlGenerator;
55
+    }
56 56
 
57
-	/**
58
-	 * @NoAdminRequired
59
-	 * @NoCSRFRequired
60
-	 */
61
-	public function accept(string $shareId): Response {
62
-		try {
63
-			$share = $this->shareManager->getShareById($shareId);
64
-		} catch (ShareNotFound $e) {
65
-			return new NotFoundResponse();
66
-		}
57
+    /**
58
+     * @NoAdminRequired
59
+     * @NoCSRFRequired
60
+     */
61
+    public function accept(string $shareId): Response {
62
+        try {
63
+            $share = $this->shareManager->getShareById($shareId);
64
+        } catch (ShareNotFound $e) {
65
+            return new NotFoundResponse();
66
+        }
67 67
 
68
-		$user = $this->userSession->getUser();
69
-		if ($user === null) {
70
-			return new NotFoundResponse();
71
-		}
68
+        $user = $this->userSession->getUser();
69
+        if ($user === null) {
70
+            return new NotFoundResponse();
71
+        }
72 72
 
73
-		try {
74
-			$share = $this->shareManager->acceptShare($share, $user->getUID());
75
-		} catch (\Exception $e) {
76
-			// Just ignore
77
-		}
73
+        try {
74
+            $share = $this->shareManager->acceptShare($share, $user->getUID());
75
+        } catch (\Exception $e) {
76
+            // Just ignore
77
+        }
78 78
 
79
-		$url = $this->urlGenerator->linkToRouteAbsolute('files.viewcontroller.showFile', ['fileid' => $share->getNode()->getId()]);
79
+        $url = $this->urlGenerator->linkToRouteAbsolute('files.viewcontroller.showFile', ['fileid' => $share->getNode()->getId()]);
80 80
 
81
-		return new RedirectResponse($url);
82
-	}
81
+        return new RedirectResponse($url);
82
+    }
83 83
 }
Please login to merge, or discard this patch.
lib/public/AppFramework/Http/Template/ExternalShareMenuAction.php 2 patches
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -66,16 +66,16 @@
 block discarded – undo
66 66
 	 * @since 14.0.0
67 67
 	 */
68 68
 	public function render(): string {
69
-		return '<li>' .
70
-			'    <button id="save-external-share" class="icon ' . Util::sanitizeHTML($this->getIcon()) . '" data-protected="false" data-owner-display-name="' . Util::sanitizeHTML($this->displayname) . '" data-owner="' . Util::sanitizeHTML($this->owner) . '" data-name="' . Util::sanitizeHTML($this->shareName) . '">' . Util::sanitizeHTML($this->getLabel()) . '</button>' .
71
-			'</li>' .
72
-			'<li id="external-share-menu-item" class="hidden">' .
73
-			'    <span class="menuitem">' .
74
-			'        <form class="save-form" action="#">' .
75
-			'            <input type="text" id="remote_address" placeholder="[email protected]">' .
76
-			'            <input type="submit" value=" " id="save-button-confirm" class="icon-confirm" disabled="disabled"></button>' .
77
-			'        </form>' .
78
-			'    </span>' .
69
+		return '<li>'.
70
+			'    <button id="save-external-share" class="icon '.Util::sanitizeHTML($this->getIcon()).'" data-protected="false" data-owner-display-name="'.Util::sanitizeHTML($this->displayname).'" data-owner="'.Util::sanitizeHTML($this->owner).'" data-name="'.Util::sanitizeHTML($this->shareName).'">'.Util::sanitizeHTML($this->getLabel()).'</button>'.
71
+			'</li>'.
72
+			'<li id="external-share-menu-item" class="hidden">'.
73
+			'    <span class="menuitem">'.
74
+			'        <form class="save-form" action="#">'.
75
+			'            <input type="text" id="remote_address" placeholder="[email protected]">'.
76
+			'            <input type="submit" value=" " id="save-button-confirm" class="icon-confirm" disabled="disabled"></button>'.
77
+			'        </form>'.
78
+			'    </span>'.
79 79
 			'</li>';
80 80
 	}
81 81
 }
Please login to merge, or discard this patch.
Indentation   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -33,46 +33,46 @@
 block discarded – undo
33 33
  * @since 14.0.0
34 34
  */
35 35
 class ExternalShareMenuAction extends SimpleMenuAction {
36
-	/** @var string */
37
-	private $owner;
36
+    /** @var string */
37
+    private $owner;
38 38
 
39
-	/** @var string */
40
-	private $displayname;
39
+    /** @var string */
40
+    private $displayname;
41 41
 
42
-	/** @var string */
43
-	private $shareName;
42
+    /** @var string */
43
+    private $shareName;
44 44
 
45
-	/**
46
-	 * ExternalShareMenuAction constructor.
47
-	 *
48
-	 * @param string $label
49
-	 * @param string $icon
50
-	 * @param string $owner
51
-	 * @param string $displayname
52
-	 * @param string $shareName
53
-	 * @since 14.0.0
54
-	 */
55
-	public function __construct(string $label, string $icon, string $owner, string $displayname, string $shareName) {
56
-		parent::__construct('save', $label, $icon);
57
-		$this->owner = $owner;
58
-		$this->displayname = $displayname;
59
-		$this->shareName = $shareName;
60
-	}
45
+    /**
46
+     * ExternalShareMenuAction constructor.
47
+     *
48
+     * @param string $label
49
+     * @param string $icon
50
+     * @param string $owner
51
+     * @param string $displayname
52
+     * @param string $shareName
53
+     * @since 14.0.0
54
+     */
55
+    public function __construct(string $label, string $icon, string $owner, string $displayname, string $shareName) {
56
+        parent::__construct('save', $label, $icon);
57
+        $this->owner = $owner;
58
+        $this->displayname = $displayname;
59
+        $this->shareName = $shareName;
60
+    }
61 61
 
62
-	/**
63
-	 * @since 14.0.0
64
-	 */
65
-	public function render(): string {
66
-		return '<li>' .
67
-			'    <button id="save-external-share" class="icon ' . Util::sanitizeHTML($this->getIcon()) . '" data-protected="false" data-owner-display-name="' . Util::sanitizeHTML($this->displayname) . '" data-owner="' . Util::sanitizeHTML($this->owner) . '" data-name="' . Util::sanitizeHTML($this->shareName) . '">' . Util::sanitizeHTML($this->getLabel()) . '</button>' .
68
-			'</li>' .
69
-			'<li id="external-share-menu-item" class="hidden">' .
70
-			'    <span class="menuitem">' .
71
-			'        <form class="save-form" action="#">' .
72
-			'            <input type="text" id="remote_address" placeholder="[email protected]">' .
73
-			'            <input type="submit" value=" " id="save-button-confirm" class="icon-confirm" disabled="disabled"></button>' .
74
-			'        </form>' .
75
-			'    </span>' .
76
-			'</li>';
77
-	}
62
+    /**
63
+     * @since 14.0.0
64
+     */
65
+    public function render(): string {
66
+        return '<li>' .
67
+            '    <button id="save-external-share" class="icon ' . Util::sanitizeHTML($this->getIcon()) . '" data-protected="false" data-owner-display-name="' . Util::sanitizeHTML($this->displayname) . '" data-owner="' . Util::sanitizeHTML($this->owner) . '" data-name="' . Util::sanitizeHTML($this->shareName) . '">' . Util::sanitizeHTML($this->getLabel()) . '</button>' .
68
+            '</li>' .
69
+            '<li id="external-share-menu-item" class="hidden">' .
70
+            '    <span class="menuitem">' .
71
+            '        <form class="save-form" action="#">' .
72
+            '            <input type="text" id="remote_address" placeholder="[email protected]">' .
73
+            '            <input type="submit" value=" " id="save-button-confirm" class="icon-confirm" disabled="disabled"></button>' .
74
+            '        </form>' .
75
+            '    </span>' .
76
+            '</li>';
77
+    }
78 78
 }
Please login to merge, or discard this patch.