Passed
Push — master ( 0571fd...48a8f0 )
by Blizzz
19:19 queued 08:57
created
core/Command/Db/Migrations/StatusCommand.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -59,10 +59,10 @@
 block discarded – undo
59 59
 			if (is_array($value)) {
60 60
 				$output->writeln("    <comment>>></comment> $key:");
61 61
 				foreach ($value as $subKey => $subValue) {
62
-					$output->writeln("        <comment>>></comment> $subKey: " . str_repeat(' ', 46 - strlen($subKey)) . $subValue);
62
+					$output->writeln("        <comment>>></comment> $subKey: ".str_repeat(' ', 46 - strlen($subKey)).$subValue);
63 63
 				}
64 64
 			} else {
65
-				$output->writeln("    <comment>>></comment> $key: " . str_repeat(' ', 50 - strlen($key)) . $value);
65
+				$output->writeln("    <comment>>></comment> $key: ".str_repeat(' ', 50 - strlen($key)).$value);
66 66
 			}
67 67
 		}
68 68
 	}
Please login to merge, or discard this patch.
Indentation   +109 added lines, -109 removed lines patch added patch discarded remove patch
@@ -35,113 +35,113 @@
 block discarded – undo
35 35
 
36 36
 class StatusCommand extends Command implements CompletionAwareInterface {
37 37
 
38
-	/** @var IDBConnection */
39
-	private $connection;
40
-
41
-	/**
42
-	 * @param IDBConnection $connection
43
-	 */
44
-	public function __construct(IDBConnection $connection) {
45
-		$this->connection = $connection;
46
-		parent::__construct();
47
-	}
48
-
49
-	protected function configure() {
50
-		$this
51
-			->setName('migrations:status')
52
-			->setDescription('View the status of a set of migrations.')
53
-			->addArgument('app', InputArgument::REQUIRED, 'Name of the app this migration command shall work on');
54
-	}
55
-
56
-	public function execute(InputInterface $input, OutputInterface $output) {
57
-		$appName = $input->getArgument('app');
58
-		$ms = new MigrationService($appName, $this->connection, new ConsoleOutput($output));
59
-
60
-		$infos = $this->getMigrationsInfos($ms);
61
-		foreach ($infos as $key => $value) {
62
-			if (is_array($value)) {
63
-				$output->writeln("    <comment>>></comment> $key:");
64
-				foreach ($value as $subKey => $subValue) {
65
-					$output->writeln("        <comment>>></comment> $subKey: " . str_repeat(' ', 46 - strlen($subKey)) . $subValue);
66
-				}
67
-			} else {
68
-				$output->writeln("    <comment>>></comment> $key: " . str_repeat(' ', 50 - strlen($key)) . $value);
69
-			}
70
-		}
71
-	}
72
-
73
-	/**
74
-	 * @param string $optionName
75
-	 * @param CompletionContext $context
76
-	 * @return string[]
77
-	 */
78
-	public function completeOptionValues($optionName, CompletionContext $context) {
79
-		return [];
80
-	}
81
-
82
-	/**
83
-	 * @param string $argumentName
84
-	 * @param CompletionContext $context
85
-	 * @return string[]
86
-	 */
87
-	public function completeArgumentValues($argumentName, CompletionContext $context) {
88
-		if ($argumentName === 'app') {
89
-			$allApps = \OC_App::getAllApps();
90
-			return array_diff($allApps, \OC_App::getEnabledApps(true, true));
91
-		}
92
-		return [];
93
-	}
94
-
95
-	/**
96
-	 * @param MigrationService $ms
97
-	 * @return array associative array of human readable info name as key and the actual information as value
98
-	 */
99
-	public function getMigrationsInfos(MigrationService $ms) {
100
-		$executedMigrations = $ms->getMigratedVersions();
101
-		$availableMigrations = $ms->getAvailableVersions();
102
-		$executedUnavailableMigrations = array_diff($executedMigrations, array_keys($availableMigrations));
103
-
104
-		$numExecutedUnavailableMigrations = count($executedUnavailableMigrations);
105
-		$numNewMigrations = count(array_diff(array_keys($availableMigrations), $executedMigrations));
106
-		$pending = $ms->describeMigrationStep('lastest');
107
-
108
-		$infos = [
109
-			'App'								=> $ms->getApp(),
110
-			'Version Table Name'				=> $ms->getMigrationsTableName(),
111
-			'Migrations Namespace'				=> $ms->getMigrationsNamespace(),
112
-			'Migrations Directory'				=> $ms->getMigrationsDirectory(),
113
-			'Previous Version'					=> $this->getFormattedVersionAlias($ms, 'prev'),
114
-			'Current Version'					=> $this->getFormattedVersionAlias($ms, 'current'),
115
-			'Next Version'						=> $this->getFormattedVersionAlias($ms, 'next'),
116
-			'Latest Version'					=> $this->getFormattedVersionAlias($ms, 'latest'),
117
-			'Executed Migrations'				=> count($executedMigrations),
118
-			'Executed Unavailable Migrations'	=> $numExecutedUnavailableMigrations,
119
-			'Available Migrations'				=> count($availableMigrations),
120
-			'New Migrations'					=> $numNewMigrations,
121
-			'Pending Migrations'				=> count($pending) ? $pending : 'None'
122
-		];
123
-
124
-		return $infos;
125
-	}
126
-
127
-	/**
128
-	 * @param MigrationService $migrationService
129
-	 * @param string $alias
130
-	 * @return mixed|null|string
131
-	 */
132
-	private function getFormattedVersionAlias(MigrationService $migrationService, $alias) {
133
-		$migration = $migrationService->getMigration($alias);
134
-		//No version found
135
-		if ($migration === null) {
136
-			if ($alias === 'next') {
137
-				return 'Already at latest migration step';
138
-			}
139
-
140
-			if ($alias === 'prev') {
141
-				return 'Already at first migration step';
142
-			}
143
-		}
144
-
145
-		return $migration;
146
-	}
38
+    /** @var IDBConnection */
39
+    private $connection;
40
+
41
+    /**
42
+     * @param IDBConnection $connection
43
+     */
44
+    public function __construct(IDBConnection $connection) {
45
+        $this->connection = $connection;
46
+        parent::__construct();
47
+    }
48
+
49
+    protected function configure() {
50
+        $this
51
+            ->setName('migrations:status')
52
+            ->setDescription('View the status of a set of migrations.')
53
+            ->addArgument('app', InputArgument::REQUIRED, 'Name of the app this migration command shall work on');
54
+    }
55
+
56
+    public function execute(InputInterface $input, OutputInterface $output) {
57
+        $appName = $input->getArgument('app');
58
+        $ms = new MigrationService($appName, $this->connection, new ConsoleOutput($output));
59
+
60
+        $infos = $this->getMigrationsInfos($ms);
61
+        foreach ($infos as $key => $value) {
62
+            if (is_array($value)) {
63
+                $output->writeln("    <comment>>></comment> $key:");
64
+                foreach ($value as $subKey => $subValue) {
65
+                    $output->writeln("        <comment>>></comment> $subKey: " . str_repeat(' ', 46 - strlen($subKey)) . $subValue);
66
+                }
67
+            } else {
68
+                $output->writeln("    <comment>>></comment> $key: " . str_repeat(' ', 50 - strlen($key)) . $value);
69
+            }
70
+        }
71
+    }
72
+
73
+    /**
74
+     * @param string $optionName
75
+     * @param CompletionContext $context
76
+     * @return string[]
77
+     */
78
+    public function completeOptionValues($optionName, CompletionContext $context) {
79
+        return [];
80
+    }
81
+
82
+    /**
83
+     * @param string $argumentName
84
+     * @param CompletionContext $context
85
+     * @return string[]
86
+     */
87
+    public function completeArgumentValues($argumentName, CompletionContext $context) {
88
+        if ($argumentName === 'app') {
89
+            $allApps = \OC_App::getAllApps();
90
+            return array_diff($allApps, \OC_App::getEnabledApps(true, true));
91
+        }
92
+        return [];
93
+    }
94
+
95
+    /**
96
+     * @param MigrationService $ms
97
+     * @return array associative array of human readable info name as key and the actual information as value
98
+     */
99
+    public function getMigrationsInfos(MigrationService $ms) {
100
+        $executedMigrations = $ms->getMigratedVersions();
101
+        $availableMigrations = $ms->getAvailableVersions();
102
+        $executedUnavailableMigrations = array_diff($executedMigrations, array_keys($availableMigrations));
103
+
104
+        $numExecutedUnavailableMigrations = count($executedUnavailableMigrations);
105
+        $numNewMigrations = count(array_diff(array_keys($availableMigrations), $executedMigrations));
106
+        $pending = $ms->describeMigrationStep('lastest');
107
+
108
+        $infos = [
109
+            'App'								=> $ms->getApp(),
110
+            'Version Table Name'				=> $ms->getMigrationsTableName(),
111
+            'Migrations Namespace'				=> $ms->getMigrationsNamespace(),
112
+            'Migrations Directory'				=> $ms->getMigrationsDirectory(),
113
+            'Previous Version'					=> $this->getFormattedVersionAlias($ms, 'prev'),
114
+            'Current Version'					=> $this->getFormattedVersionAlias($ms, 'current'),
115
+            'Next Version'						=> $this->getFormattedVersionAlias($ms, 'next'),
116
+            'Latest Version'					=> $this->getFormattedVersionAlias($ms, 'latest'),
117
+            'Executed Migrations'				=> count($executedMigrations),
118
+            'Executed Unavailable Migrations'	=> $numExecutedUnavailableMigrations,
119
+            'Available Migrations'				=> count($availableMigrations),
120
+            'New Migrations'					=> $numNewMigrations,
121
+            'Pending Migrations'				=> count($pending) ? $pending : 'None'
122
+        ];
123
+
124
+        return $infos;
125
+    }
126
+
127
+    /**
128
+     * @param MigrationService $migrationService
129
+     * @param string $alias
130
+     * @return mixed|null|string
131
+     */
132
+    private function getFormattedVersionAlias(MigrationService $migrationService, $alias) {
133
+        $migration = $migrationService->getMigration($alias);
134
+        //No version found
135
+        if ($migration === null) {
136
+            if ($alias === 'next') {
137
+                return 'Already at latest migration step';
138
+            }
139
+
140
+            if ($alias === 'prev') {
141
+                return 'Already at first migration step';
142
+            }
143
+        }
144
+
145
+        return $migration;
146
+    }
147 147
 }
