Passed
Push — master ( 7b8289...9c209a )
by Christoph
12:20 queued 36s
created
apps/dav/lib/Migration/Version1008Date20181114084440.php 1 patch
Indentation   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -33,27 +33,27 @@
 block discarded – undo
33 33
 class Version1008Date20181114084440 extends SimpleMigrationStep {
34 34
 
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) {
43
-		/** @var ISchemaWrapper $schema */
44
-		$schema = $schemaClosure();
45
-
46
-		if ($schema->hasTable('calendarchanges')) {
47
-			$calendarChangesTable = $schema->getTable('calendarchanges');
48
-			if ($calendarChangesTable->hasIndex('calendarid_calendartype_synctoken')) {
49
-				$calendarChangesTable->dropIndex('calendarid_calendartype_synctoken');
50
-			}
51
-
52
-			if (!$calendarChangesTable->hasIndex('calid_type_synctoken')) {
53
-				$calendarChangesTable->addIndex(['calendarid', 'calendartype', 'synctoken'], 'calid_type_synctoken');
54
-			}
55
-		}
56
-
57
-		return $schema;
58
-	}
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) {
43
+        /** @var ISchemaWrapper $schema */
44
+        $schema = $schemaClosure();
45
+
46
+        if ($schema->hasTable('calendarchanges')) {
47
+            $calendarChangesTable = $schema->getTable('calendarchanges');
48
+            if ($calendarChangesTable->hasIndex('calendarid_calendartype_synctoken')) {
49
+                $calendarChangesTable->dropIndex('calendarid_calendartype_synctoken');
50
+            }
51
+
52
+            if (!$calendarChangesTable->hasIndex('calid_type_synctoken')) {
53
+                $calendarChangesTable->addIndex(['calendarid', 'calendartype', 'synctoken'], 'calid_type_synctoken');
54
+            }
55
+        }
56
+
57
+        return $schema;
58
+    }
59 59
 }
Please login to merge, or discard this patch.
apps/files_versions/lib/Sabre/VersionHome.php 1 patch
Indentation   +75 added lines, -75 removed lines patch added patch discarded remove patch
@@ -32,79 +32,79 @@
 block discarded – undo
32 32
 
