Completed
Push — master ( 88ba65...9a0892 )
by Christoph
24:20
created
lib/private/Files/Cache/StorageGlobal.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@
 block discarded – undo
83 83
 
84 84
 			if ($row) {
85 85
 				$this->cache[$storageId] = $row;
86
-				$this->numericIdCache[(int)$row['numeric_id']] = $row;
86
+				$this->numericIdCache[(int) $row['numeric_id']] = $row;
87 87
 			}
88 88
 		}
89 89
 		return $this->cache[$storageId] ?? null;
Please login to merge, or discard this patch.
Indentation   +65 added lines, -65 removed lines patch added patch discarded remove patch
@@ -21,79 +21,79 @@
 block discarded – undo
21 21
  * @package OC\Files\Cache
22 22
  */
23 23
 class StorageGlobal {
24
-	/** @var array<string, array> */
25
-	private $cache = [];
26
-	/** @var array<int, array> */
27
-	private $numericIdCache = [];
24
+    /** @var array<string, array> */
25
+    private $cache = [];
26
+    /** @var array<int, array> */
27
+    private $numericIdCache = [];
28 28
 
29
-	public function __construct(
30
-		private IDBConnection $connection,
31
-	) {
32
-	}
29
+    public function __construct(
30
+        private IDBConnection $connection,
31
+    ) {
32
+    }
33 33
 
34
-	/**
35
-	 * @param string[] $storageIds
36
-	 */
37
-	public function loadForStorageIds(array $storageIds) {
38
-		$builder = $this->connection->getQueryBuilder();
39
-		$query = $builder->select(['id', 'numeric_id', 'available', 'last_checked'])
40
-			->from('storages')
41
-			->where($builder->expr()->in('id', $builder->createNamedParameter(array_values($storageIds), IQueryBuilder::PARAM_STR_ARRAY)));
34
+    /**
35
+     * @param string[] $storageIds
36
+     */
37
+    public function loadForStorageIds(array $storageIds) {
38
+        $builder = $this->connection->getQueryBuilder();
39
+        $query = $builder->select(['id', 'numeric_id', 'available', 'last_checked'])
40
+            ->from('storages')
41
+            ->where($builder->expr()->in('id', $builder->createNamedParameter(array_values($storageIds), IQueryBuilder::PARAM_STR_ARRAY)));
42 42
 
43
-		$result = $query->executeQuery();
44
-		while ($row = $result->fetch()) {
45
-			$this->cache[$row['id']] = $row;
46
-		}
47
-		$result->closeCursor();
48
-	}
43
+        $result = $query->executeQuery();
44
+        while ($row = $result->fetch()) {
45
+            $this->cache[$row['id']] = $row;
46
+        }
47
+        $result->closeCursor();
48
+    }
49 49
 
50
-	/**
51
-	 * @param string $storageId
52
-	 * @return array|null
53
-	 */
54
-	public function getStorageInfo(string $storageId): ?array {
55
-		if (!isset($this->cache[$storageId])) {
56
-			$builder = $this->connection->getQueryBuilder();
57
-			$query = $builder->select(['id', 'numeric_id', 'available', 'last_checked'])
58
-				->from('storages')
59
-				->where($builder->expr()->eq('id', $builder->createNamedParameter($storageId)));
50
+    /**
51
+     * @param string $storageId
52
+     * @return array|null
53
+     */
54
+    public function getStorageInfo(string $storageId): ?array {
55
+        if (!isset($this->cache[$storageId])) {
56
+            $builder = $this->connection->getQueryBuilder();
57
+            $query = $builder->select(['id', 'numeric_id', 'available', 'last_checked'])
58
+                ->from('storages')
59
+                ->where($builder->expr()->eq('id', $builder->createNamedParameter($storageId)));
60 60
 
61
-			$result = $query->executeQuery();
62
-			$row = $result->fetch();
63
-			$result->closeCursor();
61
+            $result = $query->executeQuery();
62
+            $row = $result->fetch();
63
+            $result->closeCursor();
64 64
 
65
-			if ($row) {
66
-				$this->cache[$storageId] = $row;
67
-				$this->numericIdCache[(int)$row['numeric_id']] = $row;
68
-			}
69
-		}
70
-		return $this->cache[$storageId] ?? null;
71
-	}
65
+            if ($row) {
66
+                $this->cache[$storageId] = $row;
67
+                $this->numericIdCache[(int)$row['numeric_id']] = $row;
68
+            }
69
+        }
70
+        return $this->cache[$storageId] ?? null;
71
+    }
72 72
 
73
-	/**
74
-	 * @param int $numericId
75
-	 * @return array|null
76
-	 */
77
-	public function getStorageInfoByNumericId(int $numericId): ?array {
78
-		if (!isset($this->numericIdCache[$numericId])) {
79
-			$builder = $this->connection->getQueryBuilder();
80
-			$query = $builder->select(['id', 'numeric_id', 'available', 'last_checked'])
81
-				->from('storages')
82
-				->where($builder->expr()->eq('numeric_id', $builder->createNamedParameter($numericId)));
73
+    /**
74
+     * @param int $numericId
75
+     * @return array|null
76
+     */
77
+    public function getStorageInfoByNumericId(int $numericId): ?array {
78
+        if (!isset($this->numericIdCache[$numericId])) {
79
+            $builder = $this->connection->getQueryBuilder();
80
+            $query = $builder->select(['id', 'numeric_id', 'available', 'last_checked'])
81
+                ->from('storages')
82
+                ->where($builder->expr()->eq('numeric_id', $builder->createNamedParameter($numericId)));
83 83
 
84
-			$result = $query->executeQuery();
85
-			$row = $result->fetch();
86
-			$result->closeCursor();
84
+            $result = $query->executeQuery();
85
+            $row = $result->fetch();
86
+            $result->closeCursor();
87 87
 
88
-			if ($row) {
89
-				$this->numericIdCache[$numericId] = $row;
90
-				$this->cache[$row['id']] = $row;
91
-			}
92
-		}
93
-		return $this->numericIdCache[$numericId] ?? null;
94
-	}
88
+            if ($row) {
89
+                $this->numericIdCache[$numericId] = $row;
90
+                $this->cache[$row['id']] = $row;
91
+            }
92
+        }
93
+        return $this->numericIdCache[$numericId] ?? null;
94
+    }
95 95
 
96
-	public function clearCache() {
97
-		$this->cache = [];
98
-	}
96
+    public function clearCache() {
97
+        $this->cache = [];
98
+    }
99 99
 }