Please login to merge, or discard this patch.
core/Migrations/Version14000Date20180404140050.php 1 patch
Indentation   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -34,55 +34,55 @@
 block discarded – undo
34 34
  */
35 35
 class Version14000Date20180404140050 extends SimpleMigrationStep {
36 36
 
37
-	/** @var IDBConnection */
38
-	private $connection;
37
+    /** @var IDBConnection */
38
+    private $connection;
39 39
 
40
-	public function __construct(IDBConnection $connection) {
41
-		$this->connection = $connection;
42
-	}
40
+    public function __construct(IDBConnection $connection) {
41
+        $this->connection = $connection;
42
+    }
43 43
 
44
-	public function name(): string {
45
-		return 'Add lowercase user id column to users table';
46
-	}
44
+    public function name(): string {
45
+        return 'Add lowercase user id column to users table';
46
+    }
47 47
 
48
-	public function description(): string {
49
-		return 'Adds "uid_lower" column to the users table and fills the column to allow indexed case-insensitive searches';
50
-	}
48
+    public function description(): string {
49
+        return 'Adds "uid_lower" column to the users table and fills the column to allow indexed case-insensitive searches';
50
+    }
51 51
 
52
-	/**
53
-	 * @param IOutput $output
54
-	 * @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
55
-	 * @param array $options
56
-	 * @return null|ISchemaWrapper
57
-	 */
58
-	public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options) {
59
-		/** @var ISchemaWrapper $schema */
60
-		$schema = $schemaClosure();
52
+    /**
53
+     * @param IOutput $output
54
+     * @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
55
+     * @param array $options
56
+     * @return null|ISchemaWrapper
57
+     */
58
+    public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options) {
59
+        /** @var ISchemaWrapper $schema */
60
+        $schema = $schemaClosure();
61 61
 
62
-		$table = $schema->getTable('users');
62
+        $table = $schema->getTable('users');
63 63
 
64
-		$table->addColumn('uid_lower', 'string', [
65
-			'notnull' => false,
66
-			'length' => 64,
67
-			'default' => '',
68
-		]);
69
-		$table->addIndex(['uid_lower'], 'user_uid_lower');
64
+        $table->addColumn('uid_lower', 'string', [
65
+            'notnull' => false,
66
+            'length' => 64,
67
+            'default' => '',
68
+        ]);
69
+        $table->addIndex(['uid_lower'], 'user_uid_lower');
70 70
 
71
-		return $schema;
72
-	}
71
+        return $schema;
72
+    }
73 73
 