33 33
 class VersionHome implements ICollection {
34 34
 
35
-	/** @var array */
36
-	private $principalInfo;
37
-
38
-	/** @var IRootFolder */
39
-	private $rootFolder;
40
-
41
-	/** @var IUserManager */
42
-	private $userManager;
43
-
44
-	/** @var IVersionManager */
45
-	private $versionManager;
46
-
47
-	public function __construct(array $principalInfo, IRootFolder $rootFolder, IUserManager $userManager, IVersionManager $versionManager) {
48
-		$this->principalInfo = $principalInfo;
49
-		$this->rootFolder = $rootFolder;
50
-		$this->userManager = $userManager;
51
-		$this->versionManager = $versionManager;
52
-	}
53
-
54
-	private function getUser() {
55
-		list(, $name) = \Sabre\Uri\split($this->principalInfo['uri']);
56
-		$user = $this->userManager->get($name);
57
-		if (!$user) {
58
-			throw new NoUserException();
59
-		}
60
-		return $user;
61
-	}
62
-
63
-	public function delete() {
64
-		throw new Forbidden();
65
-	}
66
-
67
-	public function getName(): string {
68
-		return $this->getUser()->getUID();
69
-	}
70
-
71
-	public function setName($name) {
72
-		throw new Forbidden();
73
-	}
74
-
75
-	public function createFile($name, $data = null) {
76
-		throw new Forbidden();
77
-	}
78
-
79
-	public function createDirectory($name) {
80
-		throw new Forbidden();
81
-	}
82
-
83
-	public function getChild($name) {
84
-		$user = $this->getUser();
85
-
86
-		if ($name === 'versions') {
87
-			return new VersionRoot($user, $this->rootFolder, $this->versionManager);
88
-		}
89
-		if ($name === 'restore') {
90
-			return new RestoreFolder();
91
-		}
92
-	}
93
-
94
-	public function getChildren() {
95
-		$user = $this->getUser();
96
-
97
-		return [
98
-			new VersionRoot($user, $this->rootFolder, $this->versionManager),
99
-			new RestoreFolder(),
100
-		];
101
-	}
102
-
103
-	public function childExists($name) {
104
-		return $name === 'versions' || $name === 'restore';
105
-	}
106
-
107
-	public function getLastModified() {
108
-		return 0;
109
-	}
35
+    /** @var array */
36
+    private $principalInfo;
37
+
38
+    /** @var IRootFolder */
39
+    private $rootFolder;
40
+
41
+    /** @var IUserManager */
42
+    private $userManager;
43
+
44
+    /** @var IVersionManager */
45
+    private $versionManager;
46
+
47
+    public function __construct(array $principalInfo, IRootFolder $rootFolder, IUserManager $userManager, IVersionManager $versionManager) {
48
+        $this->principalInfo = $principalInfo;
49
+        $this->rootFolder = $rootFolder;
50
+        $this->userManager = $userManager;
51
+        $this->versionManager = $versionManager;
52
+    }
53
+
54
+    private function getUser() {
55
+        list(, $name) = \Sabre\Uri\split($this->principalInfo['uri']);
56
+        $user = $this->userManager->get($name);
57
+        if (!$user) {
58
+            throw new NoUserException();
59
+        }
60
+        return $user;
61
+    }
62
+
63
+    public function delete() {
64
+        throw new Forbidden();
65
+    }
66
+
67
+    public function getName(): string {
68
+        return $this->getUser()->getUID();
69
+    }
70
+
71
+    public function setName($name) {
72
+        throw new Forbidden();
73
+    }
74
+
75
+    public function createFile($name, $data = null) {
76
+        throw new Forbidden();
77
+    }
78
+
79
+    public function createDirectory($name) {
80
+        throw new Forbidden();
81
+    }
82
+
83
+    public function getChild($name) {
84
+        $user = $this->getUser();
85
+
86
+        if ($name === 'versions') {
87
+            return new VersionRoot($user, $this->rootFolder, $this->versionManager);
88
+        }
89
+        if ($name === 'restore') {
90
+            return new RestoreFolder();
91
+        }
92
+    }
93
+
94
+    public function getChildren() {
95
+        $user = $this->getUser();
96
+
97
+        return [
98
+            new VersionRoot($user, $this->rootFolder, $this->versionManager),
99
+            new RestoreFolder(),
100
+        ];
101
+    }
102
+
103
+    public function childExists($name) {
104
+        return $name === 'versions' || $name === 'restore';
105
+    }
106
+
107
+    public function getLastModified() {
108
+        return 0;
109
+    }
110 110
 }
Please login to merge, or discard this patch.
lib/public/Authentication/TwoFactorAuth/IActivatableByAdmin.php 1 patch
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -37,15 +37,15 @@
 block discarded – undo
37 37
  */
38 38
 interface IActivatableByAdmin extends IProvider {
39 39
 
40
-	/**
41
-	 * Enable this provider for the given user.
42
-	 *
43
-	 * @param IUser $user the user to activate this provider for
44
-	 *
45
-	 * @return void
46
-	 *
47
-	 * @since 15.0.0
48
-	 */
49
-	public function enableFor(IUser $user);
40
+    /**
41
+     * Enable this provider for the given user.
42
+     *
43
+     * @param IUser $user the user to activate this provider for
44
+     *
45
+     * @return void
46
+     *
47
+     * @since 15.0.0
48
+     */
49
+    public function enableFor(IUser $user);
50 50
 
51 51
 }
Please login to merge, or discard this patch.
lib/public/Authentication/TwoFactorAuth/IDeactivatableByAdmin.php 1 patch
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -37,15 +37,15 @@
 block discarded – undo
