diff options
Diffstat (limited to 'apps/dav')
30 files changed, 71 insertions, 71 deletions
diff --git a/apps/dav/lib/AppInfo/Application.php b/apps/dav/lib/AppInfo/Application.php index 9bc95124c22..dcca8324397 100644 --- a/apps/dav/lib/AppInfo/Application.php +++ b/apps/dav/lib/AppInfo/Application.php @@ -277,7 +277,7 @@ class Application extends App implements IBootstrap { $config = $serverContainer->getConfig(); $principalUri = $event->getArgument('calendarData')['principaluri']; if (strpos($principalUri, 'principals/users') === 0) { - list(, $UID) = \Sabre\Uri\split($principalUri); + [, $UID] = \Sabre\Uri\split($principalUri); $uri = $event->getArgument('calendarData')['uri']; if ($config->getUserValue($UID, 'dav', 'defaultCalendar') === $uri) { $config->deleteUserValue($UID, 'dav', 'defaultCalendar'); diff --git a/apps/dav/lib/Avatars/AvatarHome.php b/apps/dav/lib/Avatars/AvatarHome.php index fd342676bfd..cbdd2b21b12 100644 --- a/apps/dav/lib/Avatars/AvatarHome.php +++ b/apps/dav/lib/Avatars/AvatarHome.php @@ -101,7 +101,7 @@ class AvatarHome implements ICollection { } public function getName() { - list(,$name) = Uri\split($this->principalInfo['uri']); + [,$name] = Uri\split($this->principalInfo['uri']); return $name; } diff --git a/apps/dav/lib/CalDAV/CalDavBackend.php b/apps/dav/lib/CalDAV/CalDavBackend.php index 6b84512fc93..1d82eee5cb5 100644 --- a/apps/dav/lib/CalDAV/CalDavBackend.php +++ b/apps/dav/lib/CalDAV/CalDavBackend.php @@ -365,7 +365,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription ->setParameter('type', 'calendar') ->setParameter('principaluri', $principals, \Doctrine\DBAL\Connection::PARAM_STR_ARRAY); - $result = $query->execute(); + $result = $query->execute(); $readOnlyPropertyName = '{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}read-only'; while ($row = $result->fetch()) { @@ -387,7 +387,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription } } - list(, $name) = Uri\split($row['principaluri']); + [, $name] = Uri\split($row['principaluri']); $uri = $row['uri'] . '_shared_by_' . $name; $row['displayname'] = $row['displayname'] . ' (' . $this->getUserDisplayName($name) . ')'; $components = []; @@ -511,7 +511,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription while ($row = $result->fetch()) { $row['principaluri'] = (string) $row['principaluri']; - list(, $name) = Uri\split($row['principaluri']); + [, $name] = Uri\split($row['principaluri']); $row['displayname'] = $row['displayname'] . "($name)"; $components = []; if ($row['components']) { @@ -578,7 +578,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription } $row['principaluri'] = (string) $row['principaluri']; - list(, $name) = Uri\split($row['principaluri']); + [, $name] = Uri\split($row['principaluri']); $row['displayname'] = $row['displayname'] . ' ' . "($name)"; $components = []; if ($row['components']) { @@ -2837,7 +2837,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription */ private function convertPrincipal($principalUri, $toV2) { if ($this->principalBackend->getPrincipalPrefix() === 'principals') { - list(, $name) = Uri\split($principalUri); + [, $name] = Uri\split($principalUri); if ($toV2 === true) { return "principals/users/$name"; } diff --git a/apps/dav/lib/CalDAV/Plugin.php b/apps/dav/lib/CalDAV/Plugin.php index c2b8830b34c..f87907e6c5d 100644 --- a/apps/dav/lib/CalDAV/Plugin.php +++ b/apps/dav/lib/CalDAV/Plugin.php @@ -40,15 +40,15 @@ class Plugin extends \Sabre\CalDAV\Plugin { */ public function getCalendarHomeForPrincipal($principalUrl) { if (strrpos($principalUrl, 'principals/users', -strlen($principalUrl)) !== false) { - list(, $principalId) = \Sabre\Uri\split($principalUrl); + [, $principalId] = \Sabre\Uri\split($principalUrl); return self::CALENDAR_ROOT . '/' . $principalId; } if (strrpos($principalUrl, 'principals/calendar-resources', -strlen($principalUrl)) !== false) { - list(, $principalId) = \Sabre\Uri\split($principalUrl); + [, $principalId] = \Sabre\Uri\split($principalUrl); return self::SYSTEM_CALENDAR_ROOT . '/calendar-resources/' . $principalId; } if (strrpos($principalUrl, 'principals/calendar-rooms', -strlen($principalUrl)) !== false) { - list(, $principalId) = \Sabre\Uri\split($principalUrl); + [, $principalId] = \Sabre\Uri\split($principalUrl); return self::SYSTEM_CALENDAR_ROOT . '/calendar-rooms/' . $principalId; } } diff --git a/apps/dav/lib/CalDAV/ResourceBooking/AbstractPrincipalBackend.php b/apps/dav/lib/CalDAV/ResourceBooking/AbstractPrincipalBackend.php index bfe4e938a5d..8eb47511d48 100644 --- a/apps/dav/lib/CalDAV/ResourceBooking/AbstractPrincipalBackend.php +++ b/apps/dav/lib/CalDAV/ResourceBooking/AbstractPrincipalBackend.php @@ -163,9 +163,9 @@ abstract class AbstractPrincipalBackend implements BackendInterface { if (strpos($path, $this->principalPrefix) !== 0) { return null; } - list(, $name) = \Sabre\Uri\split($path); + [, $name] = \Sabre\Uri\split($path); - list($backendId, $resourceId) = explode('-', $name, 2); + [$backendId, $resourceId] = explode('-', $name, 2); $query = $this->db->getQueryBuilder(); $query->select(['id', 'backend_id', 'resource_id', 'email', 'displayname']) @@ -404,8 +404,8 @@ abstract class AbstractPrincipalBackend implements BackendInterface { return null; } - list(, $name) = \Sabre\Uri\split($path); - list($backendId, $resourceId) = explode('-', $name, 2); + [, $name] = \Sabre\Uri\split($path); + [$backendId, $resourceId] = explode('-', $name, 2); $query = $this->db->getQueryBuilder(); $query->select(['id', 'backend_id', 'resource_id', 'email', 'displayname', 'group_restrictions']) diff --git a/apps/dav/lib/CalDAV/Schedule/IMipPlugin.php b/apps/dav/lib/CalDAV/Schedule/IMipPlugin.php index 1f9885c0064..7c2f6b71a41 100644 --- a/apps/dav/lib/CalDAV/Schedule/IMipPlugin.php +++ b/apps/dav/lib/CalDAV/Schedule/IMipPlugin.php @@ -590,7 +590,7 @@ class IMipPlugin extends SabreIMipPlugin { /** @var Property\ICalendar\CalAddress $organizer */ $organizer = $vevent->ORGANIZER; $organizerURI = $organizer->getNormalizedValue(); - list($scheme,$organizerEmail) = explode(':',$organizerURI,2); # strip off scheme mailto: + [$scheme,$organizerEmail] = explode(':',$organizerURI,2); # strip off scheme mailto: /** @var string|null $organizerName */ $organizerName = isset($organizer['CN']) ? $organizer['CN'] : null; $organizerHTML = sprintf('<a href="%s">%s</a>', @@ -619,7 +619,7 @@ class IMipPlugin extends SabreIMipPlugin { $attendeesText = []; foreach ($attendees as $attendee) { $attendeeURI = $attendee->getNormalizedValue(); - list($scheme,$attendeeEmail) = explode(':',$attendeeURI,2); # strip off scheme mailto: + [$scheme,$attendeeEmail] = explode(':',$attendeeURI,2); # strip off scheme mailto: $attendeeName = isset($attendee['CN']) ? $attendee['CN'] : null; $attendeeHTML = sprintf('<a href="%s">%s</a>', htmlspecialchars($attendeeURI), diff --git a/apps/dav/lib/CalDAV/Schedule/Plugin.php b/apps/dav/lib/CalDAV/Schedule/Plugin.php index 9ccabdc86fd..d384968e921 100644 --- a/apps/dav/lib/CalDAV/Schedule/Plugin.php +++ b/apps/dav/lib/CalDAV/Schedule/Plugin.php @@ -291,7 +291,7 @@ EOF; } if (strpos($principalUrl, 'principals/users') === 0) { - list(, $userId) = split($principalUrl); + [, $userId] = split($principalUrl); $uri = $this->config->getUserValue($userId, 'dav', 'defaultCalendar', CalDavBackend::PERSONAL_CALENDAR_URI); $displayName = CalDavBackend::PERSONAL_CALENDAR_NAME; } elseif (strpos($principalUrl, 'principals/calendar-resources') === 0 || diff --git a/apps/dav/lib/CalDAV/Search/SearchPlugin.php b/apps/dav/lib/CalDAV/Search/SearchPlugin.php index 23ce1bf3e8c..a25abac6020 100644 --- a/apps/dav/lib/CalDAV/Search/SearchPlugin.php +++ b/apps/dav/lib/CalDAV/Search/SearchPlugin.php @@ -146,7 +146,7 @@ class SearchPlugin extends ServerPlugin { $nodePaths = $node->calendarSearch($report->filters, $report->limit, $report->offset); foreach ($nodePaths as $path) { - list($properties) = $this->server->getPropertiesForPath( + [$properties] = $this->server->getPropertiesForPath( $this->server->getRequestUri() . '/' . $path, $report->properties); $result[] = $properties; diff --git a/apps/dav/lib/CardDAV/CardDavBackend.php b/apps/dav/lib/CardDAV/CardDavBackend.php index a26c6c24a8e..9246fc68ac9 100644 --- a/apps/dav/lib/CardDAV/CardDavBackend.php +++ b/apps/dav/lib/CardDAV/CardDavBackend.php @@ -223,7 +223,7 @@ class CardDavBackend implements BackendInterface, SyncSupport { } } - list(, $name) = \Sabre\Uri\split($row['principaluri']); + [, $name] = \Sabre\Uri\split($row['principaluri']); $uri = $row['uri'] . '_shared_by_' . $name; $displayName = $row['displayname'] . ' (' . $this->getUserDisplayName($name) . ')'; @@ -1338,7 +1338,7 @@ class CardDavBackend implements BackendInterface, SyncSupport { private function convertPrincipal($principalUri, $toV2) { if ($this->principalBackend->getPrincipalPrefix() === 'principals') { - list(, $name) = \Sabre\Uri\split($principalUri); + [, $name] = \Sabre\Uri\split($principalUri); if ($toV2 === true) { return "principals/users/$name"; } diff --git a/apps/dav/lib/CardDAV/PhotoCache.php b/apps/dav/lib/CardDAV/PhotoCache.php index 3d88eef5789..9b687658d5f 100644 --- a/apps/dav/lib/CardDAV/PhotoCache.php +++ b/apps/dav/lib/CardDAV/PhotoCache.php @@ -226,7 +226,7 @@ class PhotoCache { return false; } if (substr_count($parsed['path'], ';') === 1) { - list($type) = explode(';', $parsed['path']); + [$type] = explode(';', $parsed['path']); } $val = file_get_contents($val); } else { diff --git a/apps/dav/lib/CardDAV/Plugin.php b/apps/dav/lib/CardDAV/Plugin.php index 5f6ecb9cd8b..6079b1a42a8 100644 --- a/apps/dav/lib/CardDAV/Plugin.php +++ b/apps/dav/lib/CardDAV/Plugin.php @@ -44,15 +44,15 @@ class Plugin extends \Sabre\CardDAV\Plugin { */ protected function getAddressbookHomeForPrincipal($principal) { if (strrpos($principal, 'principals/users', -strlen($principal)) !== false) { - list(, $principalId) = \Sabre\Uri\split($principal); + [, $principalId] = \Sabre\Uri\split($principal); return self::ADDRESSBOOK_ROOT . '/users/' . $principalId; } if (strrpos($principal, 'principals/groups', -strlen($principal)) !== false) { - list(, $principalId) = \Sabre\Uri\split($principal); + [, $principalId] = \Sabre\Uri\split($principal); return self::ADDRESSBOOK_ROOT . '/groups/' . $principalId; } if (strrpos($principal, 'principals/system', -strlen($principal)) !== false) { - list(, $principalId) = \Sabre\Uri\split($principal); + [, $principalId] = \Sabre\Uri\split($principal); return self::ADDRESSBOOK_ROOT . '/system/' . $principalId; } } diff --git a/apps/dav/lib/Command/MoveCalendar.php b/apps/dav/lib/Command/MoveCalendar.php index 8b77eda47a3..e0b0b63ff66 100644 --- a/apps/dav/lib/Command/MoveCalendar.php +++ b/apps/dav/lib/Command/MoveCalendar.php @@ -212,7 +212,7 @@ class MoveCalendar extends Command { private function checkShares(array $calendar, string $userOrigin, string $userDestination, bool $force = false): bool { $shares = $this->calDav->getShares($calendar['id']); foreach ($shares as $share) { - list(, $prefix, $userOrGroup) = explode('/', $share['href'], 3); + [, $prefix, $userOrGroup] = explode('/', $share['href'], 3); /** * Check that user destination is member of the groups which whom the calendar was shared diff --git a/apps/dav/lib/Connector/LegacyDAVACL.php b/apps/dav/lib/Connector/LegacyDAVACL.php index 908c6265bf6..fd74daaeca1 100644 --- a/apps/dav/lib/Connector/LegacyDAVACL.php +++ b/apps/dav/lib/Connector/LegacyDAVACL.php @@ -54,7 +54,7 @@ class LegacyDAVACL extends DavAclPlugin { } private function convertPrincipal($principal, $toV2) { - list(, $name) = \Sabre\Uri\split($principal); + [, $name] = \Sabre\Uri\split($principal); if ($toV2) { return "principals/users/$name"; } diff --git a/apps/dav/lib/Connector/Sabre/File.php b/apps/dav/lib/Connector/Sabre/File.php index a4948a795a1..c6213cdbc81 100644 --- a/apps/dav/lib/Connector/Sabre/File.php +++ b/apps/dav/lib/Connector/Sabre/File.php @@ -144,7 +144,7 @@ class File extends Node implements IFile { } /** @var Storage $partStorage */ - list($partStorage) = $this->fileView->resolvePath($this->path); + [$partStorage] = $this->fileView->resolvePath($this->path); $needsPartFile = $partStorage->needsPartFile() && (strlen($this->path) > 1); $view = \OC\Files\Filesystem::getView(); @@ -168,9 +168,9 @@ class File extends Node implements IFile { // the part file and target file might be on a different storage in case of a single file storage (e.g. single file share) /** @var \OC\Files\Storage\Storage $partStorage */ - list($partStorage, $internalPartPath) = $this->fileView->resolvePath($partFilePath); + [$partStorage, $internalPartPath] = $this->fileView->resolvePath($partFilePath); /** @var \OC\Files\Storage\Storage $storage */ - list($storage, $internalPath) = $this->fileView->resolvePath($this->path); + [$storage, $internalPath] = $this->fileView->resolvePath($this->path); try { if (!$needsPartFile) { $this->changeLock(ILockingProvider::LOCK_EXCLUSIVE); @@ -223,7 +223,7 @@ class File extends Node implements IFile { // because we have no clue about the cause we can only throw back a 500/Internal Server Error throw new Exception('Could not write file contents'); } - list($count, $result) = \OC_Helper::streamCopy($data, $target); + [$count, $result] = \OC_Helper::streamCopy($data, $target); fclose($target); } @@ -501,7 +501,7 @@ class File extends Node implements IFile { return []; } /** @var \OCP\Files\Storage $storage */ - list($storage, $internalPath) = $this->fileView->resolvePath($this->path); + [$storage, $internalPath] = $this->fileView->resolvePath($this->path); if (is_null($storage)) { return []; } @@ -518,7 +518,7 @@ class File extends Node implements IFile { * @throws ServiceUnavailable */ private function createFileChunked($data) { - list($path, $name) = \Sabre\Uri\split($this->path); + [$path, $name] = \Sabre\Uri\split($this->path); $info = \OC_FileChunking::decodeName($name); if (empty($info)) { @@ -541,13 +541,13 @@ class File extends Node implements IFile { if ($chunk_handler->isComplete()) { /** @var Storage $storage */ - list($storage,) = $this->fileView->resolvePath($path); + [$storage,] = $this->fileView->resolvePath($path); $needsPartFile = $storage->needsPartFile(); $partFile = null; $targetPath = $path . '/' . $info['name']; /** @var \OC\Files\Storage\Storage $targetStorage */ - list($targetStorage, $targetInternalPath) = $this->fileView->resolvePath($targetPath); + [$targetStorage, $targetInternalPath] = $this->fileView->resolvePath($targetPath); $exists = $this->fileView->file_exists($targetPath); @@ -557,13 +557,13 @@ class File extends Node implements IFile { $this->emitPreHooks($exists, $targetPath); $this->fileView->changeLock($targetPath, ILockingProvider::LOCK_EXCLUSIVE); /** @var \OC\Files\Storage\Storage $targetStorage */ - list($targetStorage, $targetInternalPath) = $this->fileView->resolvePath($targetPath); + [$targetStorage, $targetInternalPath] = $this->fileView->resolvePath($targetPath); if ($needsPartFile) { // we first assembly the target file as a part file $partFile = $this->getPartFileBasePath($path . '/' . $info['name']) . '.ocTransferId' . $info['transferid'] . '.part'; /** @var \OC\Files\Storage\Storage $targetStorage */ - list($partStorage, $partInternalPath) = $this->fileView->resolvePath($partFile); + [$partStorage, $partInternalPath] = $this->fileView->resolvePath($partFile); $chunk_handler->file_assemble($partStorage, $partInternalPath); diff --git a/apps/dav/lib/Connector/Sabre/FilesPlugin.php b/apps/dav/lib/Connector/Sabre/FilesPlugin.php index 476d049bbc3..fa948f38624 100644 --- a/apps/dav/lib/Connector/Sabre/FilesPlugin.php +++ b/apps/dav/lib/Connector/Sabre/FilesPlugin.php @@ -202,8 +202,8 @@ class FilesPlugin extends ServerPlugin { if (!$sourceNode instanceof Node) { return; } - list($sourceDir,) = \Sabre\Uri\split($source); - list($destinationDir,) = \Sabre\Uri\split($destination); + [$sourceDir,] = \Sabre\Uri\split($source); + [$destinationDir,] = \Sabre\Uri\split($destination); if ($sourceDir !== $destinationDir) { $sourceNodeFileInfo = $sourceNode->getFileInfo(); @@ -496,7 +496,7 @@ class FilesPlugin extends ServerPlugin { public function sendFileIdHeader($filePath, \Sabre\DAV\INode $node = null) { // chunked upload handling if (isset($_SERVER['HTTP_OC_CHUNKED'])) { - list($path, $name) = \Sabre\Uri\split($filePath); + [$path, $name] = \Sabre\Uri\split($filePath); $info = \OC_FileChunking::decodeName($name); if (!empty($info)) { $filePath = $path . '/' . $info['name']; diff --git a/apps/dav/lib/Connector/Sabre/Node.php b/apps/dav/lib/Connector/Sabre/Node.php index b83e5cbcbc1..b713d0d485b 100644 --- a/apps/dav/lib/Connector/Sabre/Node.php +++ b/apps/dav/lib/Connector/Sabre/Node.php @@ -131,8 +131,8 @@ abstract class Node implements \Sabre\DAV\INode { throw new \Sabre\DAV\Exception\Forbidden(); } - list($parentPath,) = \Sabre\Uri\split($this->path); - list(, $newName) = \Sabre\Uri\split($name); + [$parentPath,] = \Sabre\Uri\split($this->path); + [, $newName] = \Sabre\Uri\split($name); // verify path of the target $this->verifyPath(); diff --git a/apps/dav/lib/Connector/Sabre/ObjectTree.php b/apps/dav/lib/Connector/Sabre/ObjectTree.php index 3a6e355805a..5e4f757492d 100644 --- a/apps/dav/lib/Connector/Sabre/ObjectTree.php +++ b/apps/dav/lib/Connector/Sabre/ObjectTree.php @@ -80,7 +80,7 @@ class ObjectTree extends CachingTree { private function resolveChunkFile($path) { if (isset($_SERVER['HTTP_OC_CHUNKED'])) { // resolve to real file name to find the proper node - list($dir, $name) = \Sabre\Uri\split($path); + [$dir, $name] = \Sabre\Uri\split($path); if ($dir === '/' || $dir === '.') { $dir = ''; } @@ -220,7 +220,7 @@ class ObjectTree extends CachingTree { // this will trigger existence check $this->getNodeForPath($sourcePath); - list($destinationDir, $destinationName) = \Sabre\Uri\split($destinationPath); + [$destinationDir, $destinationName] = \Sabre\Uri\split($destinationPath); try { $this->fileView->verifyPath($destinationDir, $destinationName); } catch (\OCP\Files\InvalidPathException $ex) { @@ -237,7 +237,7 @@ class ObjectTree extends CachingTree { throw new FileLocked($e->getMessage(), $e->getCode(), $e); } - list($destinationDir,) = \Sabre\Uri\split($destinationPath); + [$destinationDir,] = \Sabre\Uri\split($destinationPath); $this->markDirty($destinationDir); } } diff --git a/apps/dav/lib/Connector/Sabre/Principal.php b/apps/dav/lib/Connector/Sabre/Principal.php index c1b1dc1b2d1..2351094a917 100644 --- a/apps/dav/lib/Connector/Sabre/Principal.php +++ b/apps/dav/lib/Connector/Sabre/Principal.php @@ -154,11 +154,11 @@ class Principal implements BackendInterface { * @return array */ public function getPrincipalByPath($path) { - list($prefix, $name) = \Sabre\Uri\split($path); + [$prefix, $name] = \Sabre\Uri\split($path); $decodedName = urldecode($name); if ($name === 'calendar-proxy-write' || $name === 'calendar-proxy-read') { - list($prefix2, $name2) = \Sabre\Uri\split($prefix); + [$prefix2, $name2] = \Sabre\Uri\split($prefix); if ($prefix2 === $this->principalPrefix) { $user = $this->userManager->get($name2); @@ -213,7 +213,7 @@ class Principal implements BackendInterface { * @throws Exception */ public function getGroupMembership($principal, $needGroups = false) { - list($prefix, $name) = \Sabre\Uri\split($principal); + [$prefix, $name] = \Sabre\Uri\split($principal); if ($prefix !== $this->principalPrefix) { return []; @@ -532,7 +532,7 @@ class Principal implements BackendInterface { return []; } - list($prefix, $name) = \Sabre\Uri\split($principal); + [$prefix, $name] = \Sabre\Uri\split($principal); if ($this->hasCircles && $prefix === $this->principalPrefix) { $user = $this->userManager->get($name); if (!$user) { diff --git a/apps/dav/lib/Connector/Sabre/QuotaPlugin.php b/apps/dav/lib/Connector/Sabre/QuotaPlugin.php index 6d17704b103..b71dcd72918 100644 --- a/apps/dav/lib/Connector/Sabre/QuotaPlugin.php +++ b/apps/dav/lib/Connector/Sabre/QuotaPlugin.php @@ -152,7 +152,7 @@ class QuotaPlugin extends \Sabre\DAV\ServerPlugin { } if ($length) { - list($parentPath, $newName) = \Sabre\Uri\split($path); + [$parentPath, $newName] = \Sabre\Uri\split($path); if (is_null($parentPath)) { $parentPath = ''; } diff --git a/apps/dav/lib/Connector/Sabre/SharesPlugin.php b/apps/dav/lib/Connector/Sabre/SharesPlugin.php index 98458ff8bfa..121d1c39ff0 100644 --- a/apps/dav/lib/Connector/Sabre/SharesPlugin.php +++ b/apps/dav/lib/Connector/Sabre/SharesPlugin.php @@ -151,7 +151,7 @@ class SharesPlugin extends \Sabre\DAV\ServerPlugin { if (isset($this->cachedShares[$sabreNode->getId()])) { $shares = $this->cachedShares[$sabreNode->getId()]; } else { - list($parentPath,) = \Sabre\Uri\split($sabreNode->getPath()); + [$parentPath,] = \Sabre\Uri\split($sabreNode->getPath()); if ($parentPath === '') { $parentPath = '/'; } diff --git a/apps/dav/lib/Connector/Sabre/TagsPlugin.php b/apps/dav/lib/Connector/Sabre/TagsPlugin.php index 240010eff48..a2601f5768a 100644 --- a/apps/dav/lib/Connector/Sabre/TagsPlugin.php +++ b/apps/dav/lib/Connector/Sabre/TagsPlugin.php @@ -245,13 +245,13 @@ class TagsPlugin extends \Sabre\DAV\ServerPlugin { $isFav = null; $propFind->handle(self::TAGS_PROPERTYNAME, function () use (&$isFav, $node) { - list($tags, $isFav) = $this->getTagsAndFav($node->getId()); + [$tags, $isFav] = $this->getTagsAndFav($node->getId()); return new TagList($tags); }); $propFind->handle(self::FAVORITE_PROPERTYNAME, function () use ($isFav, $node) { if (is_null($isFav)) { - list(, $isFav) = $this->getTagsAndFav($node->getId()); + [, $isFav] = $this->getTagsAndFav($node->getId()); } if ($isFav) { return 1; diff --git a/apps/dav/lib/DAV/SystemPrincipalBackend.php b/apps/dav/lib/DAV/SystemPrincipalBackend.php index 5ea59f60f9d..48dec96c6f3 100644 --- a/apps/dav/lib/DAV/SystemPrincipalBackend.php +++ b/apps/dav/lib/DAV/SystemPrincipalBackend.php @@ -163,7 +163,7 @@ class SystemPrincipalBackend extends AbstractBackend { * @return array */ public function getGroupMembership($principal) { - list($prefix, ) = \Sabre\Uri\split($principal); + [$prefix, ] = \Sabre\Uri\split($principal); if ($prefix === 'principals/system') { $principal = $this->getPrincipalByPath($principal); diff --git a/apps/dav/lib/Files/FileSearchBackend.php b/apps/dav/lib/Files/FileSearchBackend.php index 50ebed541ee..7fe049a7b2d 100644 --- a/apps/dav/lib/Files/FileSearchBackend.php +++ b/apps/dav/lib/Files/FileSearchBackend.php @@ -312,7 +312,7 @@ class FileSearchBackend implements ISearchBackend { * @return ISearchOperator */ private function transformSearchOperation(Operator $operator) { - list(, $trimmedType) = explode('}', $operator->type); + [, $trimmedType] = explode('}', $operator->type); switch ($operator->type) { case Operator::OPERATION_AND: case Operator::OPERATION_OR: diff --git a/apps/dav/lib/Files/FilesHome.php b/apps/dav/lib/Files/FilesHome.php index 246ec0584b9..698431b6b14 100644 --- a/apps/dav/lib/Files/FilesHome.php +++ b/apps/dav/lib/Files/FilesHome.php @@ -55,7 +55,7 @@ class FilesHome extends Directory { } public function getName() { - list(,$name) = \Sabre\Uri\split($this->principalInfo['uri']); + [,$name] = \Sabre\Uri\split($this->principalInfo['uri']); return $name; } diff --git a/apps/dav/lib/Files/RootCollection.php b/apps/dav/lib/Files/RootCollection.php index 507c40108c3..7924299d207 100644 --- a/apps/dav/lib/Files/RootCollection.php +++ b/apps/dav/lib/Files/RootCollection.php @@ -44,7 +44,7 @@ class RootCollection extends AbstractPrincipalCollection { * @return INode */ public function getChildForPrincipal(array $principalInfo) { - list(,$name) = \Sabre\Uri\split($principalInfo['uri']); + [,$name] = \Sabre\Uri\split($principalInfo['uri']); $user = \OC::$server->getUserSession()->getUser(); if (is_null($user) || $name !== $user->getUID()) { // a user is only allowed to see their own home contents, so in case another collection diff --git a/apps/dav/lib/Traits/PrincipalProxyTrait.php b/apps/dav/lib/Traits/PrincipalProxyTrait.php index 5da4e64a6df..480e2abc209 100644 --- a/apps/dav/lib/Traits/PrincipalProxyTrait.php +++ b/apps/dav/lib/Traits/PrincipalProxyTrait.php @@ -77,7 +77,7 @@ trait PrincipalProxyTrait { * @throws Exception */ public function getGroupMembership($principal, $needGroups = false) { - list($prefix, $name) = \Sabre\Uri\split($principal); + [$prefix, $name] = \Sabre\Uri\split($principal); if ($prefix !== $this->principalPrefix) { return []; @@ -113,7 +113,7 @@ trait PrincipalProxyTrait { * @throws Exception */ public function setGroupMemberSet($principal, array $members) { - list($principalUri, $target) = \Sabre\Uri\split($principal); + [$principalUri, $target] = \Sabre\Uri\split($principal); if ($target !== 'calendar-proxy-write' && $target !== 'calendar-proxy-read') { throw new Exception('Setting members of the group is not supported yet'); @@ -129,11 +129,11 @@ trait PrincipalProxyTrait { $permission |= ProxyMapper::PERMISSION_WRITE; } - list($prefix, $owner) = \Sabre\Uri\split($principalUri); + [$prefix, $owner] = \Sabre\Uri\split($principalUri); $proxies = $this->proxyMapper->getProxiesOf($principalUri); foreach ($members as $member) { - list($prefix, $name) = \Sabre\Uri\split($member); + [$prefix, $name] = \Sabre\Uri\split($member); if ($prefix !== $this->principalPrefix) { throw new Exception('Invalid member group prefix: ' . $prefix); @@ -182,8 +182,8 @@ trait PrincipalProxyTrait { * @return bool */ private function isProxyPrincipal(string $principalUri):bool { - list($realPrincipalUri, $proxy) = \Sabre\Uri\split($principalUri); - list($prefix, $userId) = \Sabre\Uri\split($realPrincipalUri); + [$realPrincipalUri, $proxy] = \Sabre\Uri\split($principalUri); + [$prefix, $userId] = \Sabre\Uri\split($realPrincipalUri); if (!isset($prefix) || !isset($userId)) { return false; @@ -201,7 +201,7 @@ trait PrincipalProxyTrait { * @return bool */ private function isReadProxyPrincipal(string $principalUri):bool { - list(, $proxy) = \Sabre\Uri\split($principalUri); + [, $proxy] = \Sabre\Uri\split($principalUri); return $proxy === 'calendar-proxy-read'; } @@ -210,7 +210,7 @@ trait PrincipalProxyTrait { * @return bool */ private function isWriteProxyPrincipal(string $principalUri):bool { - list(, $proxy) = \Sabre\Uri\split($principalUri); + [, $proxy] = \Sabre\Uri\split($principalUri); return $proxy === 'calendar-proxy-write'; } @@ -219,7 +219,7 @@ trait PrincipalProxyTrait { * @return string */ private function getPrincipalUriFromProxyPrincipal(string $principalUri):string { - list($realPrincipalUri, ) = \Sabre\Uri\split($principalUri); + [$realPrincipalUri, ] = \Sabre\Uri\split($principalUri); return $realPrincipalUri; } } diff --git a/apps/dav/lib/Upload/UploadHome.php b/apps/dav/lib/Upload/UploadHome.php index 0843ff930d3..b25a2824d3f 100644 --- a/apps/dav/lib/Upload/UploadHome.php +++ b/apps/dav/lib/Upload/UploadHome.php @@ -74,7 +74,7 @@ class UploadHome implements ICollection { } public function getName() { - list(,$name) = \Sabre\Uri\split($this->principalInfo['uri']); + [,$name] = \Sabre\Uri\split($this->principalInfo['uri']); return $name; } diff --git a/apps/dav/tests/unit/CalDAV/Reminder/NotificationProvider/EmailProviderTest.php b/apps/dav/tests/unit/CalDAV/Reminder/NotificationProvider/EmailProviderTest.php index b31957d4f2d..1b3cbb31f58 100644 --- a/apps/dav/tests/unit/CalDAV/Reminder/NotificationProvider/EmailProviderTest.php +++ b/apps/dav/tests/unit/CalDAV/Reminder/NotificationProvider/EmailProviderTest.php @@ -81,7 +81,7 @@ class EmailProviderTest extends AbstractNotificationProviderTest { } public function testSendWithoutAttendees():void { - list($user1, $user2, $user3, , $user5) = $users = $this->getUsers(); + [$user1, $user2, $user3, , $user5] = $users = $this->getUsers(); $enL10N = $this->createMock(IL10N::class); $enL10N->method('t') @@ -191,7 +191,7 @@ class EmailProviderTest extends AbstractNotificationProviderTest { } public function testSendWithAttendees(): void { - list($user1, $user2, $user3, , $user5) = $users = $this->getUsers(); + [$user1, $user2, $user3, , $user5] = $users = $this->getUsers(); $enL10N = $this->createMock(IL10N::class); $enL10N->method('t') diff --git a/apps/dav/tests/unit/CardDAV/AddressBookImplTest.php b/apps/dav/tests/unit/CardDAV/AddressBookImplTest.php index 5b28e6b025b..85be3a4bfb5 100644 --- a/apps/dav/tests/unit/CardDAV/AddressBookImplTest.php +++ b/apps/dav/tests/unit/CardDAV/AddressBookImplTest.php @@ -201,7 +201,7 @@ class AddressBookImplTest extends TestCase { ->willReturn(['carddata' => 'data']); $addressBookImpl->expects($this->once())->method('readCard') ->with('data')->willReturn($this->vCard); - $this->vCard->expects($this->exactly(count($properties)-1)) + $this->vCard->expects($this->exactly(count($properties) - 1)) ->method('createProperty'); $this->backend->expects($this->never())->method('createCard'); $this->backend->expects($this->once())->method('updateCard'); @@ -237,7 +237,7 @@ class AddressBookImplTest extends TestCase { $addressBookImpl->expects($this->once())->method('readCard') ->with('data')->willReturn($this->vCard); $this->vCard->method('createProperty')->willReturn($textProperty); - $this->vCard->expects($this->exactly(count($properties)-1)) + $this->vCard->expects($this->exactly(count($properties) - 1)) ->method('createProperty'); $this->vCard->expects($this->once())->method('remove') ->with('ADR'); diff --git a/apps/dav/tests/unit/Connector/Sabre/FileTest.php b/apps/dav/tests/unit/Connector/Sabre/FileTest.php index 904faa8e8c3..bf3890432ec 100644 --- a/apps/dav/tests/unit/Connector/Sabre/FileTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/FileTest.php @@ -1087,7 +1087,7 @@ class FileTest extends TestCase { $userView = \OC\Files\Filesystem::getView(); } $files = []; - list($storage, $internalPath) = $userView->resolvePath($path); + [$storage, $internalPath] = $userView->resolvePath($path); if ($storage instanceof Local) { $realPath = $storage->getSourcePath($internalPath); $dh = opendir($realPath); |