Please login to merge, or discard this patch.
apps/dav/lib/Connector/Sabre/ChecksumUpdatePlugin.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -65,12 +65,12 @@
 block discarded – undo
65 65
 		$node = $this->server->tree->getNodeForPath($path);
66 66
 		if ($node instanceof File) {
67 67
 			$type = strtolower(
68
-				(string)$request->getHeader('X-Recalculate-Hash')
68
+				(string) $request->getHeader('X-Recalculate-Hash')
69 69
 			);
70 70
 
71 71
 			$hash = $node->hash($type);
72 72
 			if ($hash) {
73
-				$checksum = strtoupper($type) . ':' . $hash;
73
+				$checksum = strtoupper($type).':'.$hash;
74 74
 				$node->setChecksum($checksum);
75 75
 				$response->addHeader('OC-Checksum', $checksum);
76 76
 				$response->setHeader('Content-Length', '0');
Please login to merge, or discard this patch.
Indentation   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -15,41 +15,41 @@
 block discarded – undo
15 15
 use Sabre\HTTP\ResponseInterface;
16 16
 
17 17
 class ChecksumUpdatePlugin extends ServerPlugin {
18
-	protected ?Server $server = null;
19
-
20
-	public function initialize(Server $server) {
21
-		$this->server = $server;
22
-		$server->on('method:PATCH', [$this, 'httpPatch']);
23
-	}
24
-
25
-	public function getPluginName(): string {
26
-		return 'checksumupdate';
27
-	}
28
-
29
-	/** @return string[] */
30
-	public function getFeatures(): array {
31
-		return ['nextcloud-checksum-update'];
32
-	}
33
-
34
-	public function httpPatch(RequestInterface $request, ResponseInterface $response) {
35
-		$path = $request->getPath();
36
-
37
-		$node = $this->server->tree->getNodeForPath($path);
38
-		if ($node instanceof File) {
39
-			$type = strtolower(
40
-				(string)$request->getHeader('X-Recalculate-Hash')
41
-			);
42
-
43
-			$hash = $node->hash($type);
44
-			if ($hash) {
45
-				$checksum = strtoupper($type) . ':' . $hash;
46
-				$node->setChecksum($checksum);
47
-				$response->addHeader('OC-Checksum', $checksum);
48
-				$response->setHeader('Content-Length', '0');
49
-				$response->setStatus(Http::STATUS_NO_CONTENT);
50
-
51
-				return false;
52
-			}
53
-		}
54
-	}
18
+    protected ?Server $server = null;
19
+
20
+    public function initialize(Server $server) {
21
+        $this->server = $server;
22
+        $server->on('method:PATCH', [$this, 'httpPatch']);
23
+    }
24
+
25
+    public function getPluginName(): string {
26
+        return 'checksumupdate';
27
+    }
28
+
29
+    /** @return string[] */
30
+    public function getFeatures(): array {
31
+        return ['nextcloud-checksum-update'];
32
+    }
33
+
34
+    public function httpPatch(RequestInterface $request, ResponseInterface $response) {
35
+        $path = $request->getPath();
36
+
37
+        $node = $this->server->tree->getNodeForPath($path);
38
+        if ($node instanceof File) {
39
+            $type = strtolower(
40
+                (string)$request->getHeader('X-Recalculate-Hash')
41
+            );
42
+
43
+            $hash = $node->hash($type);
44
+            if ($hash) {
45
+                $checksum = strtoupper($type) . ':' . $hash;
46
+                $node->setChecksum($checksum);
47
+                $response->addHeader('OC-Checksum', $checksum);
48
+                $response->setHeader('Content-Length', '0');
49
+                $response->setStatus(Http::STATUS_NO_CONTENT);
50
+
51
+                return false;
52
+            }
53
+        }
54
+    }
55 55
 }
Please login to merge, or discard this patch.
core/Command/Group/Delete.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -58,18 +58,18 @@
 block discarded – undo
58 58
 	protected function execute(InputInterface $input, OutputInterface $output): int {
59 59
 		$gid = $input->getArgument('groupid');
60 60
 		if ($gid === 'admin') {
61
-			$output->writeln('<error>Group "' . $gid . '" could not be deleted.</error>');
61
+			$output->writeln('<error>Group "'.$gid.'" could not be deleted.</error>');
62 62
 			return 1;
63 63
 		}
64 64
 		if (!$this->groupManager->groupExists($gid)) {
65
-			$output->writeln('<error>Group "' . $gid . '" does not exist.</error>');
65
+			$output->writeln('<error>Group "'.$gid.'" does not exist.</error>');
66 66
 			return 1;
67 67
 		}
68 68
 		$group = $this->groupManager->get($gid);
69 69
 		if ($group->delete()) {
70
-			$output->writeln('Group "' . $gid . '" was removed');
70
+			$output->writeln('Group "'.$gid.'" was removed');
71 71
 		} else {
72
-			$output->writeln('<error>Group "' . $gid . '" could not be deleted. Please check the logs.</error>');
72
+			$output->writeln('<error>Group "'.$gid.'" could not be deleted. Please check the logs.</error>');
73 73
 			return 1;
74 74
 		}
75 75
 		return 0;
Please login to merge, or discard this patch.
Indentation   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -35,52 +35,52 @@
 block discarded – undo
35 35
 use Symfony\Component\Console\Output\OutputInterface;
36 36
 
37 37
 class Delete extends Base {
38
-	public function __construct(
39
-		protected IGroupManager $groupManager,
40
-	) {
41
-		parent::__construct();
42
-	}
38
+    public function __construct(
39
+        protected IGroupManager $groupManager,
40
+    ) {
41
+        parent::__construct();
42
+    }
43 43
 
44
-	protected function configure() {
45
-		$this
46
-			->setName('group:delete')
47
-			->setDescription('Remove a group')
48
-			->addArgument(
49
-				'groupid',
50
-				InputArgument::REQUIRED,
51
-				'Group name'
52
-			);
53
-	}
44
+    protected function configure() {
45
+        $this
46
+            ->setName('group:delete')
47
+            ->setDescription('Remove a group')
48
+            ->addArgument(
49
+                'groupid',
50
+                InputArgument::REQUIRED,
51
+                'Group name'
52
+            );
53
+    }
54 54
 
55
-	protected function execute(InputInterface $input, OutputInterface $output): int {
56
-		$gid = $input->getArgument('groupid');
57
-		if ($gid === 'admin') {
58
-			$output->writeln('<error>Group "' . $gid . '" could not be deleted.</error>');
59
-			return 1;
60
-		}
61
-		if (!$this->groupManager->groupExists($gid)) {
62
-			$output->writeln('<error>Group "' . $gid . '" does not exist.</error>');
63
-			return 1;
64
-		}
65
-		$group = $this->groupManager->get($gid);
66
-		if ($group->delete()) {
67
-			$output->writeln('Group "' . $gid . '" was removed');
68
-		} else {
69
-			$output->writeln('<error>Group "' . $gid . '" could not be deleted. Please check the logs.</error>');
70
-			return 1;
71
-		}
72
-		return 0;
73
-	}
55
+    protected function execute(InputInterface $input, OutputInterface $output): int {
56
+        $gid = $input->getArgument('groupid');
57
+        if ($gid === 'admin') {
58
+            $output->writeln('<error>Group "' . $gid . '" could not be deleted.</error>');
59
+            return 1;
60
+        }
61
+        if (!$this->groupManager->groupExists($gid)) {
62
+            $output->writeln('<error>Group "' . $gid . '" does not exist.</error>');
63
+            return 1;
64
+        }
65
+        $group = $this->groupManager->get($gid);
66
+        if ($group->delete()) {
67
+            $output->writeln('Group "' . $gid . '" was removed');
68
+        } else {
69
+            $output->writeln('<error>Group "' . $gid . '" could not be deleted. Please check the logs.</error>');
70
+            return 1;
71
+        }
72
+        return 0;
73
+    }
74 74
 
75
-	/**
76
-	 * @param string $argumentName
77
-	 * @param CompletionContext $context
78
-	 * @return string[]
79
-	 */
80
-	public function completeArgumentValues($argumentName, CompletionContext $context) {
81
-		if ($argumentName === 'groupid') {
82
-			return array_map(static fn (IGroup $group) => $group->getGID(), $this->groupManager->search($context->getCurrentWord()));
83
-		}
84
-		return [];
85
-	}
75
+    /**
76
+     * @param string $argumentName
77
+     * @param CompletionContext $context
78
+     * @return string[]
79
+     */
80
+    public function completeArgumentValues($argumentName, CompletionContext $context) {
81
+        if ($argumentName === 'groupid') {
82
+            return array_map(static fn (IGroup $group) => $group->getGID(), $this->groupManager->search($context->getCurrentWord()));
83
+        }
84
+        return [];
85
+    }
86 86
 }
Please login to merge, or discard this patch.
apps/files_sharing/lib/Migration/Version24000Date20220404142216.php 1 patch
Indentation   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -35,22 +35,22 @@
 block discarded – undo
35 35
  * Auto-generated migration step: Please modify to your needs!
36 36
  */
37 37
 class Version24000Date20220404142216 extends SimpleMigrationStep {
38
-	/**
39
-	 * @param IOutput $output
40
-	 * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
41
-	 * @param array $options
42
-	 * @return null|ISchemaWrapper
43
-	 */
44
-	public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
45
-		/** @var ISchemaWrapper $schema */
46
-		$schema = $schemaClosure();
38
+    /**
39
+     * @param IOutput $output
40
+     * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
41
+     * @param array $options
42
+     * @return null|ISchemaWrapper
43
+     */
44
+    public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
45
+        /** @var ISchemaWrapper $schema */
46
+        $schema = $schemaClosure();
47 47
 
48
-		$table = $schema->getTable('share_external');
49
-		$column = $table->getColumn('name');
50
-		if ($column->getLength() < 4000) {
51
-			$column->setLength(4000);
52
-			return $schema;
53
-		}
54
-		return null;
55
-	}
48
+        $table = $schema->getTable('share_external');
49
+        $column = $table->getColumn('name');
50
+        if ($column->getLength() < 4000) {
51
+            $column->setLength(4000);
52
+            return $schema;
53
+        }
54
+        return null;
55
+    }
56 56
 }
Please login to merge, or discard this patch.
lib/public/Files/Config/IMountProviderCollection.php 1 patch
Indentation   +60 added lines, -60 removed lines patch added patch discarded remove patch
@@ -29,71 +29,71 @@
 block discarded – undo
29 29
  * @since 8.0.0
30 30
  */
31 31
 interface IMountProviderCollection {
32
-	/**
33
-	 * Get all configured mount points for the user
34
-	 *
35
-	 * @param \OCP\IUser $user
36
-	 * @return \OCP\Files\Mount\IMountPoint[]
37
-	 * @since 8.0.0
38
-	 */
39
-	public function getMountsForUser(IUser $user);
32
+    /**
33
+     * Get all configured mount points for the user
34
+     *
35
+     * @param \OCP\IUser $user
36
+     * @return \OCP\Files\Mount\IMountPoint[]
37
+     * @since 8.0.0
38
+     */
39
+    public function getMountsForUser(IUser $user);
40 40
 
41
-	/**
42
-	 * Get the configured mount points for the user from a specific mount provider
43
-	 *
44
-	 * @param \OCP\IUser $user
45
-	 * @param class-string<IMountProvider>[] $mountProviderClasses
46
-	 * @return \OCP\Files\Mount\IMountPoint[]
47
-	 * @since 24.0.0
48
-	 */
49
-	public function getUserMountsForProviderClasses(IUser $user, array $mountProviderClasses): array;
41
+    /**
42
+     * Get the configured mount points for the user from a specific mount provider
43
+     *
44
+     * @param \OCP\IUser $user
45
+     * @param class-string<IMountProvider>[] $mountProviderClasses
46
+     * @return \OCP\Files\Mount\IMountPoint[]
47
+     * @since 24.0.0
48
+     */
49
+    public function getUserMountsForProviderClasses(IUser $user, array $mountProviderClasses): array;
50 50
 
51
-	/**
52
-	 * Get the configured home mount for this user
53
-	 *
54
-	 * @param \OCP\IUser $user
55
-	 * @return \OCP\Files\Mount\IMountPoint
56
-	 * @since 9.1.0
57
-	 */
58
-	public function getHomeMountForUser(IUser $user);
51
+    /**
52
+     * Get the configured home mount for this user
53
+     *
54
+     * @param \OCP\IUser $user
55
+     * @return \OCP\Files\Mount\IMountPoint
56
+     * @since 9.1.0
57
+     */
58
+    public function getHomeMountForUser(IUser $user);
59 59
 
60
-	/**
61
-	 * Add a provider for mount points
62
-	 *
63
-	 * @param \OCP\Files\Config\IMountProvider $provider
64
-	 * @since 8.0.0
65
-	 */
66
-	public function registerProvider(IMountProvider $provider);
60
+    /**
61
+     * Add a provider for mount points
62
+     *
63
+     * @param \OCP\Files\Config\IMountProvider $provider
64
+     * @since 8.0.0
65
+     */
66
+    public function registerProvider(IMountProvider $provider);
67 67
 
68
-	/**
69
-	 * Add a filter for mounts
70
-	 *
71
-	 * @param callable $filter (IMountPoint $mountPoint, IUser $user) => boolean
72
-	 * @since 14.0.0
73
-	 */
74
-	public function registerMountFilter(callable $filter);
68
+    /**
69
+     * Add a filter for mounts
70
+     *
71
+     * @param callable $filter (IMountPoint $mountPoint, IUser $user) => boolean
72
+     * @since 14.0.0
73
+     */
74
+    public function registerMountFilter(callable $filter);
75 75
 
76
-	/**
77
-	 * Add a provider for home mount points
78
-	 *
79
-	 * @param \OCP\Files\Config\IHomeMountProvider $provider
80
-	 * @since 9.1.0
81
-	 */
82
-	public function registerHomeProvider(IHomeMountProvider $provider);
76
+    /**
77
+     * Add a provider for home mount points
78
+     *
79
+     * @param \OCP\Files\Config\IHomeMountProvider $provider
80
+     * @since 9.1.0
81
+     */
82
+    public function registerHomeProvider(IHomeMountProvider $provider);
83 83
 
84
-	/**
85
-	 * Get the mount cache which can be used to search for mounts without setting up the filesystem
86
-	 *
87
-	 * @return IUserMountCache
88
-	 * @since 9.0.0
89
-	 */
90
-	public function getMountCache();
84
+    /**
85
+     * Get the mount cache which can be used to search for mounts without setting up the filesystem
86
+     *
87
+     * @return IUserMountCache
88
+     * @since 9.0.0
89
+     */
90
+    public function getMountCache();
91 91
 
92
-	/**
93
-	 * Get all root mountpoints
94
-	 *
95
-	 * @return \OCP\Files\Mount\IMountPoint[]
96
-	 * @since 20.0.0
97
-	 */
98
-	public function getRootMounts(): array;
92
+    /**
93
+     * Get all root mountpoints
94
+     *
95
+     * @return \OCP\Files\Mount\IMountPoint[]
96
+     * @since 20.0.0
97
+     */
98
+    public function getRootMounts(): array;
99 99
 }
Please login to merge, or discard this patch.
lib/public/Files/Lock/OwnerLockedException.php 1 patch
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -32,22 +32,22 @@
 block discarded – undo
32 32
  * @since 24.0.0
33 33
  */
34 34
 class OwnerLockedException extends LockedException {
35
-	private ILock $lock;
35
+    private ILock $lock;
36 36
 
37
-	/**
38
-	 * @since 24.0.0
39
-	 */
40
-	public function __construct(ILock $lock) {
41
-		$this->lock = $lock;
42
-		$path = '';
43
-		$readablePath = '';
44
-		parent::__construct($path, null, $lock->getOwner(), $readablePath);
45
-	}
37
+    /**
38
+     * @since 24.0.0
39
+     */
40
+    public function __construct(ILock $lock) {
41
+        $this->lock = $lock;
42
+        $path = '';
43
+        $readablePath = '';
44
+        parent::__construct($path, null, $lock->getOwner(), $readablePath);
45
+    }
46 46
 
47
-	/**
48
-	 * @since 24.0.0
49
-	 */
50
-	public function getLock(): ILock {
51
-		return $this->lock;
52
-	}
47
+    /**
48
+     * @since 24.0.0
49
+     */
50
+    public function getLock(): ILock {
51
+        return $this->lock;
52
+    }
53 53
 }
Please login to merge, or discard this patch.
lib/public/Files/Lock/LockContext.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -94,6 +94,6 @@
 block discarded – undo
94 94
 		if ($this->type === ILock::TYPE_TOKEN) {
95 95
 			$typeString = 'ILock::TYPE_TOKEN';
96 96
 		}
97
-		return "$typeString  $this->owner " . $this->getNode()->getId();
97
+		return "$typeString  $this->owner ".$this->getNode()->getId();
98 98
 	}