37 37
  */
38 38
 interface IDeactivatableByAdmin extends IProvider {
39 39
 
40
-	/**
41
-	 * Disable this provider for the given user.
42
-	 *
43
-	 * @param IUser $user the user to deactivate this provider for
44
-	 *
45
-	 * @return void
46
-	 *
47
-	 * @since 15.0.0
48
-	 */
49
-	public function disableFor(IUser $user);
40
+    /**
41
+     * Disable this provider for the given user.
42
+     *
43
+     * @param IUser $user the user to deactivate this provider for
44
+     *
45
+     * @return void
46
+     *
47
+     * @since 15.0.0
48
+     */
49
+    public function disableFor(IUser $user);
50 50
 
51 51
 }
Please login to merge, or discard this patch.
lib/private/RichObjectStrings/Validator.php 1 patch
Indentation   +83 added lines, -83 removed lines patch added patch discarded remove patch
@@ -38,87 +38,87 @@
 block discarded – undo
38 38
  */
39 39
 class Validator implements IValidator {
40 40
 
41
-	/** @var Definitions */
42
-	protected $definitions;
43
-
44
-	/** @var array[] */
45
-	protected $requiredParameters = [];
46
-
47
-	/**
48
-	 * Constructor
49
-	 *
50
-	 * @param Definitions $definitions
51
-	 */
52
-	public function __construct(Definitions $definitions) {
53
-		$this->definitions = $definitions;
54
-	}
55
-
56
-	/**
57
-	 * @param string $subject
58
-	 * @param array[] $parameters
59
-	 * @throws InvalidObjectExeption
60
-	 * @since 11.0.0
61
-	 */
62
-	public function validate($subject, array $parameters) {
63
-		$matches = [];
64
-		$result = preg_match_all('/\{([a-z0-9]+)\}/i', $subject, $matches);
65
-
66
-		if ($result === false) {
67
-			throw new InvalidObjectExeption();
68
-		}
69
-
70
-		if (!empty($matches[1])) {
71
-			foreach ($matches[1] as $parameter) {
72
-				if (!isset($parameters[$parameter])) {
73
-					throw new InvalidObjectExeption('Parameter is undefined');
74
-				}
75
-			}
76
-		}
77
-
78
-		foreach ($parameters as $parameter) {
79
-			if (!\is_array($parameter)) {
80
-				throw new InvalidObjectExeption('Parameter is malformed');
81
-			}
82
-
83
-			$this->validateParameter($parameter);
84
-		}
85
-	}
86
-
87
-	/**
88
-	 * @param array $parameter
89
-	 * @throws InvalidObjectExeption
90
-	 */
91
-	protected function validateParameter(array $parameter) {
92
-		if (!isset($parameter['type'])) {
93
-			throw new InvalidObjectExeption('Object type is undefined');
94
-		}
95
-
96
-		$definition = $this->definitions->getDefinition($parameter['type']);
97
-		$requiredParameters = $this->getRequiredParameters($parameter['type'], $definition);
98
-
99
-		$missingKeys = array_diff($requiredParameters, array_keys($parameter));
100
-		if (!empty($missingKeys)) {
101
-			throw new InvalidObjectExeption('Object is invalid');
102
-		}
103
-	}
104
-
105
-	/**
106
-	 * @param string $type
107
-	 * @param array $definition
108
-	 * @return string[]
109
-	 */
110
-	protected function getRequiredParameters($type, array $definition) {
111
-		if (isset($this->requiredParameters[$type])) {
112
-			return $this->requiredParameters[$type];
113
-		}
114
-
115
-		$this->requiredParameters[$type] = [];
116
-		foreach ($definition['parameters'] as $parameter => $data) {
117
-			if ($data['required']) {
118
-				$this->requiredParameters[$type][] = $parameter;
119
-			}
120
-		}
121
-
122
-		return $this->requiredParameters[$type];
123
-	}
41
+    /** @var Definitions */
42
+    protected $definitions;
43
+
44
+    /** @var array[] */
45
+    protected $requiredParameters = [];
46
+
47
+    /**
48
+     * Constructor
49
+     *
50
+     * @param Definitions $definitions
51
+     */
52
+    public function __construct(Definitions $definitions) {
53
+        $this->definitions = $definitions;
54
+    }
55
+
56
+    /**
57
+     * @param string $subject
58
+     * @param array[] $parameters
59
+     * @throws InvalidObjectExeption
60
+     * @since 11.0.0
61
+     */
62
+    public function validate($subject, array $parameters) {
63
+        $matches = [];
64
+        $result = preg_match_all('/\{([a-z0-9]+)\}/i', $subject, $matches);
65
+
66
+        if ($result === false) {
67
+            throw new InvalidObjectExeption();
68
+        }
69
+
70
+        if (!empty($matches[1])) {
71
+            foreach ($matches[1] as $parameter) {
72
+                if (!isset($parameters[$parameter])) {
73
+                    throw new InvalidObjectExeption('Parameter is undefined');
74
+                }
75
+            }
76
+        }
77
+
78
+        foreach ($parameters as $parameter) {
79
+            if (!\is_array($parameter)) {
80
+                throw new InvalidObjectExeption('Parameter is malformed');
81
+            }
82
+
83
+            $this->validateParameter($parameter);
84
+        }
85
+    }
86
+
87
+    /**
88
+     * @param array $parameter
89
+     * @throws InvalidObjectExeption
90
+     */
91
+    protected function validateParameter(array $parameter) {
92
+        if (!isset($parameter['type'])) {
93
+            throw new InvalidObjectExeption('Object type is undefined');
94
+        }
95
+
96
+        $definition = $this->definitions->getDefinition($parameter['type']);
97
+        $requiredParameters = $this->getRequiredParameters($parameter['type'], $definition);
98
+
99
+        $missingKeys = array_diff($requiredParameters, array_keys($parameter));
100
+        if (!empty($missingKeys)) {
101
+            throw new InvalidObjectExeption('Object is invalid');
102
+        }
103
+    }
104
+
105
+    /**
106
+     * @param string $type
107
+     * @param array $definition
108
+     * @return string[]
109
+     */
110
+    protected function getRequiredParameters($type, array $definition) {
111
+        if (isset($this->requiredParameters[$type])) {
112
+            return $this->requiredParameters[$type];
113
+        }
114
+
115
+        $this->requiredParameters[$type] = [];
116
+        foreach ($definition['parameters'] as $parameter => $data) {
117
+            if ($data['required']) {
118
+                $this->requiredParameters[$type][] = $parameter;
119
+            }
120
+        }
121
+
122
+        return $this->requiredParameters[$type];
123
+    }
124 124
 }