74
-	/**
75
-	 * @param IOutput $output
76
-	 * @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
77
-	 * @param array $options
78
-	 *
79
-	 * @suppress SqlInjectionChecker
80
-	 */
81
-	public function postSchemaChange(IOutput $output, \Closure $schemaClosure, array $options) {
82
-		$qb = $this->connection->getQueryBuilder();
74
+    /**
75
+     * @param IOutput $output
76
+     * @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
77
+     * @param array $options
78
+     *
79
+     * @suppress SqlInjectionChecker
80
+     */
81
+    public function postSchemaChange(IOutput $output, \Closure $schemaClosure, array $options) {
82
+        $qb = $this->connection->getQueryBuilder();
83 83
 
84
-		$qb->update('users')
85
-			->set('uid_lower', $qb->func()->lower('uid'));
86
-		$qb->execute();
87
-	}
84
+        $qb->update('users')
85
+            ->set('uid_lower', $qb->func()->lower('uid'));
86
+        $qb->execute();
87
+    }
88 88
 }
Please login to merge, or discard this patch.
core/Migrations/Version14000Date20180129121024.php 1 patch
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -30,30 +30,30 @@
 block discarded – undo
30 30
  * Delete the admin|personal sections and settings tables
31 31
  */
32 32
 class Version14000Date20180129121024 extends SimpleMigrationStep {
33
-	public function name(): string {
34
-		return 'Drop obsolete settings tables';
35
-	}
33
+    public function name(): string {
34
+        return 'Drop obsolete settings tables';
35
+    }
36 36
 
37
-	public function description(): string {
38
-		return 'Drops the following obsolete tables: "admin_sections", "admin_settings", "personal_sections" and "personal_settings"';
39
-	}
37
+    public function description(): string {
38
+        return 'Drops the following obsolete tables: "admin_sections", "admin_settings", "personal_sections" and "personal_settings"';
39
+    }
40 40
 
41
-	/**
42
-	 * @param IOutput $output
43
-	 * @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
44
-	 * @param array $options
45
-	 * @return null|ISchemaWrapper
46
-	 * @since 13.0.0
47
-	 */
48
-	public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options) {
49
-		/** @var ISchemaWrapper $schema */
50
-		$schema = $schemaClosure();
41
+    /**
42
+     * @param IOutput $output
43
+     * @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
44
+     * @param array $options
45
+     * @return null|ISchemaWrapper
46
+     * @since 13.0.0
47
+     */
48
+    public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options) {
49
+        /** @var ISchemaWrapper $schema */
50
+        $schema = $schemaClosure();
51 51
 
52
-		$schema->dropTable('admin_sections');
53
-		$schema->dropTable('admin_settings');
54
-		$schema->dropTable('personal_sections');
55
-		$schema->dropTable('personal_settings');
52
+        $schema->dropTable('admin_sections');
53
+        $schema->dropTable('admin_settings');
54
+        $schema->dropTable('personal_sections');
55
+        $schema->dropTable('personal_settings');
56 56
 
57
-		return $schema;
58
-	}
57
+        return $schema;
58
+    }
59 59
 }
