@@ -1,12 +1,10 @@ |
||
1 | 1 | <?php |
2 | 2 | namespace OC\Migrations; |
3 | 3 | |
4 | -use OC\User\Account; |
|
5 | 4 | use OC\User\AccountMapper; |
6 | 5 | use OC\User\AccountTermMapper; |
7 | 6 | use OC\User\Database; |
8 | 7 | use OC\User\SyncService; |
9 | -use OCP\IConfig; |
|
10 | 8 | use OCP\Migration\ISimpleMigration; |
11 | 9 | use OCP\Migration\IOutput; |
12 | 10 |
@@ -41,8 +41,8 @@ discard block |
||
41 | 41 | |
42 | 42 | /** |
43 | 43 | * Delegate to term mapper to avoid needing to inject term mapper |
44 | - * @param $account_id |
|
45 | - * @param array $terms |
|
44 | + * @param integer $account_id |
|
45 | + * @param string[] $terms |
|
46 | 46 | */ |
47 | 47 | public function setTermsForAccount($account_id, array $terms) { |
48 | 48 | $this->termMapper->setTermsForAccount($account_id, $terms); |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | |
51 | 51 | /** |
52 | 52 | * Delegate to term mapper to avoid needing to inject term mapper |
53 | - * @param $account_id |
|
53 | + * @param integer $account_id |
|
54 | 54 | * @return AccountTerm[] $terms |
55 | 55 | */ |
56 | 56 | public function findByAccountId($account_id) { |
@@ -162,6 +162,9 @@ discard block |
||
162 | 162 | return $this->findEntities($qb->getSQL(), $qb->getParameters(), $limit, $offset); |
163 | 163 | } |
164 | 164 | |
165 | + /** |
|
166 | + * @param boolean $hasLoggedIn |
|
167 | + */ |
|
165 | 168 | public function getUserCountPerBackend($hasLoggedIn) { |
166 | 169 | $qb = $this->db->getQueryBuilder(); |
167 | 170 | $qb->select(['backend', $qb->createFunction('count(*) as `count`')]) |
@@ -184,6 +187,9 @@ discard block |
||
184 | 187 | return $return; |
185 | 188 | } |
186 | 189 | |
190 | + /** |
|
191 | + * @param boolean $hasLoggedIn |
|
192 | + */ |
|
187 | 193 | public function getUserCount($hasLoggedIn) { |
188 | 194 | $qb = $this->db->getQueryBuilder(); |
189 | 195 | $qb->select([$qb->createFunction('count(*) as `count`')]) |
@@ -200,6 +206,11 @@ discard block |
||
200 | 206 | return (int) $data['count']; |
201 | 207 | } |
202 | 208 | |
209 | + /** |
|
210 | + * @param \Closure $callback |
|
211 | + * @param string $search |
|
212 | + * @param boolean $onlySeen |
|
213 | + */ |
|
203 | 214 | public function callForAllUsers($callback, $search, $onlySeen) { |
204 | 215 | $qb = $this->db->getQueryBuilder(); |
205 | 216 | $qb->select(['*']) |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | /** |
123 | 123 | * List all installed apps |
124 | 124 | * |
125 | - * @return string[] |
|
125 | + * @return integer[] |
|
126 | 126 | */ |
127 | 127 | public function getInstalledApps() { |
128 | 128 | return array_keys($this->getInstalledAppsValues()); |
@@ -355,6 +355,9 @@ discard block |
||
355 | 355 | return in_array($appId, $this->shippedApps); |
356 | 356 | } |
357 | 357 | |
358 | + /** |
|
359 | + * @param string $appId |
|
360 | + */ |
|
358 | 361 | private function isAlwaysEnabled($appId) { |
359 | 362 | $alwaysEnabled = $this->getAlwaysEnabledApps(); |
360 | 363 | return in_array($appId, $alwaysEnabled); |
@@ -383,7 +386,7 @@ discard block |
||
383 | 386 | /** |
384 | 387 | * @param string $package package path |
385 | 388 | * @param bool $skipMigrations whether to skip migrations, which would only install the code |
386 | - * @return string|false app id or false in case of error |
|
389 | + * @return integer app id or false in case of error |
|
387 | 390 | * @since 10.0 |
388 | 391 | */ |
389 | 392 | public function installApp($package, $skipMigrations = false) { |
@@ -400,7 +403,7 @@ discard block |
||
400 | 403 | |
401 | 404 | /** |
402 | 405 | * @param string $package |
403 | - * @return mixed |
|
406 | + * @return boolean |
|
404 | 407 | * @since 10.0 |
405 | 408 | */ |
406 | 409 | public function updateApp($package) { |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | * |
73 | 73 | * @param Account $account |
74 | 74 | * @param AccountMapper $mapper |
75 | - * @param null $emitter |
|
75 | + * @param Manager $emitter |
|
76 | 76 | * @param IConfig|null $config |
77 | 77 | * @param null $urlGenerator |
78 | 78 | * @param EventDispatcher|null $eventDispatcher |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | /** |
98 | 98 | * get the user id |
99 | 99 | * |
100 | - * @return string |
|
100 | + * @return integer |
|
101 | 101 | */ |
102 | 102 | public function getUID() { |
103 | 103 | return $this->account->getUserId(); |
@@ -433,6 +433,10 @@ discard block |
||
433 | 433 | return $url; |
434 | 434 | } |
435 | 435 | |
436 | + /** |
|
437 | + * @param string $feature |
|
438 | + * @param string $value |
|
439 | + */ |
|
436 | 440 | public function triggerChange($feature, $value = null) { |
437 | 441 | if ($this->emitter && in_array($feature, $this->account->getUpdatedFields())) { |
438 | 442 | $this->emitter->emit('\OC\User', 'changeUser', [$this, $feature, $value]); |