Please login to merge, or discard this patch.
apps/oauth2/lib/Db/ClientMapper.php 1 patch
Indentation   +52 added lines, -52 removed lines patch added patch discarded remove patch
@@ -30,62 +30,62 @@
 block discarded – undo
30 30
 
31 31
 class ClientMapper extends QBMapper {
32 32
 
33
-	/**
34
-	 * @param IDBConnection $db
35
-	 */
36
-	public function __construct(IDBConnection $db) {
37
-		parent::__construct($db, 'oauth2_clients');
38
-	}
33
+    /**
34
+     * @param IDBConnection $db
35
+     */
36
+    public function __construct(IDBConnection $db) {
37
+        parent::__construct($db, 'oauth2_clients');
38
+    }
39 39
 
40
-	/**
41
-	 * @param string $clientIdentifier
42
-	 * @return Client
43
-	 * @throws ClientNotFoundException
44
-	 */
45
-	public function getByIdentifier(string $clientIdentifier): Client {
46
-		$qb = $this->db->getQueryBuilder();
47
-		$qb
48
-			->select('*')
49
-			->from($this->tableName)
50
-			->where($qb->expr()->eq('client_identifier', $qb->createNamedParameter($clientIdentifier)));
40
+    /**
41
+     * @param string $clientIdentifier
42
+     * @return Client
43
+     * @throws ClientNotFoundException
44
+     */
45
+    public function getByIdentifier(string $clientIdentifier): Client {
46
+        $qb = $this->db->getQueryBuilder();
47
+        $qb
48
+            ->select('*')
49
+            ->from($this->tableName)
50
+            ->where($qb->expr()->eq('client_identifier', $qb->createNamedParameter($clientIdentifier)));
51 51
 
52
-		try {
53
-			$client = $this->findEntity($qb);
54
-		} catch (IMapperException $e) {
55
-			throw new ClientNotFoundException('could not find client '.$clientIdentifier, 0, $e);
56
-		}
57
-		return $client;
58
-	}
52
+        try {
53
+            $client = $this->findEntity($qb);
54
+        } catch (IMapperException $e) {
55
+            throw new ClientNotFoundException('could not find client '.$clientIdentifier, 0, $e);
56
+        }
57
+        return $client;
58
+    }
59 59
 
60
-	/**
61
-	 * @param int $id internal id of the client
62
-	 * @return Client
63
-	 * @throws ClientNotFoundException
64
-	 */
65
-	public function getByUid(int $id): Client {
66
-		$qb = $this->db->getQueryBuilder();
67
-		$qb
68
-			->select('*')
69
-			->from($this->tableName)
70
-			->where($qb->expr()->eq('id', $qb->createNamedParameter($id, IQueryBuilder::PARAM_INT)));
60
+    /**
61
+     * @param int $id internal id of the client
62
+     * @return Client
63
+     * @throws ClientNotFoundException
64
+     */
65
+    public function getByUid(int $id): Client {
66
+        $qb = $this->db->getQueryBuilder();
67
+        $qb
68
+            ->select('*')
69
+            ->from($this->tableName)
70
+            ->where($qb->expr()->eq('id', $qb->createNamedParameter($id, IQueryBuilder::PARAM_INT)));
71 71
 
72
-		try {
73
-			$client = $this->findEntity($qb);
74
-		} catch (IMapperException $e) {
75
-			throw new ClientNotFoundException('could not find client with id '.$id, 0, $e);
76
-		}
77
-		return $client;
78
-	}
72
+        try {
73
+            $client = $this->findEntity($qb);
74
+        } catch (IMapperException $e) {
75
+            throw new ClientNotFoundException('could not find client with id '.$id, 0, $e);
76
+        }
77
+        return $client;
78
+    }
79 79
 
80
-	/**
81
-	 * @return Client[]
82
-	 */
83
-	public function getClients(): array {
84
-		$qb = $this->db->getQueryBuilder();
85
-		$qb
86
-			->select('*')
87
-			->from($this->tableName);
80
+    /**
81
+     * @return Client[]
82
+     */
83
+    public function getClients(): array {
84
+        $qb = $this->db->getQueryBuilder();
85
+        $qb
86
+            ->select('*')
87
+            ->from($this->tableName);
88 88
 
89
-		return $this->findEntities($qb);
90
-	}
89
+        return $this->findEntities($qb);
90
+    }
91 91
 }