99 99
 }
Please login to merge, or discard this patch.
Indentation   +54 added lines, -54 removed lines patch added patch discarded remove patch
@@ -20,63 +20,63 @@
 block discarded – undo
20 20
  * @since 24.0.0
21 21
  */
22 22
 final class LockContext {
23
-	private Node $node;
24
-	private int $type;
25
-	private string $owner;
23
+    private Node $node;
24
+    private int $type;
25
+    private string $owner;
26 26
 
27
-	/**
28
-	 * @param Node $node Node that is owned by the lock
29
-	 * @param int $type Type of the lock owner
30
-	 * @param string $owner Unique identifier for the lock owner based on the type
31
-	 * @since 24.0.0
32
-	 */
33
-	public function __construct(
34
-		Node $node,
35
-		int $type,
36
-		string $owner,
37
-	) {
38
-		$this->node = $node;
39
-		$this->type = $type;
40
-		$this->owner = $owner;
41
-	}
27
+    /**
28
+     * @param Node $node Node that is owned by the lock
29
+     * @param int $type Type of the lock owner
30
+     * @param string $owner Unique identifier for the lock owner based on the type
31
+     * @since 24.0.0
32
+     */
33
+    public function __construct(
34
+        Node $node,
35
+        int $type,
36
+        string $owner,
37
+    ) {
38
+        $this->node = $node;
39
+        $this->type = $type;
40
+        $this->owner = $owner;
41
+    }
42 42
 
43
-	/**
44
-	 * @since 24.0.0
45
-	 */
46
-	public function getNode(): Node {
47
-		return $this->node;
48
-	}
43
+    /**
44
+     * @since 24.0.0
45
+     */
46
+    public function getNode(): Node {
47
+        return $this->node;
48
+    }
49 49
 
50
-	/**
51
-	 * @return int
52
-	 * @since 24.0.0
53
-	 */
54
-	public function getType(): int {
55
-		return $this->type;
56
-	}
50
+    /**
51
+     * @return int
52
+     * @since 24.0.0
53
+     */
54
+    public function getType(): int {
55
+        return $this->type;
56
+    }
57 57
 
58
-	/**
59
-	 * @return string user id / app id / lock token depending on the type
60
-	 * @since 24.0.0
61
-	 */
62
-	public function getOwner(): string {
63
-		return $this->owner;
64
-	}
58
+    /**
59
+     * @return string user id / app id / lock token depending on the type
60
+     * @since 24.0.0
61
+     */
62
+    public function getOwner(): string {
63
+        return $this->owner;
64
+    }
65 65
 
66
-	/**
67
-	 * @since 24.0.0
68
-	 */
69
-	public function __toString(): string {
70
-		$typeString = 'unknown';
71
-		if ($this->type === ILock::TYPE_USER) {
72
-			$typeString = 'ILock::TYPE_USER';
73
-		}
74
-		if ($this->type === ILock::TYPE_APP) {
75
-			$typeString = 'ILock::TYPE_APP';
76
-		}
77
-		if ($this->type === ILock::TYPE_TOKEN) {
78
-			$typeString = 'ILock::TYPE_TOKEN';
79
-		}
80
-		return "$typeString  $this->owner " . $this->getNode()->getId();
81
-	}
66
+    /**
67
+     * @since 24.0.0
68
+     */
69
+    public function __toString(): string {
70
+        $typeString = 'unknown';
71
+        if ($this->type === ILock::TYPE_USER) {
72
+            $typeString = 'ILock::TYPE_USER';
73
+        }
74
+        if ($this->type === ILock::TYPE_APP) {
75
+            $typeString = 'ILock::TYPE_APP';
76
+        }
77
+        if ($this->type === ILock::TYPE_TOKEN) {
78
+            $typeString = 'ILock::TYPE_TOKEN';
79
+        }
80
+        return "$typeString  $this->owner " . $this->getNode()->getId();
81
+    }
82 82
 }
