@@ -94,7 +94,7 @@ |
||
| 94 | 94 | $this->config->setAppValue($this->appName, 'generateBirthdayCalendar', 'yes'); |
| 95 | 95 | |
| 96 | 96 | // add background job for each user |
| 97 | - $this->userManager->callForSeenUsers(function (IUser $user) { |
|
| 97 | + $this->userManager->callForSeenUsers(function(IUser $user) { |
|
| 98 | 98 | $this->jobList->add(GenerateBirthdayCalendarBackgroundJob::class, [ |
| 99 | 99 | 'userId' => $user->getUID(), |
| 100 | 100 | ]); |
@@ -113,12 +113,12 @@ discard block |
||
| 113 | 113 | $this->server = $server; |
| 114 | 114 | |
| 115 | 115 | $this->server->on('method:POST', [$this, 'httpPost']); |
| 116 | - $this->server->on('propFind', [$this, 'propFind']); |
|
| 116 | + $this->server->on('propFind', [$this, 'propFind']); |
|
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | public function propFind(PropFind $propFind, INode $node) { |
| 120 | 120 | if ($node instanceof Calendar) { |
| 121 | - $propFind->handle('{'.self::NS_CALENDARSERVER.'}publish-url', function () use ($node) { |
|
| 121 | + $propFind->handle('{'.self::NS_CALENDARSERVER.'}publish-url', function() use ($node) { |
|
| 122 | 122 | if ($node->getPublishStatus()) { |
| 123 | 123 | // We return the publish-url only if the calendar is published. |
| 124 | 124 | $token = $node->getPublishStatus(); |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | } |
| 129 | 129 | }); |
| 130 | 130 | |
| 131 | - $propFind->handle('{'.self::NS_CALENDARSERVER.'}allowed-sharing-modes', function () use ($node) { |
|
| 131 | + $propFind->handle('{'.self::NS_CALENDARSERVER.'}allowed-sharing-modes', function() use ($node) { |
|
| 132 | 132 | $canShare = (!$node->isSubscription() && $node->canWrite()); |
| 133 | 133 | $canPublish = (!$node->isSubscription() && $node->canWrite()); |
| 134 | 134 | |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | public function createFile($name, $data = null) { |
| 47 | - throw new Forbidden('Permission denied to create file (filename ' . $name . ')'); |
|
| 47 | + throw new Forbidden('Permission denied to create file (filename '.$name.')'); |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | public function createDirectory($name) { |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | public function getChildren(): array { |
| 62 | - return array_map(function ($node) { |
|
| 62 | + return array_map(function($node) { |
|
| 63 | 63 | return new UploadFolder($node, $this->cleanupService); |
| 64 | 64 | }, $this->impl()->getChildren()); |
| 65 | 65 | } |
@@ -92,10 +92,10 @@ discard block |
||
| 92 | 92 | $rootView = new View(); |
| 93 | 93 | $user = \OC::$server->getUserSession()->getUser(); |
| 94 | 94 | Filesystem::initMountPoints($user->getUID()); |
| 95 | - if (!$rootView->file_exists('/' . $user->getUID() . '/uploads')) { |
|
| 96 | - $rootView->mkdir('/' . $user->getUID() . '/uploads'); |
|
| 95 | + if (!$rootView->file_exists('/'.$user->getUID().'/uploads')) { |
|
| 96 | + $rootView->mkdir('/'.$user->getUID().'/uploads'); |
|
| 97 | 97 | } |
| 98 | - $view = new View('/' . $user->getUID() . '/uploads'); |
|
| 98 | + $view = new View('/'.$user->getUID().'/uploads'); |
|
| 99 | 99 | $rootInfo = $view->getFileInfo(''); |
| 100 | 100 | return new Directory($view, $rootInfo); |
| 101 | 101 | } |
@@ -96,7 +96,7 @@ |
||
| 96 | 96 | $output->writeln("Start birthday calendar sync for all users ..."); |
| 97 | 97 | $p = new ProgressBar($output); |
| 98 | 98 | $p->start(); |
| 99 | - $this->userManager->callForSeenUsers(function ($user) use ($p) { |
|
| 99 | + $this->userManager->callForSeenUsers(function($user) use ($p) { |
|
| 100 | 100 | $p->advance(); |
| 101 | 101 | |
| 102 | 102 | $userId = $user->getUID(); |
@@ -146,8 +146,8 @@ discard block |
||
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | private function entitiesToArray(array $entities) { |
| 149 | - return array_map(function (IEntity $entity) { |
|
| 150 | - $events = array_map(function (IEntityEvent $entityEvent) { |
|
| 149 | + return array_map(function(IEntity $entity) { |
|
| 150 | + $events = array_map(function(IEntityEvent $entityEvent) { |
|
| 151 | 151 | return [ |
| 152 | 152 | 'eventName' => $entityEvent->getEventName(), |
| 153 | 153 | 'displayName' => $entityEvent->getDisplayName() |
@@ -164,11 +164,11 @@ discard block |
||
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | private function operatorsToArray(array $operators) { |
| 167 | - $operators = array_filter($operators, function (IOperation $operator) { |
|
| 167 | + $operators = array_filter($operators, function(IOperation $operator) { |
|
| 168 | 168 | return $operator->isAvailableForScope($this->getScope()); |
| 169 | 169 | }); |
| 170 | 170 | |
| 171 | - return array_map(function (IOperation $operator) { |
|
| 171 | + return array_map(function(IOperation $operator) { |
|
| 172 | 172 | return [ |
| 173 | 173 | 'id' => get_class($operator), |
| 174 | 174 | 'icon' => $operator->getIcon(), |
@@ -182,11 +182,11 @@ discard block |
||
| 182 | 182 | } |
| 183 | 183 | |
| 184 | 184 | private function checksToArray(array $checks) { |
| 185 | - $checks = array_filter($checks, function (ICheck $check) { |
|
| 185 | + $checks = array_filter($checks, function(ICheck $check) { |
|
| 186 | 186 | return $check->isAvailableForScope($this->getScope()); |
| 187 | 187 | }); |
| 188 | 188 | |
| 189 | - return array_map(function (ICheck $check) { |
|
| 189 | + return array_map(function(ICheck $check) { |
|
| 190 | 190 | return [ |
| 191 | 191 | 'id' => get_class($check), |
| 192 | 192 | 'supportedEntities' => $check->supportedEntities(), |
@@ -72,7 +72,7 @@ |
||
| 72 | 72 | * @return IProvider[] |
| 73 | 73 | */ |
| 74 | 74 | public function getPrimaryProviders(): array { |
| 75 | - return array_filter($this->providers, function (IProvider $provider) { |
|
| 75 | + return array_filter($this->providers, function(IProvider $provider) { |
|
| 76 | 76 | return !($provider instanceof BackupCodesProvider); |
| 77 | 77 | }); |
| 78 | 78 | } |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | $result->closeCursor(); |
| 242 | 242 | |
| 243 | 243 | if ($all) { |
| 244 | - return ((int)$row[0] === \count($objIds)); |
|
| 244 | + return ((int) $row[0] === \count($objIds)); |
|
| 245 | 245 | } |
| 246 | 246 | |
| 247 | 247 | return (bool) $row; |
@@ -259,7 +259,7 @@ discard block |
||
| 259 | 259 | if (\count($tags) !== \count($tagIds)) { |
| 260 | 260 | // at least one tag missing, bail out |
| 261 | 261 | $foundTagIds = array_map( |
| 262 | - function (ISystemTag $tag) { |
|
| 262 | + function(ISystemTag $tag) { |
|
| 263 | 263 | return $tag->getId(); |
| 264 | 264 | }, |
| 265 | 265 | $tags |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | class Listener { |
| 37 | 37 | |
| 38 | 38 | public static function register(EventDispatcherInterface $dispatcher): void { |
| 39 | - $listener = function (GenericEvent $event) { |
|
| 39 | + $listener = function(GenericEvent $event) { |
|
| 40 | 40 | /** @var IUser $user */ |
| 41 | 41 | $user = $event->getArgument('user'); |
| 42 | 42 | /** @var IManager $resourceManager */ |
@@ -44,10 +44,10 @@ discard block |
||
| 44 | 44 | |
| 45 | 45 | $resourceManager->invalidateAccessCacheForUser($user); |
| 46 | 46 | }; |
| 47 | - $dispatcher->addListener(IGroup::class . '::postAddUser', $listener); |
|
| 48 | - $dispatcher->addListener(IGroup::class . '::postRemoveUser', $listener); |
|
| 47 | + $dispatcher->addListener(IGroup::class.'::postAddUser', $listener); |
|
| 48 | + $dispatcher->addListener(IGroup::class.'::postRemoveUser', $listener); |
|
| 49 | 49 | |
| 50 | - $dispatcher->addListener(IUser::class . '::postDelete', function (GenericEvent $event) { |
|
| 50 | + $dispatcher->addListener(IUser::class.'::postDelete', function(GenericEvent $event) { |
|
| 51 | 51 | /** @var IUser $user */ |
| 52 | 52 | $user = $event->getSubject(); |
| 53 | 53 | /** @var IManager $resourceManager */ |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | $resourceManager->invalidateAccessCacheForUser($user); |
| 57 | 57 | }); |
| 58 | 58 | |
| 59 | - $dispatcher->addListener(IGroup::class . '::preDelete', function (GenericEvent $event) { |
|
| 59 | + $dispatcher->addListener(IGroup::class.'::preDelete', function(GenericEvent $event) { |
|
| 60 | 60 | /** @var IGroup $group */ |
| 61 | 61 | $group = $event->getSubject(); |
| 62 | 62 | /** @var IManager $resourceManager */ |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | * @since 16.0.0 |
| 127 | 127 | */ |
| 128 | 128 | public function addResource(IResource $resource): void { |
| 129 | - array_map(function (IResource $r) use ($resource) { |
|
| 129 | + array_map(function(IResource $r) use ($resource) { |
|
| 130 | 130 | if ($this->isSameResource($r, $resource)) { |
| 131 | 131 | throw new ResourceException('Already part of the collection'); |
| 132 | 132 | } |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | * @since 16.0.0 |
| 159 | 159 | */ |
| 160 | 160 | public function removeResource(IResource $resource): void { |
| 161 | - $this->resources = array_filter($this->getResources(), function (IResource $r) use ($resource) { |
|
| 161 | + $this->resources = array_filter($this->getResources(), function(IResource $r) use ($resource) { |
|
| 162 | 162 | return !$this->isSameResource($r, $resource); |
| 163 | 163 | }); |
| 164 | 164 | |