Please login to merge, or discard this patch.
apps/oauth2/lib/Db/AccessTokenMapper.php 1 patch
Indentation   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -30,44 +30,44 @@
 block discarded – undo
30 30
 
31 31
 class AccessTokenMapper extends QBMapper {
32 32
 
33
-	/**
34
-	 * @param IDBConnection $db
35
-	 */
36
-	public function __construct(IDBConnection $db) {
37
-		parent::__construct($db, 'oauth2_access_tokens');
38
-	}
33
+    /**
34
+     * @param IDBConnection $db
35
+     */
36
+    public function __construct(IDBConnection $db) {
37
+        parent::__construct($db, 'oauth2_access_tokens');
38
+    }
39 39
 
40
-	/**
41
-	 * @param string $code
42
-	 * @return AccessToken
43
-	 * @throws AccessTokenNotFoundException
44
-	 */
45
-	public function getByCode(string $code): AccessToken {
46
-		$qb = $this->db->getQueryBuilder();
47
-		$qb
48
-			->select('*')
49
-			->from($this->tableName)
50
-			->where($qb->expr()->eq('hashed_code', $qb->createNamedParameter(hash('sha512', $code))));
40
+    /**
41
+     * @param string $code
42
+     * @return AccessToken
43
+     * @throws AccessTokenNotFoundException
44
+     */
45
+    public function getByCode(string $code): AccessToken {
46
+        $qb = $this->db->getQueryBuilder();
47
+        $qb
48
+            ->select('*')
49
+            ->from($this->tableName)
50
+            ->where($qb->expr()->eq('hashed_code', $qb->createNamedParameter(hash('sha512', $code))));
51 51
 
52
-		try {
53
-			$token = $this->findEntity($qb);
54
-		} catch (IMapperException $e) {
55
-			throw new AccessTokenNotFoundException('Could not find access token', 0, $e);
56
-		}
52
+        try {
53
+            $token = $this->findEntity($qb);
54
+        } catch (IMapperException $e) {
55
+            throw new AccessTokenNotFoundException('Could not find access token', 0, $e);
56
+        }
57 57
 
58
-		return $token;
59
-	}
58
+        return $token;
59
+    }
60 60
 
61
-	/**
62
-	 * delete all access token from a given client
63
-	 *
64
-	 * @param int $id
65
-	 */
66
-	public function deleteByClientId(int $id) {
67
-		$qb = $this->db->getQueryBuilder();
68
-		$qb
69
-			->delete($this->tableName)
70
-			->where($qb->expr()->eq('client_id', $qb->createNamedParameter($id, IQueryBuilder::PARAM_INT)));
71
-		$qb->execute();
72
-	}
61
+    /**
62
+     * delete all access token from a given client
63
+     *
64
+     * @param int $id
65
+     */
66
+    public function deleteByClientId(int $id) {
67
+        $qb = $this->db->getQueryBuilder();
68
+        $qb
69
+            ->delete($this->tableName)
70
+            ->where($qb->expr()->eq('client_id', $qb->createNamedParameter($id, IQueryBuilder::PARAM_INT)));
71
+        $qb->execute();
72
+    }
73 73
 }
