@@ -557,7 +557,7 @@ |
||
557 | 557 | * @param IUserManager $userManager |
558 | 558 | * @param IURLGenerator $urlGenerator |
559 | 559 | * |
560 | - * @return IShare |
|
560 | + * @return null|Share |
|
561 | 561 | * @throws IllegalIDChangeException |
562 | 562 | */ |
563 | 563 | public function getShare( |
@@ -611,9 +611,9 @@ discard block |
||
611 | 611 | $circle = $this->getCircle(); |
612 | 612 | $display = $circle->getDisplayName(); |
613 | 613 | if ($circle->getSource() === 0) { |
614 | - $display .= ' (Circle owned by ' . $circle->getOwner()->getDisplayName() . ')'; |
|
614 | + $display .= ' (Circle owned by '.$circle->getOwner()->getDisplayName().')'; |
|
615 | 615 | } else { |
616 | - $display .= ' (' . Circle::$DEF_SOURCE[$circle->getSource()] . ')'; |
|
616 | + $display .= ' ('.Circle::$DEF_SOURCE[$circle->getSource()].')'; |
|
617 | 617 | } |
618 | 618 | |
619 | 619 | $share->setSharedWithDisplayName($display); |
@@ -702,20 +702,20 @@ discard block |
||
702 | 702 | */ |
703 | 703 | public function importFromDatabase(array $data, string $prefix = ''): INC22QueryRow { |
704 | 704 | $shareTime = new DateTime(); |
705 | - $shareTime->setTimestamp($this->getInt($prefix . 'stime', $data)); |
|
706 | - |
|
707 | - $this->setId($this->get($prefix . 'id', $data)) |
|
708 | - ->setShareType($this->getInt($prefix . 'share_type', $data)) |
|
709 | - ->setPermissions($this->getInt($prefix . 'permissions', $data)) |
|
710 | - ->setItemType($this->get($prefix . 'item_type', $data)) |
|
711 | - ->setItemSource($this->getInt($prefix . 'item_source', $data)) |
|
712 | - ->setItemTarget($this->get($prefix . 'item_target', $data)) |
|
713 | - ->setFileSource($this->getInt($prefix . 'file_source', $data)) |
|
714 | - ->setFileTarget($this->get($prefix . 'file_target', $data)) |
|
715 | - ->setSharedWith($this->get($prefix . 'share_with', $data)) |
|
716 | - ->setSharedBy($this->get($prefix . 'uid_initiator', $data)) |
|
717 | - ->setShareOwner($this->get($prefix . 'uid_owner', $data)) |
|
718 | - ->setToken($this->get($prefix . 'token', $data)) |
|
705 | + $shareTime->setTimestamp($this->getInt($prefix.'stime', $data)); |
|
706 | + |
|
707 | + $this->setId($this->get($prefix.'id', $data)) |
|
708 | + ->setShareType($this->getInt($prefix.'share_type', $data)) |
|
709 | + ->setPermissions($this->getInt($prefix.'permissions', $data)) |
|
710 | + ->setItemType($this->get($prefix.'item_type', $data)) |
|
711 | + ->setItemSource($this->getInt($prefix.'item_source', $data)) |
|
712 | + ->setItemTarget($this->get($prefix.'item_target', $data)) |
|
713 | + ->setFileSource($this->getInt($prefix.'file_source', $data)) |
|
714 | + ->setFileTarget($this->get($prefix.'file_target', $data)) |
|
715 | + ->setSharedWith($this->get($prefix.'share_with', $data)) |
|
716 | + ->setSharedBy($this->get($prefix.'uid_initiator', $data)) |
|
717 | + ->setShareOwner($this->get($prefix.'uid_owner', $data)) |
|
718 | + ->setToken($this->get($prefix.'token', $data)) |
|
719 | 719 | ->setShareTime($shareTime); |
720 | 720 | |
721 | 721 | // if (($password = $this->get('personal_password', $data, '')) !== '') { |
@@ -724,8 +724,8 @@ discard block |
||
724 | 724 | // $share->setPassword($this->get('password', $data, '')); |
725 | 725 | // } |
726 | 726 | |
727 | - $this->setChildId($this->getInt($prefix . 'child_id', $data)) |
|
728 | - ->setChildFileTarget($this->get($prefix . 'child_file_target', $data)) |
|
727 | + $this->setChildId($this->getInt($prefix.'child_id', $data)) |
|
728 | + ->setChildFileTarget($this->get($prefix.'child_file_target', $data)) |
|
729 | 729 | ->setProviderId(ShareByCircleProvider::IDENTIFIER) |
730 | 730 | ->setStatus(Ishare::STATUS_ACCEPTED); |
731 | 731 |
@@ -47,7 +47,6 @@ |
||
47 | 47 | use OCA\Circles\Exceptions\FederatedShareBelongingException; |
48 | 48 | use OCA\Circles\Exceptions\FederatedShareNotFoundException; |
49 | 49 | use OCA\Circles\Exceptions\InitiatorNotConfirmedException; |
50 | -use OCA\Circles\Exceptions\JsonException; |
|
51 | 50 | use OCA\Circles\Exceptions\ModelException; |
52 | 51 | use OCA\Circles\Exceptions\OwnerNotFoundException; |
53 | 52 | use OCA\Circles\Exceptions\RemoteInstanceException; |
@@ -251,16 +251,16 @@ |
||
251 | 251 | try { |
252 | 252 | $test = new ReflectionClass($class); |
253 | 253 | } catch (ReflectionException $e) { |
254 | - throw new FederatedEventException('ReflectionException with ' . $class . ': ' . $e->getMessage()); |
|
254 | + throw new FederatedEventException('ReflectionException with '.$class.': '.$e->getMessage()); |
|
255 | 255 | } |
256 | 256 | |
257 | 257 | if (!in_array(IFederatedItem::class, $test->getInterfaceNames())) { |
258 | - throw new FederatedEventException($class . ' does not implements IFederatedItem'); |
|
258 | + throw new FederatedEventException($class.' does not implements IFederatedItem'); |
|
259 | 259 | } |
260 | 260 | |
261 | 261 | $item = OC::$server->get($class); |
262 | 262 | if (!($item instanceof IFederatedItem)) { |
263 | - throw new FederatedEventException($class . ' not an IFederatedItem'); |
|
263 | + throw new FederatedEventException($class.' not an IFederatedItem'); |
|
264 | 264 | } |
265 | 265 | |
266 | 266 | if ($item instanceof IFederatedItemHighSeverity) { |
@@ -211,7 +211,6 @@ |
||
211 | 211 | |
212 | 212 | /** |
213 | 213 | * @param string $circleId |
214 | - * @param IFederatedUser[] $members |
|
215 | 214 | * |
216 | 215 | * @return FederatedUser[] |
217 | 216 | * @throws CircleNotFoundException |
@@ -33,7 +33,6 @@ |
||
33 | 33 | |
34 | 34 | |
35 | 35 | use OCA\Circles\Model\Circle; |
36 | -use OCA\Circles\Model\Federated\FederatedEvent; |
|
37 | 36 | |
38 | 37 | /** |
39 | 38 | * Class ShareService |
@@ -438,8 +438,8 @@ |
||
438 | 438 | |
439 | 439 | /** |
440 | 440 | * @param string $userId |
441 | - * @param $shareType |
|
442 | - * @param Node $node |
|
441 | + * @param integer $shareType |
|
442 | + * @param Node|null $node |
|
443 | 443 | * @param int $limit |
444 | 444 | * @param int $offset |
445 | 445 | * |
@@ -494,7 +494,6 @@ |
||
494 | 494 | |
495 | 495 | /** |
496 | 496 | * Get shares for a given path |
497 | - |
|
498 | 497 | * @param Node $path |
499 | 498 | * |
500 | 499 | * @return IShare[]|null |
@@ -331,19 +331,19 @@ discard block |
||
331 | 331 | */ |
332 | 332 | private function createShare($share) { |
333 | 333 | $this->miscService->log( |
334 | - 'Creating share (1/4) - type: ' . $share->getShareType() . ' - token: ' |
|
335 | - . $share->getToken() . ' - type: ' . $share->getShareType() . ' - with: ' |
|
336 | - . $share->getSharedWith() . ' - permissions: ' . $share->getPermissions(), 0 |
|
334 | + 'Creating share (1/4) - type: '.$share->getShareType().' - token: ' |
|
335 | + . $share->getToken().' - type: '.$share->getShareType().' - with: ' |
|
336 | + . $share->getSharedWith().' - permissions: '.$share->getPermissions(), 0 |
|
337 | 337 | ); |
338 | 338 | |
339 | 339 | $qb = $this->getBaseInsertSql($share); |
340 | - $this->miscService->log('Share creation (2/4) : ' . json_encode($qb->getSQL()), 0); |
|
340 | + $this->miscService->log('Share creation (2/4) : '.json_encode($qb->getSQL()), 0); |
|
341 | 341 | |
342 | 342 | $result = $qb->execute(); |
343 | - $this->miscService->log('Share creation result (3/4) : ' . json_encode($result), 0); |
|
343 | + $this->miscService->log('Share creation result (3/4) : '.json_encode($result), 0); |
|
344 | 344 | |
345 | 345 | $id = $qb->getLastInsertId(); |
346 | - $this->miscService->log('Share created ID (4/4) : ' . $id, 0); |
|
346 | + $this->miscService->log('Share created ID (4/4) : '.$id, 0); |
|
347 | 347 | |
348 | 348 | try { |
349 | 349 | $share->setId($id); |
@@ -590,7 +590,7 @@ discard block |
||
590 | 590 | \OC::$server->getLogger()->log(3, 'deprecated>getShareByToken'); |
591 | 591 | $qb = $this->dbConnection->getQueryBuilder(); |
592 | 592 | |
593 | - $this->miscService->log("Opening share by token '#" . $token . "'", 0); |
|
593 | + $this->miscService->log("Opening share by token '#".$token."'", 0); |
|
594 | 594 | |
595 | 595 | $cursor = $qb->select('*') |
596 | 596 | ->from('share') |
@@ -614,7 +614,7 @@ discard block |
||
614 | 614 | try { |
615 | 615 | $data = $this->getShareByPersonalToken($token); |
616 | 616 | } catch (Exception $e) { |
617 | - $this->miscService->log("Share '#" . $token . "' not found.", 0); |
|
617 | + $this->miscService->log("Share '#".$token."' not found.", 0); |
|
618 | 618 | throw new ShareNotFound('Share not found', $this->l10n->t('Could not find share')); |
619 | 619 | } |
620 | 620 | } |
@@ -623,7 +623,7 @@ discard block |
||
623 | 623 | $share = $this->createShareObject($data); |
624 | 624 | } catch (InvalidShare $e) { |
625 | 625 | $this->miscService->log( |
626 | - "Share Object '#" . $token . "' not created. " . json_encode($data), 0 |
|
626 | + "Share Object '#".$token."' not created. ".json_encode($data), 0 |
|
627 | 627 | ); |
628 | 628 | throw new ShareNotFound('Share not found', $this->l10n->t('Could not find share')); |
629 | 629 | } |
@@ -861,7 +861,7 @@ |
||
861 | 861 | /** |
862 | 862 | * function to generate admin/moderator/member and assigning them their level. |
863 | 863 | * |
864 | - * @param $circleId |
|
864 | + * @param integer $circleId |
|
865 | 865 | * @param bool $isClosed |
866 | 866 | * |
867 | 867 | * @throws QueryException |
@@ -331,7 +331,7 @@ discard block |
||
331 | 331 | } catch (Exception $e) { |
332 | 332 | $this->assertSame( |
333 | 333 | true, false, |
334 | - 'should have returned a MemberIsNotModeratorException - ' . $e->getMessage() |
|
334 | + 'should have returned a MemberIsNotModeratorException - '.$e->getMessage() |
|
335 | 335 | ); |
336 | 336 | } |
337 | 337 | |
@@ -345,7 +345,7 @@ discard block |
||
345 | 345 | } catch (Exception $e) { |
346 | 346 | $this->assertSame( |
347 | 347 | true, false, |
348 | - 'should have returned a MemberIsNotModeratorException - ' . $e->getMessage() |
|
348 | + 'should have returned a MemberIsNotModeratorException - '.$e->getMessage() |
|
349 | 349 | ); |
350 | 350 | } |
351 | 351 |
@@ -7,10 +7,10 @@ |
||
7 | 7 | define('PHPUNIT_RUN', 1); |
8 | 8 | } |
9 | 9 | |
10 | -require_once __DIR__ . '/../../../lib/base.php'; |
|
10 | +require_once __DIR__.'/../../../lib/base.php'; |
|
11 | 11 | |
12 | 12 | // Fix for "Autoload path not allowed: .../tests/lib/testcase.php" |
13 | -\OC::$loader->addValidRoot(OC::$SERVERROOT . '/tests'); |
|
13 | +\OC::$loader->addValidRoot(OC::$SERVERROOT.'/tests'); |
|
14 | 14 | |
15 | 15 | \OC_App::loadApp(Application::APP_ID); |
16 | 16 |
@@ -18,14 +18,14 @@ |
||
18 | 18 | <tr> |
19 | 19 | <th id='headerName' class="hidden column-name"> |
20 | 20 | <div id="headerName-container"> |
21 | - <a class="name sort columntitle" data-sort="name"><span><?php p($l->t( 'Name' )); ?></span><span class="sort-indicator"></span></a> |
|
21 | + <a class="name sort columntitle" data-sort="name"><span><?php p($l->t('Name')); ?></span><span class="sort-indicator"></span></a> |
|
22 | 22 | </div> |
23 | 23 | </th> |
24 | 24 | <th id="headerSize" class="hidden column-size"> |
25 | 25 | <a class="size sort columntitle" data-sort="size"><span><?php p($l->t('Size')); ?></span><span class="sort-indicator"></span></a> |
26 | 26 | </th> |
27 | 27 | <th id="headerDate" class="hidden column-mtime"> |
28 | - <a id="modified" class="columntitle" data-sort="mtime"><span><?php p($l->t( 'Modified' )); ?></span><span class="sort-indicator"></span></a> |
|
28 | + <a id="modified" class="columntitle" data-sort="mtime"><span><?php p($l->t('Modified')); ?></span><span class="sort-indicator"></span></a> |
|
29 | 29 | </th> |
30 | 30 | </tr> |
31 | 31 | </thead> |
@@ -296,7 +296,7 @@ |
||
296 | 296 | * @throws RequestBuilderException |
297 | 297 | */ |
298 | 298 | public function move(IShare $share, $recipient): IShare { |
299 | - OC::$server->getLogger()->log(3, 'CSP > move' . $share->getId() . ' ' . $recipient); |
|
299 | + OC::$server->getLogger()->log(3, 'CSP > move'.$share->getId().' '.$recipient); |
|
300 | 300 | |
301 | 301 | $federatedUser = $this->federatedUserService->getLocalFederatedUser($recipient); |
302 | 302 | $child = $this->shareWrapperService->getChild($share, $federatedUser); |