Please login to merge, or discard this patch.
apps/dav/lib/Direct/Server.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -25,9 +25,9 @@
 block discarded – undo
25 25
 namespace OCA\DAV\Direct;
26 26
 
27 27
 class Server extends \Sabre\DAV\Server {
28
-	public function __construct($treeOrNode = null) {
29
-		parent::__construct($treeOrNode);
30
-		self::$exposeVersion = false;
31
-		$this->enablePropfindDepthInfinityf = false;
32
-	}
28
+    public function __construct($treeOrNode = null) {
29
+        parent::__construct($treeOrNode);
30
+        self::$exposeVersion = false;
31
+        $this->enablePropfindDepthInfinityf = false;
32
+    }
33 33
 }
Please login to merge, or discard this patch.
apps/dav/lib/Db/Direct.php 1 patch
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -37,22 +37,22 @@
 block discarded – undo
37 37
  * @method void setExpiration(int $expiration)
38 38
  */
39 39
 class Direct extends Entity {
40
-	/** @var string */
41
-	protected $userId;
40
+    /** @var string */
41
+    protected $userId;
42 42
 
43
-	/** @var int */
44
-	protected $fileId;
43
+    /** @var int */
44
+    protected $fileId;
45 45
 
46
-	/** @var string */
47
-	protected $token;
46
+    /** @var string */
47
+    protected $token;
48 48
 
49
-	/** @var int */
50
-	protected $expiration;
49
+    /** @var int */
50
+    protected $expiration;
51 51
 
52
-	public function __construct() {
53
-		$this->addType('userId', 'string');
54
-		$this->addType('fileId', 'int');
55
-		$this->addType('token', 'string');
56
-		$this->addType('expiration', 'int');
57
-	}
52
+    public function __construct() {
53
+        $this->addType('userId', 'string');
54
+        $this->addType('fileId', 'int');
55
+        $this->addType('token', 'string');
56
+        $this->addType('expiration', 'int');
57
+    }
58 58
 }
Please login to merge, or discard this patch.
apps/dav/lib/Migration/Version1005Date20180413093149.php 2 patches
Indentation   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -31,50 +31,50 @@
 block discarded – undo
31 31
 
32 32
 class Version1005Date20180413093149 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) {
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 41
 
42
-		/** @var ISchemaWrapper $schema */
43
-		$schema = $schemaClosure();
42
+        /** @var ISchemaWrapper $schema */
43
+        $schema = $schemaClosure();
44 44
 
45
-		if (!$schema->hasTable('directlink')) {
46
-			$table = $schema->createTable('directlink');
45
+        if (!$schema->hasTable('directlink')) {
46
+            $table = $schema->createTable('directlink');
47 47
 
48
-			$table->addColumn('id',Type::BIGINT, [
49
-				'autoincrement' => true,
50
-				'notnull' => true,
51
-				'length' => 11,
52
-				'unsigned' => true,
53
-			]);
54
-			$table->addColumn('user_id', Type::STRING, [
55
-				'notnull' => false,
56
-				'length' => 64,
57
-			]);
58
-			$table->addColumn('file_id', Type::BIGINT, [
59
-				'notnull' => true,
60
-				'length' => 11,
61
-				'unsigned' => true,
62
-			]);
63
-			$table->addColumn('token', Type::STRING, [
64
-				'notnull' => false,
65
-				'length' => 60,
66
-			]);
67
-			$table->addColumn('expiration', Type::BIGINT, [
68
-				'notnull' => true,
69
-				'length' => 11,
70
-				'unsigned' => true,
71
-			]);
48
+            $table->addColumn('id',Type::BIGINT, [
49
+                'autoincrement' => true,
50
+                'notnull' => true,
51
+                'length' => 11,
52
+                'unsigned' => true,
53
+            ]);
54
+            $table->addColumn('user_id', Type::STRING, [
55
+                'notnull' => false,
56
+                'length' => 64,
57
+            ]);
58
+            $table->addColumn('file_id', Type::BIGINT, [
59
+                'notnull' => true,
60
+                'length' => 11,
61
+                'unsigned' => true,
62
+            ]);
63
+            $table->addColumn('token', Type::STRING, [
64
+                'notnull' => false,
65
+                'length' => 60,
66
+            ]);
67
+            $table->addColumn('expiration', Type::BIGINT, [
68
+                'notnull' => true,
69
+                'length' => 11,
70
+                'unsigned' => true,
71
+            ]);
72 72
 
73
-			$table->setPrimaryKey(['id'], 'directlink_id_idx');
74
-			$table->addIndex(['token'], 'directlink_token_idx');
75
-			$table->addIndex(['expiration'], 'directlink_expiration_idx');
73
+            $table->setPrimaryKey(['id'], 'directlink_id_idx');
74
+            $table->addIndex(['token'], 'directlink_token_idx');
75
+            $table->addIndex(['expiration'], 'directlink_expiration_idx');
76 76
 
77
-			return $schema;
78
-		}
79
-	}
77
+            return $schema;
78
+        }
79
+    }
80 80
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@
 block discarded – undo
