@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | $gid = $input->getArgument('groupid'); |
66 | 66 | $group = $this->groupManager->get($gid); |
67 | 67 | if ($group) { |
68 | - $output->writeln('<error>Group "' . $gid . '" already exists.</error>'); |
|
68 | + $output->writeln('<error>Group "'.$gid.'" already exists.</error>'); |
|
69 | 69 | return 1; |
70 | 70 | } else { |
71 | 71 | $group = $this->groupManager->createGroup($gid); |
@@ -73,9 +73,9 @@ discard block |
||
73 | 73 | $output->writeln('<error>Could not create group</error>'); |
74 | 74 | return 2; |
75 | 75 | } |
76 | - $output->writeln('Created group "' . $group->getGID() . '"'); |
|
76 | + $output->writeln('Created group "'.$group->getGID().'"'); |
|
77 | 77 | |
78 | - $displayName = trim((string)$input->getOption('display-name')); |
|
78 | + $displayName = trim((string) $input->getOption('display-name')); |
|
79 | 79 | if ($displayName !== '') { |
80 | 80 | $group->setDisplayName($displayName); |
81 | 81 | } |
@@ -36,48 +36,48 @@ |
||
36 | 36 | use Symfony\Component\Console\Output\OutputInterface; |
37 | 37 | |
38 | 38 | class Add extends Base { |
39 | - public function __construct( |
|
40 | - protected IGroupManager $groupManager, |
|
41 | - ) { |
|
42 | - parent::__construct(); |
|
43 | - } |
|
39 | + public function __construct( |
|
40 | + protected IGroupManager $groupManager, |
|
41 | + ) { |
|
42 | + parent::__construct(); |
|
43 | + } |
|
44 | 44 | |
45 | - protected function configure() { |
|
46 | - $this |
|
47 | - ->setName('group:add') |
|
48 | - ->setDescription('Add a group') |
|
49 | - ->addArgument( |
|
50 | - 'groupid', |
|
51 | - InputArgument::REQUIRED, |
|
52 | - 'Group id' |
|
53 | - ) |
|
54 | - ->addOption( |
|
55 | - 'display-name', |
|
56 | - null, |
|
57 | - InputOption::VALUE_REQUIRED, |
|
58 | - 'Group name used in the web UI (can contain any characters)' |
|
59 | - ); |
|
60 | - } |
|
45 | + protected function configure() { |
|
46 | + $this |
|
47 | + ->setName('group:add') |
|
48 | + ->setDescription('Add a group') |
|
49 | + ->addArgument( |
|
50 | + 'groupid', |
|
51 | + InputArgument::REQUIRED, |
|
52 | + 'Group id' |
|
53 | + ) |
|
54 | + ->addOption( |
|
55 | + 'display-name', |
|
56 | + null, |
|
57 | + InputOption::VALUE_REQUIRED, |
|
58 | + 'Group name used in the web UI (can contain any characters)' |
|
59 | + ); |
|
60 | + } |
|
61 | 61 | |
62 | - protected function execute(InputInterface $input, OutputInterface $output): int { |
|
63 | - $gid = $input->getArgument('groupid'); |
|
64 | - $group = $this->groupManager->get($gid); |
|
65 | - if ($group) { |
|
66 | - $output->writeln('<error>Group "' . $gid . '" already exists.</error>'); |
|
67 | - return 1; |
|
68 | - } else { |
|
69 | - $group = $this->groupManager->createGroup($gid); |
|
70 | - if (!$group instanceof IGroup) { |
|
71 | - $output->writeln('<error>Could not create group</error>'); |
|
72 | - return 2; |
|
73 | - } |
|
74 | - $output->writeln('Created group "' . $group->getGID() . '"'); |
|
62 | + protected function execute(InputInterface $input, OutputInterface $output): int { |
|
63 | + $gid = $input->getArgument('groupid'); |
|
64 | + $group = $this->groupManager->get($gid); |
|
65 | + if ($group) { |
|
66 | + $output->writeln('<error>Group "' . $gid . '" already exists.</error>'); |
|
67 | + return 1; |
|
68 | + } else { |
|
69 | + $group = $this->groupManager->createGroup($gid); |
|
70 | + if (!$group instanceof IGroup) { |
|
71 | + $output->writeln('<error>Could not create group</error>'); |
|
72 | + return 2; |
|
73 | + } |
|
74 | + $output->writeln('Created group "' . $group->getGID() . '"'); |
|
75 | 75 | |
76 | - $displayName = trim((string)$input->getOption('display-name')); |
|
77 | - if ($displayName !== '') { |
|
78 | - $group->setDisplayName($displayName); |
|
79 | - } |
|
80 | - } |
|
81 | - return 0; |
|
82 | - } |
|
76 | + $displayName = trim((string)$input->getOption('display-name')); |
|
77 | + if ($displayName !== '') { |
|
78 | + $group->setDisplayName($displayName); |
|
79 | + } |
|
80 | + } |
|
81 | + return 0; |
|
82 | + } |
|
83 | 83 | } |
@@ -32,10 +32,10 @@ |
||
32 | 32 | * @since 18.0.0 |
33 | 33 | */ |
34 | 34 | interface IUrl { |
35 | - /** |
|
36 | - * returns a URL that is related to the entity, e.g. the link to a share |
|
37 | - * |
|
38 | - * @since 18.0.0 |
|
39 | - */ |
|
40 | - public function getUrl(): string; |
|
35 | + /** |
|
36 | + * returns a URL that is related to the entity, e.g. the link to a share |
|
37 | + * |
|
38 | + * @since 18.0.0 |
|
39 | + */ |
|
40 | + public function getUrl(): string; |
|
41 | 41 | } |
@@ -32,10 +32,10 @@ |
||
32 | 32 | * @since 18.0.0 |
33 | 33 | */ |
34 | 34 | interface IDisplayName { |
35 | - /** |
|
36 | - * returns the end user facing name of the object related to the entity |
|
37 | - * |
|
38 | - * @since 18.0.0 |
|
39 | - */ |
|
40 | - public function getDisplayName(): string; |
|
35 | + /** |
|
36 | + * returns the end user facing name of the object related to the entity |
|
37 | + * |
|
38 | + * @since 18.0.0 |
|
39 | + */ |
|
40 | + public function getDisplayName(): string; |
|
41 | 41 | } |
@@ -32,11 +32,11 @@ |
||
32 | 32 | * @since 18.0.0 |
33 | 33 | */ |
34 | 34 | interface IIcon { |
35 | - /** |
|
36 | - * returns a URL to an icon that is related to the entity, for instance |
|
37 | - * a group icon for groups. |
|
38 | - * |
|
39 | - * @since 18.0.0 |
|
40 | - */ |
|
41 | - public function getIconUrl(): string; |
|
35 | + /** |
|
36 | + * returns a URL to an icon that is related to the entity, for instance |
|
37 | + * a group icon for groups. |
|
38 | + * |
|
39 | + * @since 18.0.0 |
|
40 | + */ |
|
41 | + public function getIconUrl(): string; |
|
42 | 42 | } |
@@ -37,24 +37,24 @@ |
||
37 | 37 | * @method string getNodeName() |
38 | 38 | */ |
39 | 39 | class TransferOwnership extends Entity { |
40 | - /** @var string */ |
|
41 | - protected $sourceUser; |
|
40 | + /** @var string */ |
|
41 | + protected $sourceUser; |
|
42 | 42 | |
43 | - /** @var string */ |
|
44 | - protected $targetUser; |
|
43 | + /** @var string */ |
|
44 | + protected $targetUser; |
|
45 | 45 | |
46 | - /** @var integer */ |
|
47 | - protected $fileId; |
|
46 | + /** @var integer */ |
|
47 | + protected $fileId; |
|
48 | 48 | |
49 | - /** @var string */ |
|
50 | - protected $nodeName; |
|
49 | + /** @var string */ |
|
50 | + protected $nodeName; |
|
51 | 51 | |
52 | - public function __construct() { |
|
53 | - $this->addType('sourceUser', 'string'); |
|
54 | - $this->addType('targetUser', 'string'); |
|
55 | - $this->addType('fileId', 'integer'); |
|
56 | - $this->addType('nodeName', 'string'); |
|
57 | - } |
|
52 | + public function __construct() { |
|
53 | + $this->addType('sourceUser', 'string'); |
|
54 | + $this->addType('targetUser', 'string'); |
|
55 | + $this->addType('fileId', 'integer'); |
|
56 | + $this->addType('nodeName', 'string'); |
|
57 | + } |
|
58 | 58 | |
59 | 59 | |
60 | 60 | } |
@@ -34,49 +34,49 @@ |
||
34 | 34 | use Sabre\DAV\INode; |
35 | 35 | |
36 | 36 | class RestoreFolder implements ICollection, IMoveTarget { |
37 | - public function createFile($name, $data = null) { |
|
38 | - throw new Forbidden(); |
|
39 | - } |
|
40 | - |
|
41 | - public function createDirectory($name) { |
|
42 | - throw new Forbidden(); |
|
43 | - } |
|
44 | - |
|
45 | - public function getChild($name) { |
|
46 | - return null; |
|
47 | - } |
|
48 | - |
|
49 | - public function delete() { |
|
50 | - throw new Forbidden(); |
|
51 | - } |
|
52 | - |
|
53 | - public function getName() { |
|
54 | - return 'restore'; |
|
55 | - } |
|
56 | - |
|
57 | - public function setName($name) { |
|
58 | - throw new Forbidden(); |
|
59 | - } |
|
60 | - |
|
61 | - public function getLastModified(): int { |
|
62 | - return 0; |
|
63 | - } |
|
64 | - |
|
65 | - public function getChildren(): array { |
|
66 | - return []; |
|
67 | - } |
|
68 | - |
|
69 | - public function childExists($name): bool { |
|
70 | - return false; |
|
71 | - } |
|
72 | - |
|
73 | - public function moveInto($targetName, $sourcePath, INode $sourceNode): bool { |
|
74 | - if (!($sourceNode instanceof VersionFile)) { |
|
75 | - return false; |
|
76 | - } |
|
77 | - |
|
78 | - $sourceNode->rollBack(); |
|
79 | - return true; |
|
80 | - } |
|
37 | + public function createFile($name, $data = null) { |
|
38 | + throw new Forbidden(); |
|
39 | + } |
|
40 | + |
|
41 | + public function createDirectory($name) { |
|
42 | + throw new Forbidden(); |
|
43 | + } |
|
44 | + |
|
45 | + public function getChild($name) { |
|
46 | + return null; |
|
47 | + } |
|
48 | + |
|
49 | + public function delete() { |
|
50 | + throw new Forbidden(); |
|
51 | + } |
|
52 | + |
|
53 | + public function getName() { |
|
54 | + return 'restore'; |
|
55 | + } |
|
56 | + |
|
57 | + public function setName($name) { |
|
58 | + throw new Forbidden(); |
|
59 | + } |
|
60 | + |
|
61 | + public function getLastModified(): int { |
|
62 | + return 0; |
|
63 | + } |
|
64 | + |
|
65 | + public function getChildren(): array { |
|
66 | + return []; |
|
67 | + } |
|
68 | + |
|
69 | + public function childExists($name): bool { |
|
70 | + return false; |
|
71 | + } |
|
72 | + |
|
73 | + public function moveInto($targetName, $sourcePath, INode $sourceNode): bool { |
|
74 | + if (!($sourceNode instanceof VersionFile)) { |
|
75 | + return false; |
|
76 | + } |
|
77 | + |
|
78 | + $sourceNode->rollBack(); |
|
79 | + return true; |
|
80 | + } |
|
81 | 81 | |
82 | 82 | } |
@@ -27,5 +27,5 @@ |
||
27 | 27 | * @deprecated 18.0.0 use \OCP\EventDispatcher\IEventDispatcher |
28 | 28 | */ |
29 | 29 | abstract class BasicEmitter implements Emitter { |
30 | - use EmitterTrait; |
|
30 | + use EmitterTrait; |
|
31 | 31 | } |
@@ -36,12 +36,12 @@ |
||
36 | 36 | * @since 18.0.0 |
37 | 37 | */ |
38 | 38 | interface IFileCheck extends IEntityCheck { |
39 | - /** |
|
40 | - * @param IStorage $storage |
|
41 | - * @param string $path |
|
42 | - * @param bool $isDir |
|
43 | - * @since 18.0.0 |
|
44 | - */ |
|
45 | - public function setFileInfo(IStorage $storage, string $path, bool $isDir = false): void; |
|
39 | + /** |
|
40 | + * @param IStorage $storage |
|
41 | + * @param string $path |
|
42 | + * @param bool $isDir |
|
43 | + * @since 18.0.0 |
|
44 | + */ |
|
45 | + public function setFileInfo(IStorage $storage, string $path, bool $isDir = false): void; |
|
46 | 46 | |
47 | 47 | } |
@@ -105,7 +105,7 @@ |
||
105 | 105 | $suffix = '…'; |
106 | 106 | } |
107 | 107 | |
108 | - return $prefix . mb_substr($message, $start, $end - $start) . $suffix; |
|
108 | + return $prefix.mb_substr($message, $start, $end - $start).$suffix; |
|
109 | 109 | } |
110 | 110 | |
111 | 111 | } |
@@ -13,92 +13,92 @@ |
||
13 | 13 | * @deprecated 20.0.0 |
14 | 14 | */ |
15 | 15 | class Result extends BaseResult { |
16 | - /** |
|
17 | - * @deprecated 20.0.0 |
|
18 | - */ |
|
19 | - public $type = 'comment'; |
|
20 | - /** |
|
21 | - * @deprecated 20.0.0 |
|
22 | - */ |
|
23 | - public $comment; |
|
24 | - /** |
|
25 | - * @deprecated 20.0.0 |
|
26 | - */ |
|
27 | - public $authorId; |
|
28 | - /** |
|
29 | - * @deprecated 20.0.0 |
|
30 | - */ |
|
31 | - public $path; |
|
32 | - /** |
|
33 | - * @deprecated 20.0.0 |
|
34 | - */ |
|
35 | - public $fileName; |
|
16 | + /** |
|
17 | + * @deprecated 20.0.0 |
|
18 | + */ |
|
19 | + public $type = 'comment'; |
|
20 | + /** |
|
21 | + * @deprecated 20.0.0 |
|
22 | + */ |
|
23 | + public $comment; |
|
24 | + /** |
|
25 | + * @deprecated 20.0.0 |
|
26 | + */ |
|
27 | + public $authorId; |
|
28 | + /** |
|
29 | + * @deprecated 20.0.0 |
|
30 | + */ |
|
31 | + public $path; |
|
32 | + /** |
|
33 | + * @deprecated 20.0.0 |
|
34 | + */ |
|
35 | + public $fileName; |
|
36 | 36 | |
37 | - /** |
|
38 | - * @throws NotFoundException |
|
39 | - * @deprecated 20.0.0 |
|
40 | - */ |
|
41 | - public function __construct( |
|
42 | - string $search, |
|
43 | - IComment $comment, |
|
44 | - /** |
|
45 | - * @deprecated 20.0.0 |
|
46 | - */ |
|
47 | - public string $authorName, |
|
48 | - string $path, |
|
49 | - ) { |
|
50 | - parent::__construct( |
|
51 | - $comment->getId(), |
|
52 | - $comment->getMessage() |
|
53 | - /* @todo , [link to file] */ |
|
54 | - ); |
|
37 | + /** |
|
38 | + * @throws NotFoundException |
|
39 | + * @deprecated 20.0.0 |
|
40 | + */ |
|
41 | + public function __construct( |
|
42 | + string $search, |
|
43 | + IComment $comment, |
|
44 | + /** |
|
45 | + * @deprecated 20.0.0 |
|
46 | + */ |
|
47 | + public string $authorName, |
|
48 | + string $path, |
|
49 | + ) { |
|
50 | + parent::__construct( |
|
51 | + $comment->getId(), |
|
52 | + $comment->getMessage() |
|
53 | + /* @todo , [link to file] */ |
|
54 | + ); |
|
55 | 55 | |
56 | - $this->comment = $this->getRelevantMessagePart($comment->getMessage(), $search); |
|
57 | - $this->authorId = $comment->getActorId(); |
|
58 | - $this->fileName = basename($path); |
|
59 | - $this->path = $this->getVisiblePath($path); |
|
60 | - } |
|
56 | + $this->comment = $this->getRelevantMessagePart($comment->getMessage(), $search); |
|
57 | + $this->authorId = $comment->getActorId(); |
|
58 | + $this->fileName = basename($path); |
|
59 | + $this->path = $this->getVisiblePath($path); |
|
60 | + } |
|
61 | 61 | |
62 | - /** |
|
63 | - * @throws NotFoundException |
|
64 | - */ |
|
65 | - protected function getVisiblePath(string $path): string { |
|
66 | - $segments = explode('/', trim($path, '/'), 3); |
|
62 | + /** |
|
63 | + * @throws NotFoundException |
|
64 | + */ |
|
65 | + protected function getVisiblePath(string $path): string { |
|
66 | + $segments = explode('/', trim($path, '/'), 3); |
|
67 | 67 | |
68 | - if (!isset($segments[2])) { |
|
69 | - throw new NotFoundException('Path not inside visible section'); |
|
70 | - } |
|
68 | + if (!isset($segments[2])) { |
|
69 | + throw new NotFoundException('Path not inside visible section'); |
|
70 | + } |
|
71 | 71 | |
72 | - return $segments[2]; |
|
73 | - } |
|
72 | + return $segments[2]; |
|
73 | + } |
|
74 | 74 | |
75 | - /** |
|
76 | - * @throws NotFoundException |
|
77 | - */ |
|
78 | - protected function getRelevantMessagePart(string $message, string $search): string { |
|
79 | - $start = mb_stripos($message, $search); |
|
80 | - if ($start === false) { |
|
81 | - throw new NotFoundException('Comment section not found'); |
|
82 | - } |
|
75 | + /** |
|
76 | + * @throws NotFoundException |
|
77 | + */ |
|
78 | + protected function getRelevantMessagePart(string $message, string $search): string { |
|
79 | + $start = mb_stripos($message, $search); |
|
80 | + if ($start === false) { |
|
81 | + throw new NotFoundException('Comment section not found'); |
|
82 | + } |
|
83 | 83 | |
84 | - $end = $start + mb_strlen($search); |
|
84 | + $end = $start + mb_strlen($search); |
|
85 | 85 | |
86 | - if ($start <= 25) { |
|
87 | - $start = 0; |
|
88 | - $prefix = ''; |
|
89 | - } else { |
|
90 | - $start -= 25; |
|
91 | - $prefix = '…'; |
|
92 | - } |
|
86 | + if ($start <= 25) { |
|
87 | + $start = 0; |
|
88 | + $prefix = ''; |
|
89 | + } else { |
|
90 | + $start -= 25; |
|
91 | + $prefix = '…'; |
|
92 | + } |
|
93 | 93 | |
94 | - if ((mb_strlen($message) - $end) <= 25) { |
|
95 | - $end = mb_strlen($message); |
|
96 | - $suffix = ''; |
|
97 | - } else { |
|
98 | - $end += 25; |
|
99 | - $suffix = '…'; |
|
100 | - } |
|
94 | + if ((mb_strlen($message) - $end) <= 25) { |
|
95 | + $end = mb_strlen($message); |
|
96 | + $suffix = ''; |
|
97 | + } else { |
|
98 | + $end += 25; |
|
99 | + $suffix = '…'; |
|
100 | + } |
|
101 | 101 | |
102 | - return $prefix . mb_substr($message, $start, $end - $start) . $suffix; |
|
103 | - } |
|
102 | + return $prefix . mb_substr($message, $start, $end - $start) . $suffix; |
|
103 | + } |
|
104 | 104 | } |