Please login to merge, or discard this patch.
apps/files_external/lib/Migration/Version1011Date20200630192246.php 1 patch
Indentation   +114 added lines, -114 removed lines patch added patch discarded remove patch
@@ -34,122 +34,122 @@
 block discarded – undo
34 34
 use OCP\Migration\SimpleMigrationStep;
35 35
 
36 36
 class Version1011Date20200630192246 extends SimpleMigrationStep {
37
-	/**
38
-	 * @param IOutput $output
39
-	 * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
40
-	 * @param array $options
41
-	 * @return null|ISchemaWrapper
42
-	 */
43
-	public function changeSchema(IOutput $output, Closure $schemaClosure, array $options) {
44
-		/** @var ISchemaWrapper $schema */
45
-		$schema = $schemaClosure();
37
+    /**
38
+     * @param IOutput $output
39
+     * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
40
+     * @param array $options
41
+     * @return null|ISchemaWrapper
42
+     */
43
+    public function changeSchema(IOutput $output, Closure $schemaClosure, array $options) {
44
+        /** @var ISchemaWrapper $schema */
45
+        $schema = $schemaClosure();
46 46
 
47
-		if (!$schema->hasTable('external_mounts')) {
48
-			$table = $schema->createTable('external_mounts');
49
-			$table->addColumn('mount_id', Types::BIGINT, [
50
-				'autoincrement' => true,
51
-				'notnull' => true,
52
-				'length' => 6,
53
-			]);
54
-			$table->addColumn('mount_point', Types::STRING, [
55
-				'notnull' => true,
56
-				'length' => 128,
57
-			]);
58
-			$table->addColumn('storage_backend', Types::STRING, [
59
-				'notnull' => true,
60
-				'length' => 64,
61
-			]);
62
-			$table->addColumn('auth_backend', Types::STRING, [
63
-				'notnull' => true,
64
-				'length' => 64,
65
-			]);
66
-			$table->addColumn('priority', Types::INTEGER, [
67
-				'notnull' => true,
68
-				'length' => 4,
69
-				'default' => 100,
70
-			]);
71
-			$table->addColumn('type', Types::INTEGER, [
72
-				'notnull' => true,
73
-				'length' => 4,
74
-			]);
75
-			$table->setPrimaryKey(['mount_id']);
76
-		}
47
+        if (!$schema->hasTable('external_mounts')) {
48
+            $table = $schema->createTable('external_mounts');
49
+            $table->addColumn('mount_id', Types::BIGINT, [
50
+                'autoincrement' => true,
51
+                'notnull' => true,
52
+                'length' => 6,
53
+            ]);
54
+            $table->addColumn('mount_point', Types::STRING, [
55
+                'notnull' => true,
56
+                'length' => 128,
57
+            ]);
58
+            $table->addColumn('storage_backend', Types::STRING, [
59
+                'notnull' => true,
60
+                'length' => 64,
61
+            ]);
62
+            $table->addColumn('auth_backend', Types::STRING, [
63
+                'notnull' => true,
64
+                'length' => 64,
65
+            ]);
66
+            $table->addColumn('priority', Types::INTEGER, [
67
+                'notnull' => true,
68
+                'length' => 4,
69
+                'default' => 100,
70
+            ]);
71
+            $table->addColumn('type', Types::INTEGER, [
72
+                'notnull' => true,
73
+                'length' => 4,
74
+            ]);
75
+            $table->setPrimaryKey(['mount_id']);
76
+        }
77 77
 
78
-		if (!$schema->hasTable('external_applicable')) {
79
-			$table = $schema->createTable('external_applicable');
80
-			$table->addColumn('applicable_id', Types::BIGINT, [
81
-				'autoincrement' => true,
82
-				'notnull' => true,
83
-				'length' => 6,
84
-			]);
85
-			$table->addColumn('mount_id', Types::BIGINT, [
86
-				'notnull' => true,
87
-				'length' => 6,
88
-			]);
89
-			$table->addColumn('type', Types::INTEGER, [
90
-				'notnull' => true,
91
-				'length' => 4,
92
-			]);
93
-			$table->addColumn('value', Types::STRING, [
94
-				'notnull' => false,
95
-				'length' => 64,
96
-			]);
97
-			$table->setPrimaryKey(['applicable_id']);
98
-			$table->addIndex(['mount_id'], 'applicable_mount');
99
-			$table->addUniqueIndex(['type', 'value', 'mount_id'], 'applicable_type_value_mount');
100
-		}
78
+        if (!$schema->hasTable('external_applicable')) {
79
+            $table = $schema->createTable('external_applicable');
80
+            $table->addColumn('applicable_id', Types::BIGINT, [
81
+                'autoincrement' => true,
82
+                'notnull' => true,
83
+                'length' => 6,
84
+            ]);
85
+            $table->addColumn('mount_id', Types::BIGINT, [
86
+                'notnull' => true,
87
+                'length' => 6,
88
+            ]);
89
+            $table->addColumn('type', Types::INTEGER, [
90
+                'notnull' => true,
91
+                'length' => 4,
92
+            ]);
93
+            $table->addColumn('value', Types::STRING, [
94
+                'notnull' => false,
95
+                'length' => 64,
96
+            ]);
97
+            $table->setPrimaryKey(['applicable_id']);
98
+            $table->addIndex(['mount_id'], 'applicable_mount');
99
+            $table->addUniqueIndex(['type', 'value', 'mount_id'], 'applicable_type_value_mount');
100
+        }
101 101
 
102
-		if (!$schema->hasTable('external_config')) {
103
-			$table = $schema->createTable('external_config');
104
-			$table->addColumn('config_id', Types::BIGINT, [
105
-				'autoincrement' => true,
106
-				'notnull' => true,
107
-				'length' => 6,
108
-			]);
109
-			$table->addColumn('mount_id', Types::BIGINT, [
110
-				'notnull' => true,
111
-				'length' => 6,
112
-			]);
113
-			$table->addColumn('key', Types::STRING, [
114
-				'notnull' => true,
115
-				'length' => 64,
116
-			]);
117
-			$table->addColumn('value', Types::STRING, [
118
-				'notnull' => false,
119
-				'length' => 4000,
120
-			]);
121
-			$table->setPrimaryKey(['config_id']);
122
-			$table->addUniqueIndex(['mount_id', 'key'], 'config_mount_key');
123
-		} else {
124
-			$table = $schema->getTable('external_config');
125
-			$table->changeColumn('value', [
126
-				'notnull' => false,
127
-				'length' => 4000,
128
-			]);
129
-		}
102
+        if (!$schema->hasTable('external_config')) {
103
+            $table = $schema->createTable('external_config');
104
+            $table->addColumn('config_id', Types::BIGINT, [
105
+                'autoincrement' => true,
106
+                'notnull' => true,
107
+                'length' => 6,
108
+            ]);
109
+            $table->addColumn('mount_id', Types::BIGINT, [
110
+                'notnull' => true,
111
+                'length' => 6,
112
+            ]);
113
+            $table->addColumn('key', Types::STRING, [
114
+                'notnull' => true,
115
+                'length' => 64,
116
+            ]);
117
+            $table->addColumn('value', Types::STRING, [
118
+                'notnull' => false,
119
+                'length' => 4000,
120
+            ]);
121
+            $table->setPrimaryKey(['config_id']);
122
+            $table->addUniqueIndex(['mount_id', 'key'], 'config_mount_key');
123
+        } else {
124
+            $table = $schema->getTable('external_config');
125
+            $table->changeColumn('value', [
126
+                'notnull' => false,
127
+                'length' => 4000,
128
+            ]);
129
+        }
130 130
 
131
-		if (!$schema->hasTable('external_options')) {
132
-			$table = $schema->createTable('external_options');
133
-			$table->addColumn('option_id', Types::BIGINT, [
134
-				'autoincrement' => true,
135
-				'notnull' => true,
136
-				'length' => 6,
137
-			]);
138
-			$table->addColumn('mount_id', Types::BIGINT, [
139
-				'notnull' => true,
140
-				'length' => 6,
141
-			]);
142
-			$table->addColumn('key', Types::STRING, [
143
-				'notnull' => true,
144
-				'length' => 64,
145
-			]);
146
-			$table->addColumn('value', Types::STRING, [
147
-				'notnull' => true,
148
-				'length' => 256,
149
-			]);
150
-			$table->setPrimaryKey(['option_id']);
151
-			$table->addUniqueIndex(['mount_id', 'key'], 'option_mount_key');
152
-		}
153
-		return $schema;
154
-	}
131
+        if (!$schema->hasTable('external_options')) {
132
+            $table = $schema->createTable('external_options');
133
+            $table->addColumn('option_id', Types::BIGINT, [
134
+                'autoincrement' => true,
135
+                'notnull' => true,
136
+                'length' => 6,
137
+            ]);
138
+            $table->addColumn('mount_id', Types::BIGINT, [
139
+                'notnull' => true,
140
+                'length' => 6,
141
+            ]);
142
+            $table->addColumn('key', Types::STRING, [
143
+                'notnull' => true,
144
+                'length' => 64,
145
+            ]);
146
+            $table->addColumn('value', Types::STRING, [
147
+                'notnull' => true,
148
+                'length' => 256,
149
+            ]);
150
+            $table->setPrimaryKey(['option_id']);
151
+            $table->addUniqueIndex(['mount_id', 'key'], 'option_mount_key');
152
+        }
153
+        return $schema;
154
+    }
155 155
 }
Please login to merge, or discard this patch.
apps/files_sharing/lib/Migration/Version24000Date20220208195521.php 1 patch
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -33,19 +33,19 @@
 block discarded – undo
33 33
 
34 34
 class Version24000Date20220208195521 extends SimpleMigrationStep {
35 35
 
36
-	/**
37
-	 * @param IOutput $output
38
-	 * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
39
-	 * @param array $options
40
-	 * @return null|ISchemaWrapper
41
-	 */
42
-	public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
43
-		$schema = $schemaClosure();
44
-		$table = $schema->getTable('share');
45
-		$table->addColumn('password_expiration_time', Types::DATETIME, [
46
-			'notnull' => false,
47
-		]);
48
-		return $schema;
49
-	}
36
+    /**
37
+     * @param IOutput $output
38
+     * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
39
+     * @param array $options
40
+     * @return null|ISchemaWrapper
41
+     */
42
+    public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
43
+        $schema = $schemaClosure();
44
+        $table = $schema->getTable('share');
45
+        $table->addColumn('password_expiration_time', Types::DATETIME, [
46
+            'notnull' => false,
47
+        ]);
48
+        return $schema;
49
+    }
50 50
 
51 51
 }
Please login to merge, or discard this patch.