Please login to merge, or discard this patch.
apps/oauth2/lib/Migration/Version010401Date20181207190718.php 1 patch
Indentation   +62 added lines, -62 removed lines patch added patch discarded remove patch
@@ -31,68 +31,68 @@
 block discarded – undo
31 31
 
32 32
 class Version010401Date20181207190718 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
-		if (!$schema->hasTable('oauth2_clients')) {
45
-			$table = $schema->createTable('oauth2_clients');
46
-			$table->addColumn('id', 'integer', [
47
-				'autoincrement' => true,
48
-				'notnull' => true,
49
-				'unsigned' => true,
50
-			]);
51
-			$table->addColumn('name', 'string', [
52
-				'notnull' => true,
53
-				'length' => 64,
54
-			]);
55
-			$table->addColumn('redirect_uri', 'string', [
56
-				'notnull' => true,
57
-				'length' => 2000,
58
-			]);
59
-			$table->addColumn('client_identifier', 'string', [
60
-				'notnull' => true,
61
-				'length' => 64,
62
-			]);
63
-			$table->addColumn('secret', 'string', [
64
-				'notnull' => true,
65
-				'length' => 64,
66
-			]);
67
-			$table->setPrimaryKey(['id']);
68
-			$table->addIndex(['client_identifier'], 'oauth2_client_id_idx');
69
-		}
44
+        if (!$schema->hasTable('oauth2_clients')) {
45
+            $table = $schema->createTable('oauth2_clients');
46
+            $table->addColumn('id', 'integer', [
47
+                'autoincrement' => true,
48
+                'notnull' => true,
49
+                'unsigned' => true,
50
+            ]);
51
+            $table->addColumn('name', 'string', [
52
+                'notnull' => true,
53
+                'length' => 64,
54
+            ]);
55
+            $table->addColumn('redirect_uri', 'string', [
56
+                'notnull' => true,
57
+                'length' => 2000,
58
+            ]);
59
+            $table->addColumn('client_identifier', 'string', [
60
+                'notnull' => true,
61
+                'length' => 64,
62
+            ]);
63
+            $table->addColumn('secret', 'string', [
64
+                'notnull' => true,
65
+                'length' => 64,
66
+            ]);
67
+            $table->setPrimaryKey(['id']);
68
+            $table->addIndex(['client_identifier'], 'oauth2_client_id_idx');
69
+        }
70 70
 
