@@ -69,7 +69,7 @@ |
||
69 | 69 | ); |
70 | 70 | |
71 | 71 | $dispatcher = $container->getServer()->getEventDispatcher(); |
72 | - $dispatcher->addListener('OCA\DAV\Connector\Sabre::authInit', function ($event) use ($container) { |
|
72 | + $dispatcher->addListener('OCA\DAV\Connector\Sabre::authInit', function($event) use ($container) { |
|
73 | 73 | if ($event instanceof SabrePluginEvent) { |
74 | 74 | $server = $event->getServer(); |
75 | 75 | if ($server instanceof Server) { |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | $backendService = $container->query(BackendService::class); |
86 | 86 | $backendService->registerBackendProvider($this); |
87 | 87 | $backendService->registerAuthMechanismProvider($this); |
88 | - $backendService->registerConfigHandler('user', function () use ($container) { |
|
88 | + $backendService->registerConfigHandler('user', function() use ($container) { |
|
89 | 89 | return $container->query(UserPlaceholderHandler::class); |
90 | 90 | }); |
91 | 91 | |
@@ -97,8 +97,8 @@ discard block |
||
97 | 97 | public function registerListeners() { |
98 | 98 | $dispatcher = $this->getContainer()->getServer()->getEventDispatcher(); |
99 | 99 | $dispatcher->addListener( |
100 | - IUser::class . '::postDelete', |
|
101 | - function (GenericEvent $event) { |
|
100 | + IUser::class.'::postDelete', |
|
101 | + function(GenericEvent $event) { |
|
102 | 102 | /** @var IUser $user */ |
103 | 103 | $user = $event->getSubject(); |
104 | 104 | /** @var DBConfigService $config */ |
@@ -107,8 +107,8 @@ discard block |
||
107 | 107 | } |
108 | 108 | ); |
109 | 109 | $dispatcher->addListener( |
110 | - IGroup::class . '::postDelete', |
|
111 | - function (GenericEvent $event) { |
|
110 | + IGroup::class.'::postDelete', |
|
111 | + function(GenericEvent $event) { |
|
112 | 112 | /** @var IGroup $group */ |
113 | 113 | $group = $event->getSubject(); |
114 | 114 | /** @var DBConfigService $config */ |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | |
128 | 128 | $storageConfigs = $this->userGlobalStoragesService->getAllStoragesForUser(); |
129 | 129 | |
130 | - $storages = array_map(function (StorageConfig $storageConfig) use ($user) { |
|
130 | + $storages = array_map(function(StorageConfig $storageConfig) use ($user) { |
|
131 | 131 | try { |
132 | 132 | $this->prepareStorageConfig($storageConfig, $user); |
133 | 133 | return $this->constructStorage($storageConfig); |
@@ -138,16 +138,16 @@ discard block |
||
138 | 138 | }, $storageConfigs); |
139 | 139 | |
140 | 140 | |
141 | - \OC\Files\Cache\Storage::getGlobalCache()->loadForStorageIds(array_map(function (Storage\IStorage $storage) { |
|
141 | + \OC\Files\Cache\Storage::getGlobalCache()->loadForStorageIds(array_map(function(Storage\IStorage $storage) { |
|
142 | 142 | return $storage->getId(); |
143 | 143 | }, $storages)); |
144 | 144 | |
145 | - $availableStorages = array_map(function (Storage\IStorage $storage, StorageConfig $storageConfig) { |
|
145 | + $availableStorages = array_map(function(Storage\IStorage $storage, StorageConfig $storageConfig) { |
|
146 | 146 | try { |
147 | 147 | $availability = $storage->getAvailability(); |
148 | 148 | if (!$availability['available'] && !Availability::shouldRecheck($availability)) { |
149 | 149 | $storage = new FailedStorage([ |
150 | - 'exception' => new StorageNotAvailableException('Storage with mount id ' . $storageConfig->getId() . ' is not available') |
|
150 | + 'exception' => new StorageNotAvailableException('Storage with mount id '.$storageConfig->getId().' is not available') |
|
151 | 151 | ]); |
152 | 152 | } |
153 | 153 | } catch (\Exception $e) { |
@@ -157,13 +157,13 @@ discard block |
||
157 | 157 | return $storage; |
158 | 158 | }, $storages, $storageConfigs); |
159 | 159 | |
160 | - $mounts = array_map(function (StorageConfig $storageConfig, Storage\IStorage $storage) use ($user, $loader) { |
|
160 | + $mounts = array_map(function(StorageConfig $storageConfig, Storage\IStorage $storage) use ($user, $loader) { |
|
161 | 161 | if ($storageConfig->getType() === StorageConfig::MOUNT_TYPE_PERSONAl) { |
162 | 162 | return new PersonalMount( |
163 | 163 | $this->userStoragesService, |
164 | 164 | $storageConfig->getId(), |
165 | 165 | $storage, |
166 | - '/' . $user->getUID() . '/files' . $storageConfig->getMountPoint(), |
|
166 | + '/'.$user->getUID().'/files'.$storageConfig->getMountPoint(), |
|
167 | 167 | null, |
168 | 168 | $loader, |
169 | 169 | $storageConfig->getMountOptions() |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | } else { |
172 | 172 | return new ExternalMountPoint( |
173 | 173 | $storage, |
174 | - '/' . $user->getUID() . '/files' . $storageConfig->getMountPoint(), |
|
174 | + '/'.$user->getUID().'/files'.$storageConfig->getMountPoint(), |
|
175 | 175 | null, |
176 | 176 | $loader, |
177 | 177 | $storageConfig->getMountOptions(), |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | |
79 | 79 | // Get list of installed custom apps |
80 | 80 | $installedApps = $this->appManager->getInstalledApps(); |
81 | - $installedApps = array_filter($installedApps, function ($app) { |
|
81 | + $installedApps = array_filter($installedApps, function($app) { |
|
82 | 82 | try { |
83 | 83 | $this->appManager->getAppPath($app); |
84 | 84 | } catch (AppPathNotFoundException $e) { |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | $this->appFetcher->setVersion($newVersion, 'future-apps.json', false); |
98 | 98 | |
99 | 99 | // Apps available on the app store for that version |
100 | - $availableApps = array_map(function (array $app) { |
|
100 | + $availableApps = array_map(function(array $app) { |
|
101 | 101 | return $app['id']; |
102 | 102 | }, $this->appFetcher->get()); |
103 | 103 |
@@ -272,7 +272,7 @@ |
||
272 | 272 | * @param string[] $plugin |
273 | 273 | */ |
274 | 274 | private function loadSabreAddressBookPluginsFromInfoXml(array $plugins): void { |
275 | - $providers = array_map(function (string $className): IAddressBookProvider { |
|
275 | + $providers = array_map(function(string $className): IAddressBookProvider { |
|
276 | 276 | $instance = $this->createPluginInstance($className); |
277 | 277 | if (!($instance instanceof IAddressBookProvider)) { |
278 | 278 | throw new \Exception("Sabre address book plugin class '$className' does not implement the \OCA\DAV\CardDAV\Integration\IAddressBookProvider interface"); |
@@ -57,7 +57,7 @@ |
||
57 | 57 | * @inheritDoc |
58 | 58 | */ |
59 | 59 | public function run($argument) { |
60 | - $this->userManager->callForSeenUsers(function (IUser $user) { |
|
60 | + $this->userManager->callForSeenUsers(function(IUser $user) { |
|
61 | 61 | $this->jobList->add(GenerateBirthdayCalendarBackgroundJob::class, [ |
62 | 62 | 'userId' => $user->getUID(), |
63 | 63 | 'purgeBeforeGenerating' => true |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | $this->jobList = $jobList; |
51 | 51 | |
52 | 52 | // Run once a day |
53 | - $this->setInterval(60*60*24); |
|
53 | + $this->setInterval(60 * 60 * 24); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | protected function run($argument) { |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | $uploads = $userRoot->get('uploads'); |
65 | 65 | /** @var Folder $uploadFolder */ |
66 | 66 | $uploadFolder = $uploads->get($folder); |
67 | - } catch (NotFoundException|NoUserException $e) { |
|
67 | + } catch (NotFoundException | NoUserException $e) { |
|
68 | 68 | $this->jobList->remove(self::class, $argument); |
69 | 69 | return; |
70 | 70 | } |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | // The folder has to be more than a day old |
78 | 78 | $initial = $uploadFolder->getMTime() < $time; |
79 | 79 | |
80 | - $expire = array_reduce($files, function (bool $carry, File $file) use ($time) { |
|
80 | + $expire = array_reduce($files, function(bool $carry, File $file) use ($time) { |
|
81 | 81 | return $carry && $file->getMTime() < $time; |
82 | 82 | }, $initial); |
83 | 83 |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | |
73 | 73 | $addressBooks = $this->carddavBackend->getAddressBooksForUser($this->principalUri); |
74 | 74 | /** @var IAddressBook[] $objects */ |
75 | - $objects = array_map(function (array $addressBook) { |
|
75 | + $objects = array_map(function(array $addressBook) { |
|
76 | 76 | if ($addressBook['principaluri'] === 'principals/system/system') { |
77 | 77 | return new SystemAddressbook($this->carddavBackend, $addressBook, $this->l10n, $this->config); |
78 | 78 | } |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | return new AddressBook($this->carddavBackend, $addressBook, $this->l10n); |
81 | 81 | }, $addressBooks); |
82 | 82 | /** @var IAddressBook[][] $objectsFromPlugins */ |
83 | - $objectsFromPlugins = array_map(function (IAddressBookProvider $plugin): array { |
|
83 | + $objectsFromPlugins = array_map(function(IAddressBookProvider $plugin): array { |
|
84 | 84 | return $plugin->fetchAllForAddressBookHome($this->principalUri); |
85 | 85 | }, $this->pluginManager->getAddressBookPlugins()); |
86 | 86 |
@@ -104,12 +104,12 @@ discard block |
||
104 | 104 | } |
105 | 105 | |
106 | 106 | public function getACL() { |
107 | - $acl = [ |
|
107 | + $acl = [ |
|
108 | 108 | [ |
109 | 109 | 'privilege' => '{DAV:}read', |
110 | 110 | 'principal' => $this->getOwner(), |
111 | 111 | 'protected' => true, |
112 | - ],[ |
|
112 | + ], [ |
|
113 | 113 | 'privilege' => '{DAV:}write', |
114 | 114 | 'principal' => $this->getOwner(), |
115 | 115 | 'protected' => true, |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | } |
130 | 130 | |
131 | 131 | if ($this->getOwner() !== parent::getOwner()) { |
132 | - $acl[] = [ |
|
132 | + $acl[] = [ |
|
133 | 133 | 'privilege' => '{DAV:}read', |
134 | 134 | 'principal' => parent::getOwner(), |
135 | 135 | 'protected' => true, |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | |
146 | 146 | $acl = $this->carddavBackend->applyShareAcl($this->getResourceId(), $acl); |
147 | 147 | $allowedPrincipals = [$this->getOwner(), parent::getOwner(), 'principals/system/system']; |
148 | - return array_filter($acl, function ($rule) use ($allowedPrincipals) { |
|
148 | + return array_filter($acl, function($rule) use ($allowedPrincipals) { |
|
149 | 149 | return \in_array($rule['principal'], $allowedPrincipals, true); |
150 | 150 | }); |
151 | 151 | } |
@@ -181,9 +181,9 @@ discard block |
||
181 | 181 | |
182 | 182 | public function delete() { |
183 | 183 | if (isset($this->addressBookInfo['{http://owncloud.org/ns}owner-principal'])) { |
184 | - $principal = 'principal:' . parent::getOwner(); |
|
184 | + $principal = 'principal:'.parent::getOwner(); |
|
185 | 185 | $shares = $this->carddavBackend->getShares($this->getResourceId()); |
186 | - $shares = array_filter($shares, function ($share) use ($principal) { |
|
186 | + $shares = array_filter($shares, function($share) use ($principal) { |
|
187 | 187 | return $share['href'] === $principal; |
188 | 188 | }); |
189 | 189 | if (empty($shares)) { |