@@ -60,11 +60,11 @@ |
||
60 | 60 | // at least on PHP 5.6 usort turned out to be not stable. So we add |
61 | 61 | // the current index to the value and compare it on a draw |
62 | 62 | $i = 0; |
63 | - $workArray = array_map(function ($element) use (&$i) { |
|
63 | + $workArray = array_map(function($element) use (&$i) { |
|
64 | 64 | return [$i++, $element]; |
65 | 65 | }, $byType); |
66 | 66 | |
67 | - usort($workArray, function ($a, $b) use ($commenters, $type) { |
|
67 | + usort($workArray, function($a, $b) use ($commenters, $type) { |
|
68 | 68 | $r = $this->compare($a[1], $b[1], $commenters[$type]); |
69 | 69 | if ($r === 0) { |
70 | 70 | $r = $a[0] - $b[0]; |
@@ -9,83 +9,83 @@ |
||
9 | 9 | use OCP\Comments\ICommentsManager; |
10 | 10 | |
11 | 11 | class CommentersSorter implements ISorter { |
12 | - public function __construct( |
|
13 | - private ICommentsManager $commentsManager, |
|
14 | - ) { |
|
15 | - } |
|
12 | + public function __construct( |
|
13 | + private ICommentsManager $commentsManager, |
|
14 | + ) { |
|
15 | + } |
|
16 | 16 | |
17 | - public function getId(): string { |
|
18 | - return 'commenters'; |
|
19 | - } |
|
17 | + public function getId(): string { |
|
18 | + return 'commenters'; |
|
19 | + } |
|
20 | 20 | |
21 | - /** |
|
22 | - * Sorts people who commented on the given item atop (descelating) of the |
|
23 | - * others |
|
24 | - * |
|
25 | - * @param array &$sortArray |
|
26 | - * @param array $context |
|
27 | - */ |
|
28 | - public function sort(array &$sortArray, array $context): void { |
|
29 | - $commenters = $this->retrieveCommentsInformation($context['itemType'], $context['itemId']); |
|
30 | - if (count($commenters) === 0) { |
|
31 | - return; |
|
32 | - } |
|
21 | + /** |
|
22 | + * Sorts people who commented on the given item atop (descelating) of the |
|
23 | + * others |
|
24 | + * |
|
25 | + * @param array &$sortArray |
|
26 | + * @param array $context |
|
27 | + */ |
|
28 | + public function sort(array &$sortArray, array $context): void { |
|
29 | + $commenters = $this->retrieveCommentsInformation($context['itemType'], $context['itemId']); |
|
30 | + if (count($commenters) === 0) { |
|
31 | + return; |
|
32 | + } |
|
33 | 33 | |
34 | - foreach ($sortArray as $type => &$byType) { |
|
35 | - if (!isset($commenters[$type])) { |
|
36 | - continue; |
|
37 | - } |
|
34 | + foreach ($sortArray as $type => &$byType) { |
|
35 | + if (!isset($commenters[$type])) { |
|
36 | + continue; |
|
37 | + } |
|
38 | 38 | |
39 | - // at least on PHP 5.6 usort turned out to be not stable. So we add |
|
40 | - // the current index to the value and compare it on a draw |
|
41 | - $i = 0; |
|
42 | - $workArray = array_map(function ($element) use (&$i) { |
|
43 | - return [$i++, $element]; |
|
44 | - }, $byType); |
|
39 | + // at least on PHP 5.6 usort turned out to be not stable. So we add |
|
40 | + // the current index to the value and compare it on a draw |
|
41 | + $i = 0; |
|
42 | + $workArray = array_map(function ($element) use (&$i) { |
|
43 | + return [$i++, $element]; |
|
44 | + }, $byType); |
|
45 | 45 | |
46 | - usort($workArray, function ($a, $b) use ($commenters, $type) { |
|
47 | - $r = $this->compare($a[1], $b[1], $commenters[$type]); |
|
48 | - if ($r === 0) { |
|
49 | - $r = $a[0] - $b[0]; |
|
50 | - } |
|
51 | - return $r; |
|
52 | - }); |
|
46 | + usort($workArray, function ($a, $b) use ($commenters, $type) { |
|
47 | + $r = $this->compare($a[1], $b[1], $commenters[$type]); |
|
48 | + if ($r === 0) { |
|
49 | + $r = $a[0] - $b[0]; |
|
50 | + } |
|
51 | + return $r; |
|
52 | + }); |
|
53 | 53 | |
54 | - // and remove the index values again |
|
55 | - $byType = array_column($workArray, 1); |
|
56 | - } |
|
57 | - } |
|
54 | + // and remove the index values again |
|
55 | + $byType = array_column($workArray, 1); |
|
56 | + } |
|
57 | + } |
|
58 | 58 | |
59 | - /** |
|
60 | - * @return array<string, array<string, int>> |
|
61 | - */ |
|
62 | - protected function retrieveCommentsInformation(string $type, string $id): array { |
|
63 | - $comments = $this->commentsManager->getForObject($type, $id); |
|
64 | - if (count($comments) === 0) { |
|
65 | - return []; |
|
66 | - } |
|
59 | + /** |
|
60 | + * @return array<string, array<string, int>> |
|
61 | + */ |
|
62 | + protected function retrieveCommentsInformation(string $type, string $id): array { |
|
63 | + $comments = $this->commentsManager->getForObject($type, $id); |
|
64 | + if (count($comments) === 0) { |
|
65 | + return []; |
|
66 | + } |
|
67 | 67 | |
68 | - $actors = []; |
|
69 | - foreach ($comments as $comment) { |
|
70 | - if (!isset($actors[$comment->getActorType()])) { |
|
71 | - $actors[$comment->getActorType()] = []; |
|
72 | - } |
|
73 | - if (!isset($actors[$comment->getActorType()][$comment->getActorId()])) { |
|
74 | - $actors[$comment->getActorType()][$comment->getActorId()] = 1; |
|
75 | - } else { |
|
76 | - $actors[$comment->getActorType()][$comment->getActorId()]++; |
|
77 | - } |
|
78 | - } |
|
79 | - return $actors; |
|
80 | - } |
|
68 | + $actors = []; |
|
69 | + foreach ($comments as $comment) { |
|
70 | + if (!isset($actors[$comment->getActorType()])) { |
|
71 | + $actors[$comment->getActorType()] = []; |
|
72 | + } |
|
73 | + if (!isset($actors[$comment->getActorType()][$comment->getActorId()])) { |
|
74 | + $actors[$comment->getActorType()][$comment->getActorId()] = 1; |
|
75 | + } else { |
|
76 | + $actors[$comment->getActorType()][$comment->getActorId()]++; |
|
77 | + } |
|
78 | + } |
|
79 | + return $actors; |
|
80 | + } |
|
81 | 81 | |
82 | - protected function compare(array $a, array $b, array $commenters): int { |
|
83 | - $a = $a['value']['shareWith']; |
|
84 | - $b = $b['value']['shareWith']; |
|
82 | + protected function compare(array $a, array $b, array $commenters): int { |
|
83 | + $a = $a['value']['shareWith']; |
|
84 | + $b = $b['value']['shareWith']; |
|
85 | 85 | |
86 | - $valueA = $commenters[$a] ?? 0; |
|
87 | - $valueB = $commenters[$b] ?? 0; |
|
86 | + $valueA = $commenters[$a] ?? 0; |
|
87 | + $valueB = $commenters[$b] ?? 0; |
|
88 | 88 | |
89 | - return $valueB - $valueA; |
|
90 | - } |
|
89 | + return $valueB - $valueA; |
|
90 | + } |
|
91 | 91 | } |
@@ -30,7 +30,7 @@ |
||
30 | 30 | <h2><?php p($l->t('Connect to your account')) ?></h2> |
31 | 31 | <p class="info"> |
32 | 32 | <?php print_unescaped($l->t('Please log in before granting %1$s access to your %2$s account.', [ |
33 | - '<strong>' . \OCP\Util::sanitizeHTML($_['client']) . '</strong>', |
|
33 | + '<strong>'.\OCP\Util::sanitizeHTML($_['client']).'</strong>', |
|
34 | 34 | \OCP\Util::sanitizeHTML($_['instanceName']) |
35 | 35 | ])) ?> |
36 | 36 | </p> |
@@ -31,9 +31,9 @@ |
||
31 | 31 | <h2><?php p($l->t('Connect to your account')) ?></h2> |
32 | 32 | <p class="info"> |
33 | 33 | <?php print_unescaped($l->t('Please log in before granting %1$s access to your %2$s account.', [ |
34 | - '<strong>' . \OCP\Util::sanitizeHTML($_['client']) . '</strong>', |
|
35 | - \OCP\Util::sanitizeHTML($_['instanceName']) |
|
36 | - ])) ?> |
|
34 | + '<strong>' . \OCP\Util::sanitizeHTML($_['client']) . '</strong>', |
|
35 | + \OCP\Util::sanitizeHTML($_['instanceName']) |
|
36 | + ])) ?> |
|
37 | 37 | </p> |
38 | 38 | |
39 | 39 | <div class="notecard warning"> |
@@ -6,7 +6,7 @@ |
||
6 | 6 | <p><?php p($error['error']) ?></p> |
7 | 7 | <?php if (isset($error['hint']) && $error['hint']): ?> |
8 | 8 | <p class='hint'><?php p($error['hint']) ?></p> |
9 | - <?php endif;?> |
|
9 | + <?php endif; ?> |
|
10 | 10 | </li> |
11 | 11 | <?php endforeach ?> |
12 | 12 | </ul> |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | |
68 | 68 | if (count($configNames) > 1) { |
69 | 69 | if ($input->hasParameterOption('--error-if-not-exists') && !in_array($configName, $this->systemConfig->getKeys())) { |
70 | - $output->writeln('<error>System config ' . implode(' => ', $configNames) . ' could not be deleted because it did not exist</error>'); |
|
70 | + $output->writeln('<error>System config '.implode(' => ', $configNames).' could not be deleted because it did not exist</error>'); |
|
71 | 71 | return 1; |
72 | 72 | } |
73 | 73 | |
@@ -76,21 +76,21 @@ discard block |
||
76 | 76 | try { |
77 | 77 | $value = $this->removeSubValue(array_slice($configNames, 1), $value, $input->hasParameterOption('--error-if-not-exists')); |
78 | 78 | } catch (\UnexpectedValueException $e) { |
79 | - $output->writeln('<error>System config ' . implode(' => ', $configNames) . ' could not be deleted because it did not exist</error>'); |
|
79 | + $output->writeln('<error>System config '.implode(' => ', $configNames).' could not be deleted because it did not exist</error>'); |
|
80 | 80 | return 1; |
81 | 81 | } |
82 | 82 | |
83 | 83 | $this->systemConfig->setValue($configName, $value); |
84 | - $output->writeln('<info>System config value ' . implode(' => ', $configNames) . ' deleted</info>'); |
|
84 | + $output->writeln('<info>System config value '.implode(' => ', $configNames).' deleted</info>'); |
|
85 | 85 | return 0; |
86 | 86 | } else { |
87 | 87 | if ($input->hasParameterOption('--error-if-not-exists') && !in_array($configName, $this->systemConfig->getKeys())) { |
88 | - $output->writeln('<error>System config ' . $configName . ' could not be deleted because it did not exist</error>'); |
|
88 | + $output->writeln('<error>System config '.$configName.' could not be deleted because it did not exist</error>'); |
|
89 | 89 | return 1; |
90 | 90 | } |
91 | 91 | |
92 | 92 | $this->systemConfig->deleteValue($configName); |
93 | - $output->writeln('<info>System config value ' . $configName . ' deleted</info>'); |
|
93 | + $output->writeln('<info>System config value '.$configName.' deleted</info>'); |
|
94 | 94 | return 0; |
95 | 95 | } |
96 | 96 | } |
@@ -30,83 +30,83 @@ |
||
30 | 30 | use Symfony\Component\Console\Output\OutputInterface; |
31 | 31 | |
32 | 32 | class DeleteConfig extends Base { |
33 | - public function __construct( |
|
34 | - SystemConfig $systemConfig, |
|
35 | - ) { |
|
36 | - parent::__construct($systemConfig); |
|
37 | - } |
|
33 | + public function __construct( |
|
34 | + SystemConfig $systemConfig, |
|
35 | + ) { |
|
36 | + parent::__construct($systemConfig); |
|
37 | + } |
|
38 | 38 | |
39 | - protected function configure() { |
|
40 | - parent::configure(); |
|
39 | + protected function configure() { |
|
40 | + parent::configure(); |
|
41 | 41 | |
42 | - $this |
|
43 | - ->setName('config:system:delete') |
|
44 | - ->setDescription('Delete a system config value') |
|
45 | - ->addArgument( |
|
46 | - 'name', |
|
47 | - InputArgument::REQUIRED | InputArgument::IS_ARRAY, |
|
48 | - 'Name of the config to delete, specify multiple for array parameter' |
|
49 | - ) |
|
50 | - ->addOption( |
|
51 | - 'error-if-not-exists', |
|
52 | - null, |
|
53 | - InputOption::VALUE_NONE, |
|
54 | - 'Checks whether the config exists before deleting it' |
|
55 | - ) |
|
56 | - ; |
|
57 | - } |
|
42 | + $this |
|
43 | + ->setName('config:system:delete') |
|
44 | + ->setDescription('Delete a system config value') |
|
45 | + ->addArgument( |
|
46 | + 'name', |
|
47 | + InputArgument::REQUIRED | InputArgument::IS_ARRAY, |
|
48 | + 'Name of the config to delete, specify multiple for array parameter' |
|
49 | + ) |
|
50 | + ->addOption( |
|
51 | + 'error-if-not-exists', |
|
52 | + null, |
|
53 | + InputOption::VALUE_NONE, |
|
54 | + 'Checks whether the config exists before deleting it' |
|
55 | + ) |
|
56 | + ; |
|
57 | + } |
|
58 | 58 | |
59 | - protected function execute(InputInterface $input, OutputInterface $output): int { |
|
60 | - $configNames = $input->getArgument('name'); |
|
61 | - $configName = $configNames[0]; |
|
59 | + protected function execute(InputInterface $input, OutputInterface $output): int { |
|
60 | + $configNames = $input->getArgument('name'); |
|
61 | + $configName = $configNames[0]; |
|
62 | 62 | |
63 | - if (count($configNames) > 1) { |
|
64 | - if ($input->hasParameterOption('--error-if-not-exists') && !in_array($configName, $this->systemConfig->getKeys())) { |
|
65 | - $output->writeln('<error>System config ' . implode(' => ', $configNames) . ' could not be deleted because it did not exist</error>'); |
|
66 | - return 1; |
|
67 | - } |
|
63 | + if (count($configNames) > 1) { |
|
64 | + if ($input->hasParameterOption('--error-if-not-exists') && !in_array($configName, $this->systemConfig->getKeys())) { |
|
65 | + $output->writeln('<error>System config ' . implode(' => ', $configNames) . ' could not be deleted because it did not exist</error>'); |
|
66 | + return 1; |
|
67 | + } |
|
68 | 68 | |
69 | - $value = $this->systemConfig->getValue($configName); |
|
69 | + $value = $this->systemConfig->getValue($configName); |
|
70 | 70 | |
71 | - try { |
|
72 | - $value = $this->removeSubValue(array_slice($configNames, 1), $value, $input->hasParameterOption('--error-if-not-exists')); |
|
73 | - } catch (\UnexpectedValueException $e) { |
|
74 | - $output->writeln('<error>System config ' . implode(' => ', $configNames) . ' could not be deleted because it did not exist</error>'); |
|
75 | - return 1; |
|
76 | - } |
|
71 | + try { |
|
72 | + $value = $this->removeSubValue(array_slice($configNames, 1), $value, $input->hasParameterOption('--error-if-not-exists')); |
|
73 | + } catch (\UnexpectedValueException $e) { |
|
74 | + $output->writeln('<error>System config ' . implode(' => ', $configNames) . ' could not be deleted because it did not exist</error>'); |
|
75 | + return 1; |
|
76 | + } |
|
77 | 77 | |
78 | - $this->systemConfig->setValue($configName, $value); |
|
79 | - $output->writeln('<info>System config value ' . implode(' => ', $configNames) . ' deleted</info>'); |
|
80 | - return 0; |
|
81 | - } else { |
|
82 | - if ($input->hasParameterOption('--error-if-not-exists') && !in_array($configName, $this->systemConfig->getKeys())) { |
|
83 | - $output->writeln('<error>System config ' . $configName . ' could not be deleted because it did not exist</error>'); |
|
84 | - return 1; |
|
85 | - } |
|
78 | + $this->systemConfig->setValue($configName, $value); |
|
79 | + $output->writeln('<info>System config value ' . implode(' => ', $configNames) . ' deleted</info>'); |
|
80 | + return 0; |
|
81 | + } else { |
|
82 | + if ($input->hasParameterOption('--error-if-not-exists') && !in_array($configName, $this->systemConfig->getKeys())) { |
|
83 | + $output->writeln('<error>System config ' . $configName . ' could not be deleted because it did not exist</error>'); |
|
84 | + return 1; |
|
85 | + } |
|
86 | 86 | |
87 | - $this->systemConfig->deleteValue($configName); |
|
88 | - $output->writeln('<info>System config value ' . $configName . ' deleted</info>'); |
|
89 | - return 0; |
|
90 | - } |
|
91 | - } |
|
87 | + $this->systemConfig->deleteValue($configName); |
|
88 | + $output->writeln('<info>System config value ' . $configName . ' deleted</info>'); |
|
89 | + return 0; |
|
90 | + } |
|
91 | + } |
|
92 | 92 | |
93 | - protected function removeSubValue($keys, $currentValue, $throwError) { |
|
94 | - $nextKey = array_shift($keys); |
|
93 | + protected function removeSubValue($keys, $currentValue, $throwError) { |
|
94 | + $nextKey = array_shift($keys); |
|
95 | 95 | |
96 | - if (is_array($currentValue)) { |
|
97 | - if (isset($currentValue[$nextKey])) { |
|
98 | - if (empty($keys)) { |
|
99 | - unset($currentValue[$nextKey]); |
|
100 | - } else { |
|
101 | - $currentValue[$nextKey] = $this->removeSubValue($keys, $currentValue[$nextKey], $throwError); |
|
102 | - } |
|
103 | - } elseif ($throwError) { |
|
104 | - throw new \UnexpectedValueException('Config parameter does not exist'); |
|
105 | - } |
|
106 | - } elseif ($throwError) { |
|
107 | - throw new \UnexpectedValueException('Config parameter does not exist'); |
|
108 | - } |
|
96 | + if (is_array($currentValue)) { |
|
97 | + if (isset($currentValue[$nextKey])) { |
|
98 | + if (empty($keys)) { |
|
99 | + unset($currentValue[$nextKey]); |
|
100 | + } else { |
|
101 | + $currentValue[$nextKey] = $this->removeSubValue($keys, $currentValue[$nextKey], $throwError); |
|
102 | + } |
|
103 | + } elseif ($throwError) { |
|
104 | + throw new \UnexpectedValueException('Config parameter does not exist'); |
|
105 | + } |
|
106 | + } elseif ($throwError) { |
|
107 | + throw new \UnexpectedValueException('Config parameter does not exist'); |
|
108 | + } |
|
109 | 109 | |
110 | - return $currentValue; |
|
111 | - } |
|
110 | + return $currentValue; |
|
111 | + } |
|
112 | 112 | } |
@@ -52,10 +52,10 @@ |
||
52 | 52 | */ |
53 | 53 | public function xmlSerialize(Writer $writer) { |
54 | 54 | foreach ($this->shares as $share) { |
55 | - $writer->startElement('{' . self::NS_NEXTCLOUD . '}sharee'); |
|
56 | - $writer->writeElement('{' . self::NS_NEXTCLOUD . '}id', $share->getSharedWith()); |
|
57 | - $writer->writeElement('{' . self::NS_NEXTCLOUD . '}display-name', $share->getSharedWithDisplayName()); |
|
58 | - $writer->writeElement('{' . self::NS_NEXTCLOUD . '}type', $share->getShareType()); |
|
55 | + $writer->startElement('{'.self::NS_NEXTCLOUD.'}sharee'); |
|
56 | + $writer->writeElement('{'.self::NS_NEXTCLOUD.'}id', $share->getSharedWith()); |
|
57 | + $writer->writeElement('{'.self::NS_NEXTCLOUD.'}display-name', $share->getSharedWithDisplayName()); |
|
58 | + $writer->writeElement('{'.self::NS_NEXTCLOUD.'}type', $share->getShareType()); |
|
59 | 59 | $writer->endElement(); |
60 | 60 | } |
61 | 61 | } |
@@ -16,27 +16,27 @@ |
||
16 | 16 | * This property contains multiple "sharee" elements, each containing a share sharee |
17 | 17 | */ |
18 | 18 | class ShareeList implements XmlSerializable { |
19 | - public const NS_NEXTCLOUD = 'http://nextcloud.org/ns'; |
|
19 | + public const NS_NEXTCLOUD = 'http://nextcloud.org/ns'; |
|
20 | 20 | |
21 | - public function __construct( |
|
22 | - /** @var IShare[] */ |
|
23 | - private array $shares, |
|
24 | - ) { |
|
25 | - } |
|
21 | + public function __construct( |
|
22 | + /** @var IShare[] */ |
|
23 | + private array $shares, |
|
24 | + ) { |
|
25 | + } |
|
26 | 26 | |
27 | - /** |
|
28 | - * The xmlSerialize method is called during xml writing. |
|
29 | - * |
|
30 | - * @param Writer $writer |
|
31 | - * @return void |
|
32 | - */ |
|
33 | - public function xmlSerialize(Writer $writer) { |
|
34 | - foreach ($this->shares as $share) { |
|
35 | - $writer->startElement('{' . self::NS_NEXTCLOUD . '}sharee'); |
|
36 | - $writer->writeElement('{' . self::NS_NEXTCLOUD . '}id', $share->getSharedWith()); |
|
37 | - $writer->writeElement('{' . self::NS_NEXTCLOUD . '}display-name', $share->getSharedWithDisplayName()); |
|
38 | - $writer->writeElement('{' . self::NS_NEXTCLOUD . '}type', $share->getShareType()); |
|
39 | - $writer->endElement(); |
|
40 | - } |
|
41 | - } |
|
27 | + /** |
|
28 | + * The xmlSerialize method is called during xml writing. |
|
29 | + * |
|
30 | + * @param Writer $writer |
|
31 | + * @return void |
|
32 | + */ |
|
33 | + public function xmlSerialize(Writer $writer) { |
|
34 | + foreach ($this->shares as $share) { |
|
35 | + $writer->startElement('{' . self::NS_NEXTCLOUD . '}sharee'); |
|
36 | + $writer->writeElement('{' . self::NS_NEXTCLOUD . '}id', $share->getSharedWith()); |
|
37 | + $writer->writeElement('{' . self::NS_NEXTCLOUD . '}display-name', $share->getSharedWithDisplayName()); |
|
38 | + $writer->writeElement('{' . self::NS_NEXTCLOUD . '}type', $share->getShareType()); |
|
39 | + $writer->endElement(); |
|
40 | + } |
|
41 | + } |
|
42 | 42 | } |
@@ -29,26 +29,26 @@ |
||
29 | 29 | use Sabre\DAV\Server; |
30 | 30 | |
31 | 31 | class PasswordLoginForbidden extends NotAuthenticated { |
32 | - public const NS_OWNCLOUD = 'http://owncloud.org/ns'; |
|
32 | + public const NS_OWNCLOUD = 'http://owncloud.org/ns'; |
|
33 | 33 | |
34 | - public function getHTTPCode() { |
|
35 | - return 401; |
|
36 | - } |
|
34 | + public function getHTTPCode() { |
|
35 | + return 401; |
|
36 | + } |
|
37 | 37 | |
38 | - /** |
|
39 | - * This method allows the exception to include additional information |
|
40 | - * into the WebDAV error response |
|
41 | - * |
|
42 | - * @param Server $server |
|
43 | - * @param DOMElement $errorNode |
|
44 | - * @return void |
|
45 | - */ |
|
46 | - public function serialize(Server $server, DOMElement $errorNode) { |
|
38 | + /** |
|
39 | + * This method allows the exception to include additional information |
|
40 | + * into the WebDAV error response |
|
41 | + * |
|
42 | + * @param Server $server |
|
43 | + * @param DOMElement $errorNode |
|
44 | + * @return void |
|
45 | + */ |
|
46 | + public function serialize(Server $server, DOMElement $errorNode) { |
|
47 | 47 | |
48 | - // set ownCloud namespace |
|
49 | - $errorNode->setAttribute('xmlns:o', self::NS_OWNCLOUD); |
|
48 | + // set ownCloud namespace |
|
49 | + $errorNode->setAttribute('xmlns:o', self::NS_OWNCLOUD); |
|
50 | 50 | |
51 | - $error = $errorNode->ownerDocument->createElementNS('o:', 'o:hint', 'password login forbidden'); |
|
52 | - $errorNode->appendChild($error); |
|
53 | - } |
|
51 | + $error = $errorNode->ownerDocument->createElementNS('o:', 'o:hint', 'password login forbidden'); |
|
52 | + $errorNode->appendChild($error); |
|
53 | + } |
|
54 | 54 | } |
@@ -30,13 +30,13 @@ |
||
30 | 30 | */ |
31 | 31 | class Collection extends \Sabre\CalDAV\Principal\Collection { |
32 | 32 | |
33 | - /** |
|
34 | - * Returns a child object based on principal information |
|
35 | - * |
|
36 | - * @param array $principalInfo |
|
37 | - * @return User |
|
38 | - */ |
|
39 | - public function getChildForPrincipal(array $principalInfo) { |
|
40 | - return new User($this->principalBackend, $principalInfo); |
|
41 | - } |
|
33 | + /** |
|
34 | + * Returns a child object based on principal information |
|
35 | + * |
|
36 | + * @param array $principalInfo |
|
37 | + * @return User |
|
38 | + */ |
|
39 | + public function getChildForPrincipal(array $principalInfo) { |
|
40 | + return new User($this->principalBackend, $principalInfo); |
|
41 | + } |
|
42 | 42 | } |
@@ -30,25 +30,25 @@ |
||
30 | 30 | */ |
31 | 31 | class User extends \Sabre\CalDAV\Principal\User { |
32 | 32 | |
33 | - /** |
|
34 | - * Returns a list of ACE's for this node. |
|
35 | - * |
|
36 | - * Each ACE has the following properties: |
|
37 | - * * 'privilege', a string such as {DAV:}read or {DAV:}write. These are |
|
38 | - * currently the only supported privileges |
|
39 | - * * 'principal', a url to the principal who owns the node |
|
40 | - * * 'protected' (optional), indicating that this ACE is not allowed to |
|
41 | - * be updated. |
|
42 | - * |
|
43 | - * @return array |
|
44 | - */ |
|
45 | - public function getACL() { |
|
46 | - $acl = parent::getACL(); |
|
47 | - $acl[] = [ |
|
48 | - 'privilege' => '{DAV:}read', |
|
49 | - 'principal' => '{DAV:}authenticated', |
|
50 | - 'protected' => true, |
|
51 | - ]; |
|
52 | - return $acl; |
|
53 | - } |
|
33 | + /** |
|
34 | + * Returns a list of ACE's for this node. |
|
35 | + * |
|
36 | + * Each ACE has the following properties: |
|
37 | + * * 'privilege', a string such as {DAV:}read or {DAV:}write. These are |
|
38 | + * currently the only supported privileges |
|
39 | + * * 'principal', a url to the principal who owns the node |
|
40 | + * * 'protected' (optional), indicating that this ACE is not allowed to |
|
41 | + * be updated. |
|
42 | + * |
|
43 | + * @return array |
|
44 | + */ |
|
45 | + public function getACL() { |
|
46 | + $acl = parent::getACL(); |
|
47 | + $acl[] = [ |
|
48 | + 'privilege' => '{DAV:}read', |
|
49 | + 'principal' => '{DAV:}authenticated', |
|
50 | + 'protected' => true, |
|
51 | + ]; |
|
52 | + return $acl; |
|
53 | + } |
|
54 | 54 | } |
@@ -32,17 +32,17 @@ |
||
32 | 32 | |
33 | 33 | class OffsetFilter implements XmlDeserializable { |
34 | 34 | |
35 | - /** |
|
36 | - * @param Reader $reader |
|
37 | - * @throws BadRequest |
|
38 | - * @return int |
|
39 | - */ |
|
40 | - public static function xmlDeserialize(Reader $reader) { |
|
41 | - $value = $reader->parseInnerTree(); |
|
42 | - if (!is_int($value) && !is_string($value)) { |
|
43 | - throw new BadRequest('The {' . SearchPlugin::NS_Nextcloud . '}offset has illegal value'); |
|
44 | - } |
|
35 | + /** |
|
36 | + * @param Reader $reader |
|
37 | + * @throws BadRequest |
|
38 | + * @return int |
|
39 | + */ |
|
40 | + public static function xmlDeserialize(Reader $reader) { |
|
41 | + $value = $reader->parseInnerTree(); |
|
42 | + if (!is_int($value) && !is_string($value)) { |
|
43 | + throw new BadRequest('The {' . SearchPlugin::NS_Nextcloud . '}offset has illegal value'); |
|
44 | + } |
|
45 | 45 | |
46 | - return (int)$value; |
|
47 | - } |
|
46 | + return (int)$value; |
|
47 | + } |
|
48 | 48 | } |
@@ -40,9 +40,9 @@ |
||
40 | 40 | public static function xmlDeserialize(Reader $reader) { |
41 | 41 | $value = $reader->parseInnerTree(); |
42 | 42 | if (!is_int($value) && !is_string($value)) { |
43 | - throw new BadRequest('The {' . SearchPlugin::NS_Nextcloud . '}offset has illegal value'); |
|
43 | + throw new BadRequest('The {'.SearchPlugin::NS_Nextcloud.'}offset has illegal value'); |
|
44 | 44 | } |
45 | 45 | |
46 | - return (int)$value; |
|
46 | + return (int) $value; |
|
47 | 47 | } |
48 | 48 | } |