71
-		if (!$schema->hasTable('oauth2_access_tokens')) {
72
-			$table = $schema->createTable('oauth2_access_tokens');
73
-			$table->addColumn('id', 'integer', [
74
-				'autoincrement' => true,
75
-				'notnull' => true,
76
-				'unsigned' => true,
77
-			]);
78
-			$table->addColumn('token_id', 'integer', [
79
-				'notnull' => true,
80
-			]);
81
-			$table->addColumn('client_id', 'integer', [
82
-				'notnull' => true,
83
-			]);
84
-			$table->addColumn('hashed_code', 'string', [
85
-				'notnull' => true,
86
-				'length' => 128,
87
-			]);
88
-			$table->addColumn('encrypted_token', 'string', [
89
-				'notnull' => true,
90
-				'length' => 786,
91
-			]);
92
-			$table->setPrimaryKey(['id']);
93
-			$table->addUniqueIndex(['hashed_code'], 'oauth2_access_hash_idx');
94
-			$table->addIndex(['client_id'], 'oauth2_access_client_id_idx');
95
-		}
96
-		return $schema;
97
-	}
71
+        if (!$schema->hasTable('oauth2_access_tokens')) {
72
+            $table = $schema->createTable('oauth2_access_tokens');
73
+            $table->addColumn('id', 'integer', [
74
+                'autoincrement' => true,
75
+                'notnull' => true,
76
+                'unsigned' => true,
77
+            ]);
78
+            $table->addColumn('token_id', 'integer', [
79
+                'notnull' => true,
80
+            ]);
81
+            $table->addColumn('client_id', 'integer', [
82
+                'notnull' => true,
83
+            ]);
84
+            $table->addColumn('hashed_code', 'string', [
85
+                'notnull' => true,
86
+                'length' => 128,
87
+            ]);
88
+            $table->addColumn('encrypted_token', 'string', [
89
+                'notnull' => true,
90
+                'length' => 786,
91
+            ]);
92
+            $table->setPrimaryKey(['id']);
93
+            $table->addUniqueIndex(['hashed_code'], 'oauth2_access_hash_idx');
94
+            $table->addIndex(['client_id'], 'oauth2_access_client_id_idx');
95
+        }
96
+        return $schema;
97
+    }
98 98
 }
Please login to merge, or discard this patch.
apps/dav/lib/Migration/ChunkCleanup.php 1 patch
Indentation   +47 added lines, -47 removed lines patch added patch discarded remove patch
@@ -37,59 +37,59 @@
 block discarded – undo
37 37
 