45 45
 		if (!$schema->hasTable('directlink')) {
46 46
 			$table = $schema->createTable('directlink');
47 47
 
48
-			$table->addColumn('id',Type::BIGINT, [
48
+			$table->addColumn('id', Type::BIGINT, [
49 49
 				'autoincrement' => true,
50 50
 				'notnull' => true,
51 51
 				'length' => 11,
Please login to merge, or discard this patch.
apps/files_external/lib/Service/LegacyStoragesService.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 	) {
59 59
 		$backend = $this->backendService->getBackend($storageOptions['backend']);
60 60
 		if (!$backend) {
61
-			throw new \UnexpectedValueException('Invalid backend ' . $storageOptions['backend']);
61
+			throw new \UnexpectedValueException('Invalid backend '.$storageOptions['backend']);
62 62
 		}
63 63
 		$storageConfig->setBackend($backend);
64 64
 		if (isset($storageOptions['authMechanism']) && $storageOptions['authMechanism'] !== 'builtin::builtin') {
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 			$storageOptions['authMechanism'] = 'null'; // to make error handling easier
69 69
 		}
70 70
 		if (!$authMechanism) {
71
-			throw new \UnexpectedValueException('Invalid authentication mechanism ' . $storageOptions['authMechanism']);
71
+			throw new \UnexpectedValueException('Invalid authentication mechanism '.$storageOptions['authMechanism']);
72 72
 		}
73 73
 		$storageConfig->setAuthMechanism($authMechanism);
74 74
 		$storageConfig->setBackendOptions($storageOptions['options']);
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 					$parts = explode('/', ltrim($rootMountPath, '/'), 3);
141 141
 					if (count($parts) < 3) {
142 142
 						// something went wrong, skip
143
-						\OC::$server->getLogger()->error('Could not parse mount point "' . $rootMountPath . '"', ['app' => 'files_external']);
143
+						\OC::$server->getLogger()->error('Could not parse mount point "'.$rootMountPath.'"', ['app' => 'files_external']);
144 144
 						continue;
145 145
 					}
146 146
 					$relativeMountPath = rtrim($parts[2], '/');
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
 						$storageOptions['authMechanism'] = null; // ensure config hash works
155 155
 					}
156 156
 					if (isset($storageOptions['id'])) {
157
-						$configId = (int)$storageOptions['id'];
157
+						$configId = (int) $storageOptions['id'];
158 158
 						if (isset($storages[$configId])) {
159 159
 							$currentStorage = $storages[$configId];
160 160
 						}
Please login to merge, or discard this patch.
Indentation   +171 added lines, -171 removed lines patch added patch discarded remove patch
@@ -33,179 +33,179 @@
 block discarded – undo
33 33
  * Read mount config from legacy mount.json
34 34
  */
35 35
 abstract class LegacyStoragesService {
36
-	/** @var BackendService */
37
-	protected $backendService;
36
+    /** @var BackendService */
37
+    protected $backendService;
38 38
 
39
-	/**
40
-	 * Read legacy config data
41
-	 *
42
-	 * @return array list of mount configs
43
-	 */
44
-	abstract protected function readLegacyConfig();
39
+    /**
40
+     * Read legacy config data
41
+     *
42
+     * @return array list of mount configs
43
+     */
44
+    abstract protected function readLegacyConfig();
45 45
 
46
-	/**
47
-	 * Copy legacy storage options into the given storage config object.
48
-	 *
49
-	 * @param StorageConfig $storageConfig storage config to populate
50
-	 * @param string $mountType mount type
51
-	 * @param string $applicable applicable user or group
52
-	 * @param array $storageOptions legacy storage options
53
-	 *
54
-	 * @return StorageConfig populated storage config
55
-	 */
56
-	protected function populateStorageConfigWithLegacyOptions(
57
-		&$storageConfig,
58
-		$mountType,
59
-		$applicable,
60
-		$storageOptions
61
-	) {
62
-		$backend = $this->backendService->getBackend($storageOptions['backend']);
63
-		if (!$backend) {
64
-			throw new \UnexpectedValueException('Invalid backend ' . $storageOptions['backend']);
65
-		}
66
-		$storageConfig->setBackend($backend);
67
-		if (isset($storageOptions['authMechanism']) && $storageOptions['authMechanism'] !== 'builtin::builtin') {
68
-			$authMechanism = $this->backendService->getAuthMechanism($storageOptions['authMechanism']);
69
-		} else {
70
-			$authMechanism = $backend->getLegacyAuthMechanism($storageOptions);
71
-			$storageOptions['authMechanism'] = 'null'; // to make error handling easier
72
-		}
73
-		if (!$authMechanism) {
74
-			throw new \UnexpectedValueException('Invalid authentication mechanism ' . $storageOptions['authMechanism']);
75
-		}
76
-		$storageConfig->setAuthMechanism($authMechanism);
77
-		$storageConfig->setBackendOptions($storageOptions['options']);
78
-		if (isset($storageOptions['mountOptions'])) {
79
-			$storageConfig->setMountOptions($storageOptions['mountOptions']);
80
-		}
81
-		if (!isset($storageOptions['priority'])) {
82
-			$storageOptions['priority'] = $backend->getPriority();
83
-		}
84
-		$storageConfig->setPriority($storageOptions['priority']);
85
-		if ($mountType === \OC_Mount_Config::MOUNT_TYPE_USER) {
86
-			$applicableUsers = $storageConfig->getApplicableUsers();
87
-			if ($applicable !== 'all') {
88
-				$applicableUsers[] = $applicable;
89
-				$storageConfig->setApplicableUsers($applicableUsers);
90
-			}
91
-		} elseif ($mountType === \OC_Mount_Config::MOUNT_TYPE_GROUP) {
92
-			$applicableGroups = $storageConfig->getApplicableGroups();
93
-			$applicableGroups[] = $applicable;
94
-			$storageConfig->setApplicableGroups($applicableGroups);
95
-		}
96
-		return $storageConfig;
97
-	}
46
+    /**
47
+     * Copy legacy storage options into the given storage config object.
48
+     *
49
+     * @param StorageConfig $storageConfig storage config to populate
50
+     * @param string $mountType mount type
51
+     * @param string $applicable applicable user or group
52
+     * @param array $storageOptions legacy storage options
53
+     *
54
+     * @return StorageConfig populated storage config
55
+     */
56
+    protected function populateStorageConfigWithLegacyOptions(
57
+        &$storageConfig,
58
+        $mountType,
59
+        $applicable,
60
+        $storageOptions
61
+    ) {
62
+        $backend = $this->backendService->getBackend($storageOptions['backend']);
63
+        if (!$backend) {
64
+            throw new \UnexpectedValueException('Invalid backend ' . $storageOptions['backend']);
65
+        }
66
+        $storageConfig->setBackend($backend);
67
+        if (isset($storageOptions['authMechanism']) && $storageOptions['authMechanism'] !== 'builtin::builtin') {
68
+            $authMechanism = $this->backendService->getAuthMechanism($storageOptions['authMechanism']);
69
+        } else {
70
+            $authMechanism = $backend->getLegacyAuthMechanism($storageOptions);
71
+            $storageOptions['authMechanism'] = 'null'; // to make error handling easier
72
+        }
73
+        if (!$authMechanism) {
74
+            throw new \UnexpectedValueException('Invalid authentication mechanism ' . $storageOptions['authMechanism']);
75
+        }
76
+        $storageConfig->setAuthMechanism($authMechanism);
77
+        $storageConfig->setBackendOptions($storageOptions['options']);
78
+        if (isset($storageOptions['mountOptions'])) {
79
+            $storageConfig->setMountOptions($storageOptions['mountOptions']);
80
+        }
81
+        if (!isset($storageOptions['priority'])) {
82
+            $storageOptions['priority'] = $backend->getPriority();
83
+        }
84
+        $storageConfig->setPriority($storageOptions['priority']);
85
+        if ($mountType === \OC_Mount_Config::MOUNT_TYPE_USER) {
86
+            $applicableUsers = $storageConfig->getApplicableUsers();
87
+            if ($applicable !== 'all') {
88
+                $applicableUsers[] = $applicable;
89
+                $storageConfig->setApplicableUsers($applicableUsers);
90
+            }
91
+        } elseif ($mountType === \OC_Mount_Config::MOUNT_TYPE_GROUP) {
92
+            $applicableGroups = $storageConfig->getApplicableGroups();
93
+            $applicableGroups[] = $applicable;
94
+            $storageConfig->setApplicableGroups($applicableGroups);
95
+        }
96
+        return $storageConfig;
97
+    }
98 98
 
99
-	/**
100
-	 * Read the external storages config
101
-	 *
102
-	 * @return StorageConfig[] map of storage id to storage config
103
-	 */
104
-	public function getAllStorages() {
105
-		$mountPoints = $this->readLegacyConfig();
106
-		/**
107
-		 * Here is the how the horribly messy mount point array looks like
108
-		 * from the mount.json file:
109
-		 *
110
-		 * $storageOptions = $mountPoints[$mountType][$applicable][$mountPath]
111
-		 *
112
-		 * - $mountType is either "user" or "group"
113
-		 * - $applicable is the name of a user or group (or the current user for personal mounts)
114
-		 * - $mountPath is the mount point path (where the storage must be mounted)
115
-		 * - $storageOptions is a map of storage options:
116
-		 *     - "priority": storage priority
117
-		 *     - "backend": backend identifier
118
-		 *     - "class": LEGACY backend class name
119
-		 *     - "options": backend-specific options
120
-		 *     - "authMechanism": authentication mechanism identifier
121
-		 *     - "mountOptions": mount-specific options (ex: disable previews, scanner, etc)
122
-		 */
123
-		// group by storage id
124
-		/** @var StorageConfig[] $storages */
125
-		$storages = [];
126
-		// for storages without id (legacy), group by config hash for
127
-		// later processing
128
-		$storagesWithConfigHash = [];
129
-		foreach ($mountPoints as $mountType => $applicables) {
130
-			foreach ($applicables as $applicable => $mountPaths) {
131
-				foreach ($mountPaths as $rootMountPath => $storageOptions) {
132
-					$currentStorage = null;
133
-					/**
134
-					 * Flag whether the config that was read already has an id.
135
-					 * If not, it will use a config hash instead and generate
136
-					 * a proper id later
137
-					 *
138
-					 * @var boolean
139
-					 */
140
-					$hasId = false;
141
-					// the root mount point is in the format "/$user/files/the/mount/point"
142
-					// we remove the "/$user/files" prefix
143
-					$parts = explode('/', ltrim($rootMountPath, '/'), 3);
144
-					if (count($parts) < 3) {
145
-						// something went wrong, skip
146
-						\OC::$server->getLogger()->error('Could not parse mount point "' . $rootMountPath . '"', ['app' => 'files_external']);
147
-						continue;
148
-					}
149
-					$relativeMountPath = rtrim($parts[2], '/');
150
-					// note: we cannot do this after the loop because the decrypted config
151
-					// options might be needed for the config hash
152
-					$storageOptions['options'] = \OC_Mount_Config::decryptPasswords($storageOptions['options']);
153
-					if (!isset($storageOptions['backend'])) {
154
-						$storageOptions['backend'] = $storageOptions['class']; // legacy compat
155
-					}
156
-					if (!isset($storageOptions['authMechanism'])) {
157
-						$storageOptions['authMechanism'] = null; // ensure config hash works
158
-					}
159
-					if (isset($storageOptions['id'])) {
160
-						$configId = (int)$storageOptions['id'];
161
-						if (isset($storages[$configId])) {
162
-							$currentStorage = $storages[$configId];
163
-						}
164
-						$hasId = true;
165
-					} else {
166
-						// missing id in legacy config, need to generate
167
-						// but at this point we don't know the max-id, so use
168
-						// first group it by config hash
169
-						$storageOptions['mountpoint'] = $rootMountPath;
170
-						$configId = \OC_Mount_Config::makeConfigHash($storageOptions);
171
-						if (isset($storagesWithConfigHash[$configId])) {
172
-							$currentStorage = $storagesWithConfigHash[$configId];
173
-						}
174
-					}
175
-					if (is_null($currentStorage)) {
176
-						// create new
177
-						$currentStorage = new StorageConfig($configId);
178
-						$currentStorage->setMountPoint($relativeMountPath);
179
-					}
180
-					try {
181
-						$this->populateStorageConfigWithLegacyOptions(
182
-							$currentStorage,
183
-							$mountType,
184
-							$applicable,
185
-							$storageOptions
186
-						);
187
-						if ($hasId) {
188
-							$storages[$configId] = $currentStorage;
189
-						} else {
190
-							$storagesWithConfigHash[$configId] = $currentStorage;
191
-						}
192
-					} catch (\UnexpectedValueException $e) {
193
-						// don't die if a storage backend doesn't exist
194
-						\OC::$server->getLogger()->logException($e, [
195
-							'message' => 'Could not load storage.',
196
-							'level' => ILogger::ERROR,
197
-							'app' => 'files_external',
198
-						]);
199
-					}
200
-				}
201
-			}
202
-		}
99
+    /**
100
+     * Read the external storages config
101
+     *
102
+     * @return StorageConfig[] map of storage id to storage config
103
+     */
104
+    public function getAllStorages() {
105
+        $mountPoints = $this->readLegacyConfig();
106
+        /**
107
+         * Here is the how the horribly messy mount point array looks like
108
+         * from the mount.json file:
109
+         *
110
+         * $storageOptions = $mountPoints[$mountType][$applicable][$mountPath]
111
+         *
112
+         * - $mountType is either "user" or "group"
113
+         * - $applicable is the name of a user or group (or the current user for personal mounts)
114
+         * - $mountPath is the mount point path (where the storage must be mounted)
115
+         * - $storageOptions is a map of storage options:
116
+         *     - "priority": storage priority
117
+         *     - "backend": backend identifier
118
+         *     - "class": LEGACY backend class name
119
+         *     - "options": backend-specific options
120
+         *     - "authMechanism": authentication mechanism identifier
121
+         *     - "mountOptions": mount-specific options (ex: disable previews, scanner, etc)
122
+         */
123
+        // group by storage id
124
+        /** @var StorageConfig[] $storages */
125
+        $storages = [];
126
+        // for storages without id (legacy), group by config hash for
127
+        // later processing
128
+        $storagesWithConfigHash = [];
129
+        foreach ($mountPoints as $mountType => $applicables) {
130
+            foreach ($applicables as $applicable => $mountPaths) {
131
+                foreach ($mountPaths as $rootMountPath => $storageOptions) {
132
+                    $currentStorage = null;
133
+                    /**
134
+                     * Flag whether the config that was read already has an id.
135
+                     * If not, it will use a config hash instead and generate
136
+                     * a proper id later
137
+                     *
138
+                     * @var boolean
139
+                     */
140
+                    $hasId = false;
141
+                    // the root mount point is in the format "/$user/files/the/mount/point"
142
+                    // we remove the "/$user/files" prefix
143
+                    $parts = explode('/', ltrim($rootMountPath, '/'), 3);
144
+                    if (count($parts) < 3) {
145
+                        // something went wrong, skip
146
+                        \OC::$server->getLogger()->error('Could not parse mount point "' . $rootMountPath . '"', ['app' => 'files_external']);
147
+                        continue;
148
+                    }
149
+                    $relativeMountPath = rtrim($parts[2], '/');
150
+                    // note: we cannot do this after the loop because the decrypted config
151
+                    // options might be needed for the config hash
152
+                    $storageOptions['options'] = \OC_Mount_Config::decryptPasswords($storageOptions['options']);
153
+                    if (!isset($storageOptions['backend'])) {
154
+                        $storageOptions['backend'] = $storageOptions['class']; // legacy compat
155
+                    }
156
+                    if (!isset($storageOptions['authMechanism'])) {
157
+                        $storageOptions['authMechanism'] = null; // ensure config hash works
158
+                    }
159
+                    if (isset($storageOptions['id'])) {
160
+                        $configId = (int)$storageOptions['id'];
161
+                        if (isset($storages[$configId])) {
162
+                            $currentStorage = $storages[$configId];
163
+                        }
164
+                        $hasId = true;
165
+                    } else {
166
+                        // missing id in legacy config, need to generate
167
+                        // but at this point we don't know the max-id, so use
168
+                        // first group it by config hash
169
+                        $storageOptions['mountpoint'] = $rootMountPath;
170
+                        $configId = \OC_Mount_Config::makeConfigHash($storageOptions);
171
+                        if (isset($storagesWithConfigHash[$configId])) {
172
+                            $currentStorage = $storagesWithConfigHash[$configId];
173
+                        }
174
+                    }
175
+                    if (is_null($currentStorage)) {
176
+                        // create new
177
+                        $currentStorage = new StorageConfig($configId);
178
+                        $currentStorage->setMountPoint($relativeMountPath);
179
+                    }
180
+                    try {
181
+                        $this->populateStorageConfigWithLegacyOptions(
182
+                            $currentStorage,
183
+                            $mountType,
184
+                            $applicable,
185
+                            $storageOptions
186
+                        );
187
+                        if ($hasId) {
188
+                            $storages[$configId] = $currentStorage;
189
+                        } else {
190
+                            $storagesWithConfigHash[$configId] = $currentStorage;
191
+                        }
192
+                    } catch (\UnexpectedValueException $e) {
193
+                        // don't die if a storage backend doesn't exist
194
+                        \OC::$server->getLogger()->logException($e, [
195
+                            'message' => 'Could not load storage.',
196
+                            'level' => ILogger::ERROR,
197
+                            'app' => 'files_external',
198
+                        ]);
199
+                    }
200
+                }
201
+            }
202
+        }
203 203
 
204
-		// convert parameter values
205
-		foreach ($storages as $storage) {
206
-			$storage->getBackend()->validateStorageDefinition($storage);
207
-			$storage->getAuthMechanism()->validateStorageDefinition($storage);
208
-		}
209
-		return $storages;
210
-	}
204
+        // convert parameter values
205
+        foreach ($storages as $storage) {
206
+            $storage->getBackend()->validateStorageDefinition($storage);
207
+            $storage->getAuthMechanism()->validateStorageDefinition($storage);
208
+        }
209
+        return $storages;
210
+    }
211 211
 }
Please login to merge, or discard this patch.
lib/public/Group/Backend/IGroupDetailsBackend.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -29,8 +29,8 @@
 block discarded – undo
29 29
  */
30 30
 interface IGroupDetailsBackend {
31 31
 
32
-	/**
33
-	 * @since 14.0.0
34
-	 */
35
-	public function getGroupDetails(string $gid): array;
32
+    /**
33
+     * @since 14.0.0
34
+     */
35
+    public function getGroupDetails(string $gid): array;
36 36
 }
Please login to merge, or discard this patch.
lib/public/Group/Backend/IIsAdminBackend.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -29,8 +29,8 @@
 block discarded – undo
29 29
  */
30 30
 interface IIsAdminBackend {
31 31
 
32
-	/**
33
-	 * @since 14.0.0
34
-	 */
35
-	public function isAdmin(string $uid): bool;
32
+    /**
33
+     * @since 14.0.0
34
+     */
35
+    public function isAdmin(string $uid): bool;
36 36
 }
Please login to merge, or discard this patch.