38 38
 class ChunkCleanup implements IRepairStep {
39 39
 
40
-	/** @var IConfig */
41
-	private $config;
42
-	/** @var IUserManager */
43
-	private $userManager;
44
-	/** @var IRootFolder */
45
-	private $rootFolder;
46
-	/** @var IJobList */
47
-	private $jobList;
40
+    /** @var IConfig */
41
+    private $config;
42
+    /** @var IUserManager */
43
+    private $userManager;
44
+    /** @var IRootFolder */
45
+    private $rootFolder;
46
+    /** @var IJobList */
47
+    private $jobList;
48 48
 
49
-	public function __construct(IConfig $config,
50
-								IUserManager $userManager,
51
-								IRootFolder $rootFolder,
52
-								IJobList $jobList) {
53
-		$this->config = $config;
54
-		$this->userManager = $userManager;
55
-		$this->rootFolder = $rootFolder;
56
-		$this->jobList = $jobList;
57
-	}
49
+    public function __construct(IConfig $config,
50
+                                IUserManager $userManager,
51
+                                IRootFolder $rootFolder,
52
+                                IJobList $jobList) {
53
+        $this->config = $config;
54
+        $this->userManager = $userManager;
55
+        $this->rootFolder = $rootFolder;
56
+        $this->jobList = $jobList;
57
+    }
58 58
 
59
-	public function getName(): string {
60
-		return 'Chunk cleanup scheduler';
61
-	}
59
+    public function getName(): string {
60
+        return 'Chunk cleanup scheduler';
61
+    }
62 62
 
63
-	public function run(IOutput $output) {
64
-		// If we already ran this onec there is no need to run it again
65
-		if ($this->config->getAppValue('dav', 'chunks_migrated', '0') === '1') {
66
-			$output->info('Cleanup not required');
67
-		}
63
+    public function run(IOutput $output) {
64
+        // If we already ran this onec there is no need to run it again
65
+        if ($this->config->getAppValue('dav', 'chunks_migrated', '0') === '1') {
66
+            $output->info('Cleanup not required');
67
+        }
68 68
 
69
-		$output->startProgress();
70
-		// Loop over all seen users
71
-		$this->userManager->callForSeenUsers(function (IUser $user) use ($output) {
72
-			try {
73
-				$userFolder = $this->rootFolder->getUserFolder($user->getUID());
74
-				$userRoot = $userFolder->getParent();
75
-				/** @var Folder $uploadFolder */
76
-				$uploadFolder = $userRoot->get('uploads');
77
-			} catch (NotFoundException $e) {
78
-				// No folder so skipping
79
-				return;
80
-			}
69
+        $output->startProgress();
70
+        // Loop over all seen users
71
+        $this->userManager->callForSeenUsers(function (IUser $user) use ($output) {
72
+            try {
73
+                $userFolder = $this->rootFolder->getUserFolder($user->getUID());
74
+                $userRoot = $userFolder->getParent();
75
+                /** @var Folder $uploadFolder */
76
+                $uploadFolder = $userRoot->get('uploads');
77
+            } catch (NotFoundException $e) {
78
+                // No folder so skipping
79
+                return;
80
+            }
81 81
 
82
-			// Insert a cleanup job for each folder we find
83
-			$uploads = $uploadFolder->getDirectoryListing();
84
-			foreach ($uploads as $upload) {
85
-				$this->jobList->add(UploadCleanup::class, ['uid' => $user->getUID(), 'folder' => $upload->getName()]);
86
-			}
87
-			$output->advance();
88
-		});
89
-		$output->finishProgress();
82
+            // Insert a cleanup job for each folder we find
83
+            $uploads = $uploadFolder->getDirectoryListing();
84
+            foreach ($uploads as $upload) {
85
+                $this->jobList->add(UploadCleanup::class, ['uid' => $user->getUID(), 'folder' => $upload->getName()]);
86
+            }
87
+            $output->advance();
88
+        });
89
+        $output->finishProgress();
90 90
 
91 91
 
92
-		$this->config->setAppValue('dav', 'chunks_migrated', '1');
93
-	}
92
+        $this->config->setAppValue('dav', 'chunks_migrated', '1');
93
+    }
94 94
 
95 95
 }
Please login to merge, or discard this patch.