Bumps [nextcloud/coding-standard](https://github.com/nextcloud/coding-standard) from 0.3.0 to 0.5.0. - [Release notes](https://github.com/nextcloud/coding-standard/releases) - [Changelog](https://github.com/nextcloud/coding-standard/blob/master/CHANGELOG.md) - [Commits](https://github.com/nextcloud/coding-standard/compare/v0.3.0...v0.5.0) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>tags/v22.0.0beta1
@@ -9,12 +9,12 @@ use Nextcloud\CodingStandard\Config; | |||
$config = new Config(); | |||
$config | |||
->getFinder() | |||
->ignoreVCSIgnored(true) | |||
->exclude('config') | |||
->exclude('data') | |||
->notPath('3rdparty') | |||
->notPath('build/stubs') | |||
->notPath('composer') | |||
->notPath('node_modules') | |||
->notPath('vendor') | |||
->in(__DIR__); | |||
return $config; |
@@ -133,7 +133,7 @@ class Notifier implements INotifier { | |||
if (strpos($path, '/' . $notification->getUser() . '/files/') === 0) { | |||
// Remove /user/files/... | |||
$fullPath = $path; | |||
list(,,, $path) = explode('/', $fullPath, 4); | |||
[,,, $path] = explode('/', $fullPath, 4); | |||
} | |||
$subjectParameters = [ | |||
'file' => [ | |||
@@ -155,7 +155,7 @@ class Notifier implements INotifier { | |||
'name' => $displayName, | |||
]; | |||
} | |||
list($message, $messageParameters) = $this->commentToRichMessage($comment); | |||
[$message, $messageParameters] = $this->commentToRichMessage($comment); | |||
$notification->setRichSubject($subject, $subjectParameters) | |||
->setParsedSubject($this->richToParsed($subject, $subjectParameters)) | |||
->setRichMessage($message, $messageParameters) |
@@ -170,7 +170,7 @@ class AddressBook extends ExternalAddressBook implements IACL { | |||
} | |||
private function getUid(): string { | |||
list(, $uid) = \Sabre\Uri\split($this->principalUri); | |||
[, $uid] = \Sabre\Uri\split($this->principalUri); | |||
return $uid; | |||
} | |||
} |
@@ -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'); |
@@ -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; | |||
} | |||
@@ -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"; | |||
} |
@@ -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; | |||
} | |||
} |
@@ -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']) |
@@ -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), |
@@ -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 || |
@@ -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; |
@@ -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"; | |||
} |
@@ -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 { |
@@ -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; | |||
} | |||
} |
@@ -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 |
@@ -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"; | |||
} |
@@ -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); |
@@ -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']; |
@@ -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(); |
@@ -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); | |||
} | |||
} |
@@ -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) { |
@@ -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 = ''; | |||
} |
@@ -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 = '/'; | |||
} |
@@ -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; |
@@ -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); |
@@ -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: |
@@ -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; | |||
} | |||
@@ -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 |
@@ -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; | |||
} | |||
} |
@@ -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; | |||
} | |||
@@ -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') |
@@ -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'); |
@@ -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); |
@@ -423,7 +423,7 @@ class EncryptAll { | |||
} | |||
$subject = $this->l->t('one-time password for server-side-encryption'); | |||
list($htmlBody, $textBody) = $this->createMailBody($password); | |||
[$htmlBody, $textBody] = $this->createMailBody($password); | |||
// send it out now | |||
try { |
@@ -138,7 +138,7 @@ class MountPublicLinkController extends Controller { | |||
} | |||
try { | |||
list(, $server) = $this->addressHandler->splitUserRemote($shareWith); | |||
[, $server] = $this->addressHandler->splitUserRemote($shareWith); | |||
$share = $this->shareManager->getShareByToken($token); | |||
} catch (HintException $e) { | |||
return new JSONResponse(['message' => $e->getHint()], Http::STATUS_BAD_REQUEST); |
@@ -219,7 +219,7 @@ class RequestHandlerController extends OCSController { | |||
try { | |||
$provider = $this->cloudFederationProviderManager->getCloudFederationProvider('file'); | |||
list($newToken, $localId) = $provider->notificationReceived('REQUEST_RESHARE', $id, $notification); | |||
[$newToken, $localId] = $provider->notificationReceived('REQUEST_RESHARE', $id, $notification); | |||
return new Http\DataResponse([ | |||
'token' => $newToken, | |||
'remoteId' => $localId |
@@ -221,7 +221,7 @@ class FederatedShareProvider implements IShareProvider { | |||
$ownerCloudId = $this->cloudIdManager->getCloudId($remoteShare['owner'], $remoteShare['remote']); | |||
$shareId = $this->addShareToDB($itemSource, $itemType, $shareWith, $sharedBy, $ownerCloudId->getId(), $permissions, 'tmp_token_' . time(), $shareType); | |||
$share->setId($shareId); | |||
list($token, $remoteId) = $this->askOwnerToReShare($shareWith, $share, $shareId); | |||
[$token, $remoteId] = $this->askOwnerToReShare($shareWith, $share, $shareId); | |||
// remote share was create successfully if we get a valid token as return | |||
$send = is_string($token) && $token !== ''; | |||
} catch (\Exception $e) { | |||
@@ -323,7 +323,7 @@ class FederatedShareProvider implements IShareProvider { | |||
$remoteId = $remoteShare['remote_id']; | |||
$remote = $remoteShare['remote']; | |||
list($token, $remoteId) = $this->notifications->requestReShare( | |||
[$token, $remoteId] = $this->notifications->requestReShare( | |||
$token, | |||
$remoteId, | |||
$shareId, | |||
@@ -435,9 +435,9 @@ class FederatedShareProvider implements IShareProvider { | |||
$remoteId = $this->getRemoteId($share); | |||
// if the local user is the owner we send the permission change to the initiator | |||
if ($this->userManager->userExists($share->getShareOwner())) { | |||
list(, $remote) = $this->addressHandler->splitUserRemote($share->getSharedBy()); | |||
[, $remote] = $this->addressHandler->splitUserRemote($share->getSharedBy()); | |||
} else { // ... if not we send the permission change to the owner | |||
list(, $remote) = $this->addressHandler->splitUserRemote($share->getShareOwner()); | |||
[, $remote] = $this->addressHandler->splitUserRemote($share->getShareOwner()); | |||
} | |||
$this->notifications->sendPermissionChange($remote, $remoteId, $share->getToken(), $share->getPermissions()); | |||
} | |||
@@ -541,7 +541,7 @@ class FederatedShareProvider implements IShareProvider { | |||
* @throws \OC\HintException | |||
*/ | |||
public function delete(IShare $share) { | |||
list(, $remote) = $this->addressHandler->splitUserRemote($share->getSharedWith()); | |||
[, $remote] = $this->addressHandler->splitUserRemote($share->getSharedWith()); | |||
// if the local user is the owner we can send the unShare request directly... | |||
if ($this->userManager->userExists($share->getShareOwner())) { | |||
@@ -576,9 +576,9 @@ class FederatedShareProvider implements IShareProvider { | |||
// also send a unShare request to the initiator, if this is a different user than the owner | |||
if ($share->getShareOwner() !== $share->getSharedBy()) { | |||
if ($isOwner) { | |||
list(, $remote) = $this->addressHandler->splitUserRemote($share->getSharedBy()); | |||
[, $remote] = $this->addressHandler->splitUserRemote($share->getSharedBy()); | |||
} else { | |||
list(, $remote) = $this->addressHandler->splitUserRemote($share->getShareOwner()); | |||
[, $remote] = $this->addressHandler->splitUserRemote($share->getShareOwner()); | |||
} | |||
$remoteId = $this->getRemoteId($share); | |||
$this->notifications->sendRevokeShare($remote, $remoteId, $share->getToken()); |
@@ -95,7 +95,7 @@ class Notifications { | |||
* @throws \OC\ServerNotAvailableException | |||
*/ | |||
public function sendRemoteShare($token, $shareWith, $name, $remoteId, $owner, $ownerFederatedId, $sharedBy, $sharedByFederatedId, $shareType) { | |||
list($user, $remote) = $this->addressHandler->splitUserRemote($shareWith); | |||
[$user, $remote] = $this->addressHandler->splitUserRemote($shareWith); | |||
if ($user && $remote) { | |||
$local = $this->addressHandler->generateRemoteURL(); |
@@ -183,7 +183,7 @@ class CloudFederationProviderFiles implements ICloudFederationProvider { | |||
throw new ProviderCouldNotAddShareException('Unsupported protocol for data exchange.', '', Http::STATUS_NOT_IMPLEMENTED); | |||
} | |||
list($ownerUid, $remote) = $this->addressHandler->splitUserRemote($share->getOwner()); | |||
[$ownerUid, $remote] = $this->addressHandler->splitUserRemote($share->getOwner()); | |||
// for backward compatibility make sure that the remote url stored in the | |||
// database ends with a trailing slash | |||
if (substr($remote, -1) !== '/') { | |||
@@ -385,7 +385,7 @@ class CloudFederationProviderFiles implements ICloudFederationProvider { | |||
$this->verifyShare($share, $token); | |||
$this->executeAcceptShare($share); | |||
if ($share->getShareOwner() !== $share->getSharedBy()) { | |||
list(, $remote) = $this->addressHandler->splitUserRemote($share->getSharedBy()); | |||
[, $remote] = $this->addressHandler->splitUserRemote($share->getSharedBy()); | |||
$remoteId = $this->federatedShareProvider->getRemoteId($share); | |||
$notification = $this->cloudFederationFactory->getCloudFederationNotification(); | |||
$notification->setMessage( | |||
@@ -411,7 +411,7 @@ class CloudFederationProviderFiles implements ICloudFederationProvider { | |||
protected function executeAcceptShare(IShare $share) { | |||
try { | |||
$fileId = (int)$share->getNode()->getId(); | |||
list($file, $link) = $this->getFile($this->getCorrectUid($share), $fileId); | |||
[$file, $link] = $this->getFile($this->getCorrectUid($share), $fileId); | |||
} catch (\Exception $e) { | |||
throw new ShareNotFound(); | |||
} | |||
@@ -455,7 +455,7 @@ class CloudFederationProviderFiles implements ICloudFederationProvider { | |||
$this->verifyShare($share, $token); | |||
if ($share->getShareOwner() !== $share->getSharedBy()) { | |||
list(, $remote) = $this->addressHandler->splitUserRemote($share->getSharedBy()); | |||
[, $remote] = $this->addressHandler->splitUserRemote($share->getSharedBy()); | |||
$remoteId = $this->federatedShareProvider->getRemoteId($share); | |||
$notification = $this->cloudFederationFactory->getCloudFederationNotification(); | |||
$notification->setMessage( | |||
@@ -487,7 +487,7 @@ class CloudFederationProviderFiles implements ICloudFederationProvider { | |||
try { | |||
$fileId = (int)$share->getNode()->getId(); | |||
list($file, $link) = $this->getFile($this->getCorrectUid($share), $fileId); | |||
[$file, $link] = $this->getFile($this->getCorrectUid($share), $fileId); | |||
} catch (\Exception $e) { | |||
throw new ShareNotFound(); | |||
} | |||
@@ -642,7 +642,7 @@ class CloudFederationProviderFiles implements ICloudFederationProvider { | |||
$share = $this->federatedShareProvider->getShareById($id); | |||
// don't allow to share a file back to the owner | |||
try { | |||
list($user, $remote) = $this->addressHandler->splitUserRemote($shareWith); | |||
[$user, $remote] = $this->addressHandler->splitUserRemote($shareWith); | |||
$owner = $share->getShareOwner(); | |||
$currentServer = $this->addressHandler->generateRemoteURL(); | |||
if ($this->addressHandler->compareAddresses($user, $remote, $owner, $currentServer)) { |
@@ -108,7 +108,7 @@ class AddressHandlerTest extends \Test\TestCase { | |||
->method('search') | |||
->willReturn([]); | |||
list($remoteUser, $remoteUrl) = $this->addressHandler->splitUserRemote($remote); | |||
[$remoteUser, $remoteUrl] = $this->addressHandler->splitUserRemote($remote); | |||
$this->assertSame($expectedUser, $remoteUser); | |||
$this->assertSame($expectedUrl, $remoteUrl); | |||
} |
@@ -363,7 +363,7 @@ class Provider implements IProvider { | |||
try { | |||
$fullPath = rtrim($encryptionContainer->getPath(), '/'); | |||
// Remove /user/files/... | |||
list(,,, $path) = explode('/', $fullPath, 4); | |||
[,,, $path] = explode('/', $fullPath, 4); | |||
if (!$path) { | |||
throw new InvalidPathException('Path could not be split correctly'); | |||
} |
@@ -180,7 +180,7 @@ class Scan extends Base { | |||
$inputPath = $input->getOption('path'); | |||
if ($inputPath) { | |||
$inputPath = '/' . trim($inputPath, '/'); | |||
list(, $user,) = explode('/', $inputPath, 3); | |||
[, $user,] = explode('/', $inputPath, 3); | |||
$users = [$user]; | |||
} elseif ($input->getOption('all')) { | |||
$users = $this->userManager->search(''); |
@@ -153,7 +153,7 @@ class Create extends Base { | |||
$output->writeln('<error>Invalid mount configuration option "' . $configOption . '"</error>'); | |||
return 1; | |||
} | |||
list($key, $value) = explode('=', $configOption, 2); | |||
[$key, $value] = explode('=', $configOption, 2); | |||
if (!$this->validateParam($key, $value, $storageBackend, $authBackend)) { | |||
$output->writeln('<error>Unknown configuration for backends "' . $key . '"</error>'); | |||
return 1; |
@@ -111,7 +111,7 @@ class Verify extends Base { | |||
$output->writeln('<error>Invalid mount configuration option "' . $configOption . '"</error>'); | |||
return; | |||
} | |||
list($key, $value) = explode('=', $configOption, 2); | |||
[$key, $value] = explode('=', $configOption, 2); | |||
$storage->setBackendOption($key, $value); | |||
} | |||
@@ -223,7 +223,7 @@ class ShareesAPIController extends OCSController { | |||
$this->result['lookupEnabled'] = $this->config->getAppValue('files_sharing', 'lookupServerEnabled', 'yes') === 'yes'; | |||
} | |||
list($result, $hasMoreResults) = $this->collaboratorSearch->search($search, $shareTypes, $lookup, $this->limit, $this->offset); | |||
[$result, $hasMoreResults] = $this->collaboratorSearch->search($search, $shareTypes, $lookup, $this->limit, $this->offset); | |||
// extra treatment for 'exact' subarray, with a single merge expected keys might be lost | |||
if (isset($result['exact'])) { | |||
@@ -290,7 +290,7 @@ class ShareesAPIController extends OCSController { | |||
foreach ($shareTypes as $shareType) { | |||
$sharees = $this->getAllShareesByType($user, $shareType); | |||
$shareTypeResults = []; | |||
foreach ($sharees as list($sharee, $displayname)) { | |||
foreach ($sharees as [$sharee, $displayname]) { | |||
if (!isset($this->searchResultTypeMap[$shareType])) { | |||
continue; | |||
} |
@@ -40,7 +40,7 @@ class Cache extends \OC\Files\Cache\Cache { | |||
public function __construct($storage, ICloudId $cloudId) { | |||
$this->cloudId = $cloudId; | |||
$this->storage = $storage; | |||
list(, $remote) = explode('://', $cloudId->getRemote(), 2); | |||
[, $remote] = explode('://', $cloudId->getRemote(), 2); | |||
$this->remote = $remote; | |||
$this->remoteUser = $cloudId->getUser(); | |||
parent::__construct($storage); |
@@ -73,9 +73,9 @@ class Storage extends DAV implements ISharedStorage, IDisableEncryptionStorage { | |||
$this->cloudId = $options['cloudId']; | |||
$discoveryService = \OC::$server->query(\OCP\OCS\IDiscoveryService::class); | |||
list($protocol, $remote) = explode('://', $this->cloudId->getRemote()); | |||
[$protocol, $remote] = explode('://', $this->cloudId->getRemote()); | |||
if (strpos($remote, '/')) { | |||
list($host, $root) = explode('/', $remote, 2); | |||
[$host, $root] = explode('/', $remote, 2); | |||
} else { | |||
$host = $remote; | |||
$root = ''; |
@@ -63,7 +63,7 @@ class Scanner extends \OC\Files\Cache\Scanner { | |||
} | |||
if ($this->storage->instanceOfStorage('\OCA\Files_Sharing\SharedStorage')) { | |||
/** @var \OC\Files\Storage\Storage $storage */ | |||
list($storage) = $this->storage->resolvePath(''); | |||
[$storage] = $this->storage->resolvePath(''); | |||
$this->sourceScanner = $storage->getScanner(); | |||
return $this->sourceScanner; | |||
} else { |
@@ -90,7 +90,7 @@ class CacheTest extends TestCase { | |||
$this->view->file_put_contents('container/shareddir/subdir/another too.txt', $textData); | |||
$this->view->file_put_contents('container/shareddir/subdir/not a text file.xml', '<xml></xml>'); | |||
list($this->ownerStorage,) = $this->view->resolvePath(''); | |||
[$this->ownerStorage,] = $this->view->resolvePath(''); | |||
$this->ownerCache = $this->ownerStorage->getCache(); | |||
$this->ownerStorage->getScanner()->scan(''); | |||
@@ -124,7 +124,7 @@ class CacheTest extends TestCase { | |||
// retrieve the shared storage | |||
$secondView = new \OC\Files\View('/' . self::TEST_FILES_SHARING_API_USER2); | |||
list($this->sharedStorage,) = $secondView->resolvePath('files/shareddir'); | |||
[$this->sharedStorage,] = $secondView->resolvePath('files/shareddir'); | |||
$this->sharedCache = $this->sharedStorage->getCache(); | |||
} | |||
@@ -213,7 +213,7 @@ class CacheTest extends TestCase { | |||
*/ | |||
public function testSearch() { | |||
foreach ($this->searchDataProvider() as $data) { | |||
list($pattern, $expectedFiles) = $data; | |||
[$pattern, $expectedFiles] = $data; | |||
$results = $this->sharedStorage->getCache()->search($pattern); | |||
@@ -410,7 +410,7 @@ class CacheTest extends TestCase { | |||
self::loginHelper(self::TEST_FILES_SHARING_API_USER2); | |||
$this->assertTrue(\OC\Files\Filesystem::file_exists('/test.txt')); | |||
list($sharedStorage) = \OC\Files\Filesystem::resolvePath('/' . self::TEST_FILES_SHARING_API_USER2 . '/files/test.txt'); | |||
[$sharedStorage] = \OC\Files\Filesystem::resolvePath('/' . self::TEST_FILES_SHARING_API_USER2 . '/files/test.txt'); | |||
/** | |||
* @var \OCA\Files_Sharing\SharedStorage $sharedStorage | |||
*/ | |||
@@ -442,7 +442,7 @@ class CacheTest extends TestCase { | |||
self::loginHelper(self::TEST_FILES_SHARING_API_USER2); | |||
$this->assertTrue(\OC\Files\Filesystem::file_exists('/foo')); | |||
list($sharedStorage) = \OC\Files\Filesystem::resolvePath('/' . self::TEST_FILES_SHARING_API_USER2 . '/files/foo'); | |||
[$sharedStorage] = \OC\Files\Filesystem::resolvePath('/' . self::TEST_FILES_SHARING_API_USER2 . '/files/foo'); | |||
/** | |||
* @var \OCA\Files_Sharing\SharedStorage $sharedStorage | |||
*/ | |||
@@ -469,12 +469,12 @@ class CacheTest extends TestCase { | |||
$this->shareManager->updateShare($share); | |||
\OC_Util::tearDownFS(); | |||
list($sourceStorage) = \OC\Files\Filesystem::resolvePath('/' . self::TEST_FILES_SHARING_API_USER1 . '/files/foo'); | |||
[$sourceStorage] = \OC\Files\Filesystem::resolvePath('/' . self::TEST_FILES_SHARING_API_USER1 . '/files/foo'); | |||
self::loginHelper(self::TEST_FILES_SHARING_API_USER2); | |||
$this->assertTrue(\OC\Files\Filesystem::file_exists('/foo')); | |||
/** @var SharedStorage $sharedStorage */ | |||
list($sharedStorage) = \OC\Files\Filesystem::resolvePath('/' . self::TEST_FILES_SHARING_API_USER2 . '/files/foo'); | |||
[$sharedStorage] = \OC\Files\Filesystem::resolvePath('/' . self::TEST_FILES_SHARING_API_USER2 . '/files/foo'); | |||
$this->assertEquals($sourceStorage->getCache()->getNumericStorageId(), $sharedStorage->getCache()->getNumericStorageId()); | |||
} | |||
@@ -511,7 +511,7 @@ class CacheTest extends TestCase { | |||
\OC\Files\Filesystem::file_put_contents('/sub/bar.txt', 'bar'); | |||
/** @var SharedStorage $sharedStorage */ | |||
list($sharedStorage) = \OC\Files\Filesystem::resolvePath('/' . self::TEST_FILES_SHARING_API_USER2 . '/files/sub'); | |||
[$sharedStorage] = \OC\Files\Filesystem::resolvePath('/' . self::TEST_FILES_SHARING_API_USER2 . '/files/sub'); | |||
$this->assertTrue($sharedStorage->getCache()->inCache('bar.txt')); | |||
@@ -76,7 +76,7 @@ class PermissionsTest extends TestCase { | |||
$this->view->file_put_contents('container/shareddir/textfile.txt', $textData); | |||
$this->view->file_put_contents('container/shareddirrestricted/textfile1.txt', $textData); | |||
list($this->ownerStorage, $internalPath) = $this->view->resolvePath(''); | |||
[$this->ownerStorage, $internalPath] = $this->view->resolvePath(''); | |||
$this->ownerCache = $this->ownerStorage->getCache(); | |||
$this->ownerStorage->getScanner()->scan(''); | |||
@@ -110,8 +110,8 @@ class PermissionsTest extends TestCase { | |||
// retrieve the shared storage | |||
$this->secondView = new \OC\Files\View('/' . self::TEST_FILES_SHARING_API_USER2); | |||
list($this->sharedStorage, $internalPath) = $this->secondView->resolvePath('files/shareddir'); | |||
list($this->sharedStorageRestrictedShare, $internalPath) = $this->secondView->resolvePath('files/shareddirrestricted'); | |||
[$this->sharedStorage, $internalPath] = $this->secondView->resolvePath('files/shareddir'); | |||
[$this->sharedStorageRestrictedShare, $internalPath] = $this->secondView->resolvePath('files/shareddirrestricted'); | |||
$this->sharedCache = $this->sharedStorage->getCache(); | |||
$this->sharedCacheRestrictedShare = $this->sharedStorageRestrictedShare->getCache(); | |||
} |
@@ -107,7 +107,7 @@ class SharedStorageTest extends TestCase { | |||
// delete the local folder | |||
/** @var \OC\Files\Storage\Storage $storage */ | |||
list($storage, $internalPath) = \OC\Files\Filesystem::resolvePath('/' . self::TEST_FILES_SHARING_API_USER2 . '/files/localfolder'); | |||
[$storage, $internalPath] = \OC\Files\Filesystem::resolvePath('/' . self::TEST_FILES_SHARING_API_USER2 . '/files/localfolder'); | |||
$storage->rmdir($internalPath); | |||
//enforce reload of the mount points | |||
@@ -442,7 +442,7 @@ class SharedStorageTest extends TestCase { | |||
/** | |||
* @var \OCP\Files\Storage $sharedStorage | |||
*/ | |||
list($sharedStorage,) = $view->resolvePath($this->folder); | |||
[$sharedStorage,] = $view->resolvePath($this->folder); | |||
$this->assertTrue($sharedStorage->instanceOfStorage('OCA\Files_Sharing\ISharedStorage')); | |||
$sourceStorage = new \OC\Files\Storage\Temporary([]); | |||
@@ -475,7 +475,7 @@ class SharedStorageTest extends TestCase { | |||
/** | |||
* @var \OCP\Files\Storage $sharedStorage | |||
*/ | |||
list($sharedStorage,) = $view->resolvePath($this->folder); | |||
[$sharedStorage,] = $view->resolvePath($this->folder); | |||
$this->assertTrue($sharedStorage->instanceOfStorage('OCA\Files_Sharing\ISharedStorage')); | |||
$sourceStorage = new \OC\Files\Storage\Temporary([]); |
@@ -64,7 +64,7 @@ class WatcherTest extends TestCase { | |||
$this->view->mkdir('container/shareddir'); | |||
$this->view->mkdir('container/shareddir/subdir'); | |||
list($this->ownerStorage, $internalPath) = $this->view->resolvePath(''); | |||
[$this->ownerStorage, $internalPath] = $this->view->resolvePath(''); | |||
$this->ownerCache = $this->ownerStorage->getCache(); | |||
$this->ownerStorage->getScanner()->scan(''); | |||
@@ -85,7 +85,7 @@ class WatcherTest extends TestCase { | |||
// retrieve the shared storage | |||
$secondView = new \OC\Files\View('/' . self::TEST_FILES_SHARING_API_USER2); | |||
list($this->sharedStorage, $internalPath) = $secondView->resolvePath('files/shareddir'); | |||
[$this->sharedStorage, $internalPath] = $secondView->resolvePath('files/shareddir'); | |||
$this->sharedCache = $this->sharedStorage->getCache(); | |||
} | |||
@@ -59,7 +59,7 @@ class RootCollection extends AbstractPrincipalCollection { | |||
* @return INode | |||
*/ | |||
public function getChildForPrincipal(array $principalInfo): TrashHome { | |||
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()) { | |||
throw new \Sabre\DAV\Exception\Forbidden(); |
@@ -58,7 +58,7 @@ class TrashHome implements ICollection { | |||
} | |||
public function getName(): string { | |||
list(, $name) = \Sabre\Uri\split($this->principalInfo['uri']); | |||
[, $name] = \Sabre\Uri\split($this->principalInfo['uri']); | |||
return $name; | |||
} | |||
@@ -198,7 +198,7 @@ class TrashbinTest extends \Test\TestCase { | |||
$manipulatedList = $this->manipulateDeleteTime($filesInTrash, $this->trashRoot1, $expiredDate); | |||
$testClass = new TrashbinForTesting(); | |||
list($sizeOfDeletedFiles, $count) = $testClass->dummyDeleteExpiredFiles($manipulatedList, $expireAt); | |||
[$sizeOfDeletedFiles, $count] = $testClass->dummyDeleteExpiredFiles($manipulatedList, $expireAt); | |||
$this->assertSame(10, $sizeOfDeletedFiles); | |||
$this->assertSame(2, $count); | |||
@@ -657,7 +657,7 @@ class TrashbinTest extends \Test\TestCase { | |||
$trashedFile = $filesInTrash[0]; | |||
// delete source folder | |||
list($storage, $internalPath) = $this->rootView->resolvePath('/' . self::TEST_TRASHBIN_USER1 . '/files/folder'); | |||
[$storage, $internalPath] = $this->rootView->resolvePath('/' . self::TEST_TRASHBIN_USER1 . '/files/folder'); | |||
if ($storage instanceof \OC\Files\Storage\Local) { | |||
$folderAbsPath = $storage->getSourcePath($internalPath); | |||
// make folder read-only |
@@ -70,7 +70,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()) { | |||
throw new \Sabre\DAV\Exception\Forbidden(); |
@@ -53,7 +53,7 @@ class VersionHome implements ICollection { | |||
} | |||
private function getUser() { | |||
list(, $name) = \Sabre\Uri\split($this->principalInfo['uri']); | |||
[, $name] = \Sabre\Uri\split($this->principalInfo['uri']); | |||
$user = $this->userManager->get($name); | |||
if (!$user) { | |||
throw new NoUserException(); |
@@ -129,7 +129,7 @@ class Storage { | |||
* @param string $source source path | |||
*/ | |||
public static function setSourcePathAndUser($source) { | |||
list($uid, $path) = self::getUidAndFilename($source); | |||
[$uid, $path] = self::getUidAndFilename($source); | |||
self::$sourcePathAndUser[$source] = ['uid' => $uid, 'path' => $path]; | |||
} | |||
@@ -179,7 +179,7 @@ class Storage { | |||
return false; | |||
} | |||
list($uid, $filename) = self::getUidAndFilename($filename); | |||
[$uid, $filename] = self::getUidAndFilename($filename); | |||
$files_view = new View('/'.$uid .'/files'); | |||
@@ -214,7 +214,7 @@ class Storage { | |||
* @param string $path | |||
*/ | |||
public static function markDeletedFile($path) { | |||
list($uid, $filename) = self::getUidAndFilename($path); | |||
[$uid, $filename] = self::getUidAndFilename($path); | |||
self::$deletedFiles[$path] = [ | |||
'uid' => $uid, | |||
'filename' => $filename]; | |||
@@ -232,7 +232,7 @@ class Storage { | |||
* @var \OC\Files\Storage\Storage $storage | |||
* @var string $internalPath | |||
*/ | |||
list($storage, $internalPath) = $view->resolvePath($path); | |||
[$storage, $internalPath] = $view->resolvePath($path); | |||
$cache = $storage->getCache($internalPath); | |||
$cache->remove($internalPath); | |||
} | |||
@@ -270,7 +270,7 @@ class Storage { | |||
* @param string $operation can be 'copy' or 'rename' | |||
*/ | |||
public static function renameOrCopy($sourcePath, $targetPath, $operation) { | |||
list($sourceOwner, $sourcePath) = self::getSourcePathAndUser($sourcePath); | |||
[$sourceOwner, $sourcePath] = self::getSourcePathAndUser($sourcePath); | |||
// it was a upload of a existing file if no old path exists | |||
// in this case the pre-hook already called the store method and we can | |||
@@ -279,7 +279,7 @@ class Storage { | |||
return true; | |||
} | |||
list($targetOwner, $targetPath) = self::getUidAndFilename($targetPath); | |||
[$targetOwner, $targetPath] = self::getUidAndFilename($targetPath); | |||
$sourcePath = ltrim($sourcePath, '/'); | |||
$targetPath = ltrim($targetPath, '/'); | |||
@@ -399,9 +399,9 @@ class Storage { | |||
*/ | |||
private static function copyFileContents($view, $path1, $path2) { | |||
/** @var \OC\Files\Storage\Storage $storage1 */ | |||
list($storage1, $internalPath1) = $view->resolvePath($path1); | |||
[$storage1, $internalPath1] = $view->resolvePath($path1); | |||
/** @var \OC\Files\Storage\Storage $storage2 */ | |||
list($storage2, $internalPath2) = $view->resolvePath($path2); | |||
[$storage2, $internalPath2] = $view->resolvePath($path2); | |||
$view->lockFile($path1, ILockingProvider::LOCK_EXCLUSIVE); | |||
$view->lockFile($path2, ILockingProvider::LOCK_EXCLUSIVE); | |||
@@ -410,7 +410,7 @@ class Storage { | |||
if ($storage1->instanceOfStorage('\OC\Files\ObjectStore\ObjectStoreStorage') || $storage2->instanceOfStorage('\OC\Files\ObjectStore\ObjectStoreStorage')) { | |||
$source = $storage1->fopen($internalPath1, 'r'); | |||
$target = $storage2->fopen($internalPath2, 'w'); | |||
list(, $result) = \OC_Helper::streamCopy($source, $target); | |||
[, $result] = \OC_Helper::streamCopy($source, $target); | |||
fclose($source); | |||
fclose($target); | |||
@@ -611,7 +611,7 @@ class Storage { | |||
$expiration = self::getExpiration(); | |||
if ($expiration->shouldAutoExpire()) { | |||
list($toDelete, $size) = self::getAutoExpireList($time, $versions); | |||
[$toDelete, $size] = self::getAutoExpireList($time, $versions); | |||
} else { | |||
$size = 0; | |||
$toDelete = []; // versions we want to delete | |||
@@ -778,7 +778,7 @@ class Storage { | |||
$allVersions = Storage::getVersions($uid, $filename); | |||
$time = time(); | |||
list($toDelete, $sizeOfDeletedVersions) = self::getExpireList($time, $allVersions, $availableSpace <= 0); | |||
[$toDelete, $sizeOfDeletedVersions] = self::getExpireList($time, $allVersions, $availableSpace <= 0); | |||
$availableSpace = $availableSpace + $sizeOfDeletedVersions; | |||
$versionsSize = $versionsSize - $sizeOfDeletedVersions; | |||
@@ -789,7 +789,7 @@ class Storage { | |||
$allVersions = $result['all']; | |||
foreach ($result['by_file'] as $versions) { | |||
list($toDeleteNew, $size) = self::getExpireList($time, $versions, $availableSpace <= 0); | |||
[$toDeleteNew, $size] = self::getExpireList($time, $versions, $availableSpace <= 0); | |||
$toDelete = array_merge($toDelete, $toDeleteNew); | |||
$sizeOfDeletedVersions += $size; | |||
} |
@@ -189,7 +189,7 @@ class UsersController extends Controller { | |||
); | |||
$groupsInfo->setSorting($sortGroupsBy); | |||
list($adminGroup, $groups) = $groupsInfo->get(); | |||
[$adminGroup, $groups] = $groupsInfo->get(); | |||
if (!$isLDAPUsed && $this->appManager->isEnabledForUser('user_ldap')) { | |||
$isLDAPUsed = (bool)array_reduce($this->userManager->getBackends(), function ($ldapFound, $backend) { |
@@ -317,7 +317,7 @@ class Provider implements IProvider { | |||
protected function getSystemTagParameter($parameter) { | |||
$tagData = json_decode($parameter, true); | |||
if ($tagData === null) { | |||
list($name, $status) = explode('|||', substr($parameter, 3, -3)); | |||
[$name, $status] = explode('|||', substr($parameter, 3, -3)); | |||
$tagData = [ | |||
'id' => 0,// No way to recover the ID | |||
'name' => $name, |
@@ -102,7 +102,7 @@ class Util { | |||
* @return float | |||
*/ | |||
public function calculateLuminance($color) { | |||
list($red, $green, $blue) = $this->hexToRGB($color); | |||
[$red, $green, $blue] = $this->hexToRGB($color); | |||
$compiler = new Compiler(); | |||
$hsl = $compiler->toHSL($red, $green, $blue); | |||
return $hsl[3] / 100; | |||
@@ -113,7 +113,7 @@ class Util { | |||
* @return float | |||
*/ | |||
public function calculateLuma($color) { | |||
list($red, $green, $blue) = $this->hexToRGB($color); | |||
[$red, $green, $blue] = $this->hexToRGB($color); | |||
return (0.2126 * $red + 0.7152 * $green + 0.0722 * $blue) / 255; | |||
} | |||
@@ -1254,7 +1254,7 @@ class Access extends LDAPUtility { | |||
if ($search === false) { | |||
return $counter > 0 ? $counter : false; | |||
} | |||
list($sr, $pagedSearchOK) = $search; | |||
[$sr, $pagedSearchOK] = $search; | |||
/* ++ Fixing RHDS searches with pages with zero results ++ | |||
* countEntriesInSearchResults() method signature changed | |||
@@ -1321,7 +1321,7 @@ class Access extends LDAPUtility { | |||
if ($search === false) { | |||
return []; | |||
} | |||
list($sr, $pagedSearchOK) = $search; | |||
[$sr, $pagedSearchOK] = $search; | |||
$cr = $this->connection->getConnectionResource(); | |||
if ($skipHandling) { |
@@ -93,7 +93,7 @@ class RenewPasswordController extends Controller { | |||
$errors = []; | |||
$messages = []; | |||
if (is_array($renewPasswordMessages)) { | |||
list($errors, $messages) = $renewPasswordMessages; | |||
[$errors, $messages] = $renewPasswordMessages; | |||
} | |||
$this->session->remove('renewPasswordMessages'); | |||
foreach ($errors as $value) { |
@@ -238,7 +238,7 @@ class AccessTest extends TestCase { | |||
* @param array $case | |||
*/ | |||
public function testStringResemblesDN($case) { | |||
list($lw, $con, $um, $helper) = $this->getConnectorAndLdapMock(); | |||
[$lw, $con, $um, $helper] = $this->getConnectorAndLdapMock(); | |||
/** @var IConfig|\PHPUnit\Framework\MockObject\MockObject $config */ | |||
$config = $this->createMock(IConfig::class); | |||
$access = new Access($con, $lw, $um, $helper, $config, $this->ncUserManager); | |||
@@ -260,7 +260,7 @@ class AccessTest extends TestCase { | |||
* @param $case | |||
*/ | |||
public function testStringResemblesDNLDAPmod($case) { | |||
list(, $con, $um, $helper) = $this->getConnectorAndLdapMock(); | |||
[, $con, $um, $helper] = $this->getConnectorAndLdapMock(); | |||
/** @var IConfig|\PHPUnit\Framework\MockObject\MockObject $config */ | |||
$config = $this->createMock(IConfig::class); | |||
$lw = new LDAP(); | |||
@@ -430,7 +430,7 @@ class AccessTest extends TestCase { | |||
* @param $attribute | |||
*/ | |||
public function testSanitizeDN($attribute) { | |||
list($lw, $con, $um, $helper) = $this->getConnectorAndLdapMock(); | |||
[$lw, $con, $um, $helper] = $this->getConnectorAndLdapMock(); | |||
/** @var IConfig|\PHPUnit\Framework\MockObject\MockObject $config */ | |||
$config = $this->createMock(IConfig::class); | |||
@@ -647,7 +647,7 @@ class AccessTest extends TestCase { | |||
} | |||
public function testFetchListOfGroupsKnown() { | |||
$filter = 'objectClass=nextcloudGroup'; | |||
$filter = 'objectClass=nextcloudGroup'; | |||
$attributes = ['cn', 'gidNumber', 'dn']; | |||
$base = 'ou=SomeGroups,dc=my,dc=directory'; | |||
@@ -106,7 +106,7 @@ abstract class AbstractMappingTest extends \Test\TestCase { | |||
* Hint: successful mapping is tested inherently with mapEntries(). | |||
*/ | |||
public function testMap() { | |||
list($mapper, $data) = $this->initTest(); | |||
[$mapper, $data] = $this->initTest(); | |||
// test that mapping will not happen when it shall not | |||
$tooLongDN = 'uid=joann,ou=Secret Small Specialized Department,ou=Some Tremendously Important Department,ou=Another Very Important Department,ou=Pretty Meaningful Derpartment,ou=Quite Broad And General Department,ou=The Topmost Department,dc=hugelysuccessfulcompany,dc=com'; | |||
@@ -126,7 +126,7 @@ abstract class AbstractMappingTest extends \Test\TestCase { | |||
* mapping entries | |||
*/ | |||
public function testUnmap() { | |||
list($mapper, $data) = $this->initTest(); | |||
[$mapper, $data] = $this->initTest(); | |||
foreach ($data as $entry) { | |||
$result = $mapper->unmap($entry['name']); | |||
@@ -142,7 +142,7 @@ abstract class AbstractMappingTest extends \Test\TestCase { | |||
* and unsuccessful requests. | |||
*/ | |||
public function testGetMethods() { | |||
list($mapper, $data) = $this->initTest(); | |||
[$mapper, $data] = $this->initTest(); | |||
foreach ($data as $entry) { | |||
$fdn = $mapper->getDNByName($entry['name']); | |||
@@ -170,7 +170,7 @@ abstract class AbstractMappingTest extends \Test\TestCase { | |||
* tests getNamesBySearch() for successful and unsuccessful requests. | |||
*/ | |||
public function testSearch() { | |||
list($mapper,) = $this->initTest(); | |||
[$mapper,] = $this->initTest(); | |||
$names = $mapper->getNamesBySearch('oo', '%', '%'); | |||
$this->assertTrue(is_array($names)); | |||
@@ -186,7 +186,7 @@ abstract class AbstractMappingTest extends \Test\TestCase { | |||
* tests setDNbyUUID() for successful and unsuccessful update. | |||
*/ | |||
public function testSetDNMethod() { | |||
list($mapper, $data) = $this->initTest(); | |||
[$mapper, $data] = $this->initTest(); | |||
$newDN = 'uid=modified,dc=example,dc=org'; | |||
$done = $mapper->setDNbyUUID($newDN, $data[0]['uuid']); | |||
@@ -206,7 +206,7 @@ abstract class AbstractMappingTest extends \Test\TestCase { | |||
*/ | |||
public function testSetUUIDMethod() { | |||
/** @var AbstractMapping $mapper */ | |||
list($mapper, $data) = $this->initTest(); | |||
[$mapper, $data] = $this->initTest(); | |||
$newUUID = 'ABC737-DEF754'; | |||
@@ -225,7 +225,7 @@ abstract class AbstractMappingTest extends \Test\TestCase { | |||
* tests clear() for successful update. | |||
*/ | |||
public function testClear() { | |||
list($mapper, $data) = $this->initTest(); | |||
[$mapper, $data] = $this->initTest(); | |||
$done = $mapper->clear(); | |||
$this->assertTrue($done); | |||
@@ -239,7 +239,7 @@ abstract class AbstractMappingTest extends \Test\TestCase { | |||
* tests clear() for successful update. | |||
*/ | |||
public function testClearCb() { | |||
list($mapper, $data) = $this->initTest(); | |||
[$mapper, $data] = $this->initTest(); | |||
$callbackCalls = 0; | |||
$test = $this; | |||
@@ -262,7 +262,7 @@ abstract class AbstractMappingTest extends \Test\TestCase { | |||
* tests getList() method | |||
*/ | |||
public function testList() { | |||
list($mapper, $data) = $this->initTest(); | |||
[$mapper, $data] = $this->initTest(); | |||
// get all entries without specifying offset or limit | |||
$results = $mapper->getList(); | |||
@@ -284,7 +284,7 @@ abstract class AbstractMappingTest extends \Test\TestCase { | |||
public function testGetListOfIdsByDn() { | |||
/** @var AbstractMapping $mapper */ | |||
list($mapper,) = $this->initTest(); | |||
[$mapper,] = $this->initTest(); | |||
$listOfDNs = []; | |||
for ($i = 0; $i < 66640; $i++) { |
@@ -98,7 +98,7 @@ class WizardTest extends TestCase { | |||
} | |||
public function testCumulativeSearchOnAttributeLimited() { | |||
list($wizard, $configuration, $ldap) = $this->getWizardAndMocks(); | |||
[$wizard, $configuration, $ldap] = $this->getWizardAndMocks(); | |||
$configuration->expects($this->any()) | |||
->method('__get') | |||
@@ -158,7 +158,7 @@ class WizardTest extends TestCase { | |||
} | |||
public function testCumulativeSearchOnAttributeUnlimited() { | |||
list($wizard, $configuration, $ldap) = $this->getWizardAndMocks(); | |||
[$wizard, $configuration, $ldap] = $this->getWizardAndMocks(); | |||
$configuration->expects($this->any()) | |||
->method('__get') | |||
@@ -234,7 +234,7 @@ class WizardTest extends TestCase { | |||
} | |||
public function testDetectEmailAttributeAlreadySet() { | |||
list($wizard, $configuration, $ldap, $access) | |||
[$wizard, $configuration, $ldap, $access] | |||
= $this->getWizardAndMocks(); | |||
$configuration->expects($this->any()) | |||
@@ -256,7 +256,7 @@ class WizardTest extends TestCase { | |||
} | |||
public function testDetectEmailAttributeOverrideSet() { | |||
list($wizard, $configuration, $ldap, $access) | |||
[$wizard, $configuration, $ldap, $access] | |||
= $this->getWizardAndMocks(); | |||
$configuration->expects($this->any()) | |||
@@ -295,7 +295,7 @@ class WizardTest extends TestCase { | |||
} | |||
public function testDetectEmailAttributeFind() { | |||
list($wizard, $configuration, $ldap, $access) | |||
[$wizard, $configuration, $ldap, $access] | |||
= $this->getWizardAndMocks(); | |||
$configuration->expects($this->any()) | |||
@@ -334,7 +334,7 @@ class WizardTest extends TestCase { | |||
} | |||
public function testDetectEmailAttributeFindNothing() { | |||
list($wizard, $configuration, $ldap, $access) | |||
[$wizard, $configuration, $ldap, $access] | |||
= $this->getWizardAndMocks(); | |||
$configuration->expects($this->any()) | |||
@@ -374,7 +374,7 @@ class WizardTest extends TestCase { | |||
public function testCumulativeSearchOnAttributeSkipReadDN() { | |||
// tests that there is no infinite loop, when skipping already processed | |||
// DNs (they can be returned multiple times for multiple filters ) | |||
list($wizard, $configuration, $ldap) = $this->getWizardAndMocks(); | |||
[$wizard, $configuration, $ldap] = $this->getWizardAndMocks(); | |||
$configuration->expects($this->any()) | |||
->method('__get') |
@@ -79,8 +79,8 @@ class RequestTime implements ICheck { | |||
* @return int | |||
*/ | |||
protected function getTimestamp($currentTimestamp, $value) { | |||
list($time1, $timezone1) = explode(' ', $value); | |||
list($hour1, $minute1) = explode(':', $time1); | |||
[$time1, $timezone1] = explode(' ', $value); | |||
[$hour1, $minute1] = explode(':', $time1); | |||
$date1 = new \DateTime('now', new \DateTimeZone($timezone1)); | |||
$date1->setTimestamp($currentTimestamp); | |||
$date1->setTime($hour1, $minute1); |
@@ -231,7 +231,7 @@ class RuleMatcher implements IRuleMatcher { | |||
$checkInstance->setFileInfo($this->fileInfo['storage'], $this->fileInfo['path'], $this->fileInfo['isDir']); | |||
} elseif ($checkInstance instanceof IEntityCheck) { | |||
foreach ($this->contexts as $entityInfo) { | |||
list($entity, $subject) = $entityInfo; | |||
[$entity, $subject] = $entityInfo; | |||
$checkInstance->setEntitySubject($entity, $subject); | |||
} | |||
} elseif (!$checkInstance instanceof ICheck) { |
@@ -173,7 +173,7 @@ trait Avatar { | |||
* @param string size | |||
*/ | |||
public function lastAvatarIsASquareOfSize(string $size) { | |||
list($width, $height) = getimagesizefromstring($this->lastAvatar); | |||
[$width, $height] = getimagesizefromstring($this->lastAvatar); | |||
Assert::assertEquals($width, $height, 'Avatar is not a square'); | |||
Assert::assertEquals($size, $width); |
@@ -356,7 +356,7 @@ With help from many libraries and frameworks including: | |||
if (strpos($entry, '> ') === false) { | |||
$this->mailMap[$entry] = $entry; | |||
} else { | |||
list($use, $actual) = explode('> ', $entry); | |||
[$use, $actual] = explode('> ', $entry); | |||
$this->mailMap[$actual] = $use . '>'; | |||
} | |||
} |
@@ -40,7 +40,7 @@ class AppFrameworkTainter implements AfterFunctionLikeAnalysisInterface { | |||
if ($stmt->isPublic() && !$stmt->isMagic()) { | |||
foreach ($stmt->params as $i => $param) { | |||
$expr_type = new Psalm\Type\Union([new Psalm\Type\Atomic\TString()]); | |||
$expr_identifier = (strtolower($statements_source->getFQCLN()) . '::' . strtolower($classlike_storage->cased_name) . '#' . ($i+1)); | |||
$expr_identifier = (strtolower($statements_source->getFQCLN()) . '::' . strtolower($classlike_storage->cased_name) . '#' . ($i + 1)); | |||
if ($expr_type) { | |||
$codebase->addTaintSource( |
@@ -19,7 +19,7 @@ | |||
"ext-xmlreader": "*" | |||
}, | |||
"require-dev": { | |||
"nextcloud/coding-standard": "^0.3.0", | |||
"nextcloud/coding-standard": "^0.5.0", | |||
"vimeo/psalm": "^4.0" | |||
}, | |||
"scripts": { |
@@ -91,7 +91,7 @@ class CreateJs extends Command implements CompletionAwareInterface { | |||
} | |||
private function writeFiles($app, $path, $lang, OutputInterface $output) { | |||
list($translations, $plurals) = $this->loadTranslations($path, $lang); | |||
[$translations, $plurals] = $this->loadTranslations($path, $lang); | |||
$this->writeJsFile($app, $path, $lang, $output, $translations, $plurals); | |||
$this->writeJsonFile($path, $lang, $output, $translations, $plurals); | |||
} |
@@ -63,7 +63,7 @@ class State extends Base { | |||
$providerStates = $this->registry->getProviderStates($user); | |||
$filtered = $this->filterEnabledDisabledUnknownProviders($providerStates); | |||
list($enabled, $disabled) = $filtered; | |||
[$enabled, $disabled] = $filtered; | |||
if (!empty($enabled)) { | |||
$output->writeln("Two-factor authentication is enabled for user $uid"); |
@@ -156,7 +156,7 @@ class LoginController extends Controller { | |||
$loginMessages = $this->session->get('loginMessages'); | |||
if (is_array($loginMessages)) { | |||
list($errors, $messages) = $loginMessages; | |||
[$errors, $messages] = $loginMessages; | |||
$this->initialStateService->provideInitialState('core', 'loginMessages', $messages); | |||
$this->initialStateService->provideInitialState('core', 'loginErrors', $errors); | |||
} |
@@ -93,7 +93,7 @@ class OCSController extends \OCP\AppFramework\OCSController { | |||
*/ | |||
public function getCapabilities() { | |||
$result = []; | |||
list($major, $minor, $micro) = \OCP\Util::getVersion(); | |||
[$major, $minor, $micro] = \OCP\Util::getVersion(); | |||
$result['version'] = [ | |||
'major' => $major, | |||
'minor' => $minor, |
@@ -108,7 +108,7 @@ class TwoFactorChallengeController extends Controller { | |||
$user = $this->userSession->getUser(); | |||
$providerSet = $this->twoFactorManager->getProviderSet($user); | |||
$allProviders = $providerSet->getProviders(); | |||
list($providers, $backupProvider) = $this->splitProvidersAndBackupCodes($allProviders); | |||
[$providers, $backupProvider] = $this->splitProvidersAndBackupCodes($allProviders); | |||
$setupProviders = $this->twoFactorManager->getLoginSetupProviders($user); | |||
$data = [ |
@@ -110,7 +110,7 @@ class Autoloader { | |||
} elseif (strpos($class, 'OC_') === 0) { | |||
$paths[] = \OC::$SERVERROOT . '/lib/private/legacy/' . strtolower(str_replace('_', '/', substr($class, 3)) . '.php'); | |||
} elseif (strpos($class, 'OCA\\') === 0) { | |||
list(, $app, $rest) = explode('\\', $class, 3); | |||
[, $app, $rest] = explode('\\', $class, 3); | |||
$app = strtolower($app); | |||
$appPath = \OC_App::getAppPath($app); | |||
if ($appPath && stream_resolve_include_path($appPath)) { |
@@ -102,7 +102,7 @@ class EventMerger implements IEventMerger { | |||
// Other parameters are not the same => can not combine | |||
try { | |||
list($combined, $parameters) = $this->combineParameters($mergeParameter, $event, $previousEvent); | |||
[$combined, $parameters] = $this->combineParameters($mergeParameter, $event, $previousEvent); | |||
} catch (\UnexpectedValueException $e) { | |||
return $event; | |||
} |
@@ -123,7 +123,7 @@ class DependencyAnalyzer { | |||
// version string but null. In case one parameter is null normalization | |||
// will therefore be skipped | |||
if ($first !== null && $second !== null) { | |||
list($first, $second) = $this->normalizeVersions($first, $second); | |||
[$first, $second] = $this->normalizeVersions($first, $second); | |||
} | |||
return version_compare($first, $second, $operator); |
@@ -148,13 +148,13 @@ class App { | |||
/** @var Dispatcher $dispatcher */ | |||
$dispatcher = $container['Dispatcher']; | |||
list( | |||
[ | |||
$httpHeaders, | |||
$responseHeaders, | |||
$responseCookies, | |||
$output, | |||
$response | |||
) = $dispatcher->dispatch($controller, $methodName); | |||
] = $dispatcher->dispatch($controller, $methodName); | |||
$io = $container[IOutput::class]; | |||
@@ -228,7 +228,7 @@ class App { | |||
$dispatcher = $container['Dispatcher']; | |||
list(, , $output) = $dispatcher->dispatch($controller, $methodName); | |||
[, , $output] = $dispatcher->dispatch($controller, $methodName); | |||
return $output; | |||
} | |||
} |
@@ -776,7 +776,7 @@ class Request implements \ArrayAccess, \Countable, IRequest { | |||
// strip off the script name's dir and file name | |||
// FIXME: Sabre does not really belong here | |||
list($path, $name) = \Sabre\Uri\split($scriptName); | |||
[$path, $name] = \Sabre\Uri\split($scriptName); | |||
if (!empty($path)) { | |||
if ($path === $pathInfo || strpos($pathInfo, $path.'/') === 0) { | |||
$pathInfo = substr($pathInfo, \strlen($path)); |
@@ -133,7 +133,7 @@ class RouteConfig { | |||
if (count($split) !== 2) { | |||
throw new \UnexpectedValueException('Invalid route name'); | |||
} | |||
list($controller, $action) = $split; | |||
[$controller, $action] = $split; | |||
$controllerName = $this->buildControllerName($controller); | |||
$actionName = $this->buildActionName($action); |
@@ -96,7 +96,7 @@ class RouteParser { | |||
if (count($split) !== 2) { | |||
throw new \UnexpectedValueException('Invalid route name'); | |||
} | |||
list($controller, $action) = $split; | |||
[$controller, $action] = $split; | |||
$controllerName = $this->buildControllerName($controller); | |||
$actionName = $this->buildActionName($action); |
@@ -63,7 +63,7 @@ class ControllerMethodReflector implements IControllerMethodReflector { | |||
$cutString = str_replace(' ', '', $cutString); | |||
$splittedArray = explode(',', $cutString); | |||
foreach ($splittedArray as $annotationValues) { | |||
list($key, $value) = explode('=', $annotationValues); | |||
[$key, $value] = explode('=', $annotationValues); | |||
$this->annotations[$annontation][$key] = $value; | |||
} | |||
continue; |
@@ -187,7 +187,7 @@ abstract class Avatar implements IAvatar { | |||
$font = __DIR__ . '/../../../core/fonts/NotoSans-Regular.ttf'; | |||
$fontSize = $size * 0.4; | |||
list($x, $y) = $this->imageTTFCenter( | |||
[$x, $y] = $this->imageTTFCenter( | |||
$im, $text, $font, (int)$fontSize | |||
); | |||
@@ -59,7 +59,7 @@ class RemoteGroupPlugin implements ISearchPlugin { | |||
$resultType = new SearchResultType('remote_groups'); | |||
if ($this->enabled && $this->cloudIdManager->isValidCloudId($search) && $offset === 0) { | |||
list($remoteGroup, $serverUrl) = $this->splitGroupRemote($search); | |||
[$remoteGroup, $serverUrl] = $this->splitGroupRemote($search); | |||
$result['exact'][] = [ | |||
'label' => $remoteGroup . " ($serverUrl)", | |||
'guid' => $remoteGroup, |
@@ -87,7 +87,7 @@ class RemotePlugin implements ISearchPlugin { | |||
$cloudIdType = $cloudIdData['type']; | |||
} | |||
try { | |||
list($remoteUser, $serverUrl) = $this->splitUserRemote($cloudId); | |||
[$remoteUser, $serverUrl] = $this->splitUserRemote($cloudId); | |||
} catch (\InvalidArgumentException $e) { | |||
continue; | |||
} | |||
@@ -151,7 +151,7 @@ class RemotePlugin implements ISearchPlugin { | |||
*/ | |||
if (!$searchResult->hasExactIdMatch($resultType) && $this->cloudIdManager->isValidCloudId($search) && $offset === 0) { | |||
try { | |||
list($remoteUser, $serverUrl) = $this->splitUserRemote($search); | |||
[$remoteUser, $serverUrl] = $this->splitUserRemote($search); | |||
$localUser = $this->userManager->get($remoteUser); | |||
if ($localUser === null || $search !== $localUser->getCloudId()) { | |||
$result['exact'][] = [ |
@@ -68,7 +68,7 @@ class QuoteHelper { | |||
} | |||
if (substr_count($string, '.')) { | |||
list($alias, $columnName) = explode('.', $string, 2); | |||
[$alias, $columnName] = explode('.', $string, 2); | |||
if ($columnName === '*') { | |||
return '`' . $alias . '`.*'; |
@@ -70,7 +70,7 @@ class File implements \OCP\Encryption\IFile { | |||
public function getAccessList($path) { | |||
// Make sure that a share key is generated for the owner too | |||
list($owner, $ownerPath) = $this->util->getUidAndFilename($path); | |||
[$owner, $ownerPath] = $this->util->getUidAndFilename($path); | |||
// always add owner to the list of users with access to the file | |||
$userIds = [$owner]; |
@@ -365,7 +365,7 @@ class Storage implements IStorage { | |||
* @return string | |||
*/ | |||
private function getFileKeyDir($encryptionModuleId, $path) { | |||
list($owner, $filename) = $this->util->getUidAndFilename($path); | |||
[$owner, $filename] = $this->util->getUidAndFilename($path); | |||
// in case of system wide mount points the keys are stored directly in the data directory | |||
if ($this->util->isSystemWideMountPoint($filename, $owner)) { | |||
@@ -457,7 +457,7 @@ class Storage implements IStorage { | |||
* @return string | |||
*/ | |||
protected function getPathToKeys($path) { | |||
list($owner, $relativePath) = $this->util->getUidAndFilename($path); | |||
[$owner, $relativePath] = $this->util->getUidAndFilename($path); | |||
$systemWideMountPoint = $this->util->isSystemWideMountPoint($relativePath, $owner); | |||
if ($systemWideMountPoint) { |
@@ -87,7 +87,7 @@ class Update { | |||
if ($this->encryptionManager->isEnabled()) { | |||
if ($params['itemType'] === 'file' || $params['itemType'] === 'folder') { | |||
$path = Filesystem::getPath($params['fileSource']); | |||
list($owner, $ownerPath) = $this->getOwnerPath($path); | |||
[$owner, $ownerPath] = $this->getOwnerPath($path); | |||
$absPath = '/' . $owner . '/files/' . $ownerPath; | |||
$this->update($absPath); | |||
} | |||
@@ -103,7 +103,7 @@ class Update { | |||
if ($this->encryptionManager->isEnabled()) { | |||
if ($params['itemType'] === 'file' || $params['itemType'] === 'folder') { | |||
$path = Filesystem::getPath($params['fileSource']); | |||
list($owner, $ownerPath) = $this->getOwnerPath($path); | |||
[$owner, $ownerPath] = $this->getOwnerPath($path); | |||
$absPath = '/' . $owner . '/files/' . $ownerPath; | |||
$this->update($absPath); | |||
} | |||
@@ -136,7 +136,7 @@ class Update { | |||
$this->encryptionManager->isEnabled() && | |||
dirname($source) !== dirname($target) | |||
) { | |||
list($owner, $ownerPath) = $this->getOwnerPath($target); | |||
[$owner, $ownerPath] = $this->getOwnerPath($target); | |||
$absPath = '/' . $owner . '/files/' . $ownerPath; | |||
$this->update($absPath); | |||
} |
@@ -66,7 +66,7 @@ class HomeCache extends Cache { | |||
$result->closeCursor(); | |||
if ($row) { | |||
list($sum) = array_values($row); | |||
[$sum] = array_values($row); | |||
$totalSize = 0 + $sum; | |||
$entry['size'] += 0; | |||
if ($entry['size'] !== $totalSize) { |
@@ -42,7 +42,7 @@ class HomePropagator extends Propagator { | |||
* @param int $sizeDifference number of bytes the file has grown | |||
*/ | |||
public function propagateChange($internalPath, $time, $sizeDifference = 0) { | |||
list($baseFolder) = explode('/', $internalPath, 2); | |||
[$baseFolder] = explode('/', $internalPath, 2); | |||
if (in_array($baseFolder, $this->ignoredBaseFolders)) { | |||
return []; | |||
} else { |
@@ -129,7 +129,7 @@ class QuerySearchHelper { | |||
private function searchComparisonToDBExpr(IQueryBuilder $builder, ISearchComparison $comparison, array $operatorMap) { | |||
$this->validateComparison($comparison); | |||
list($field, $value, $type) = $this->getOperatorFieldAndValue($comparison); | |||
[$field, $value, $type] = $this->getOperatorFieldAndValue($comparison); | |||
if (isset($operatorMap[$type])) { | |||
$queryOperator = $operatorMap[$type]; | |||
return $builder->expr()->$queryOperator($field, $this->getParameterForValue($builder, $value)); |
@@ -40,7 +40,7 @@ class JailPropagator extends Propagator { | |||
*/ | |||
public function propagateChange($internalPath, $time, $sizeDifference = 0) { | |||
/** @var \OC\Files\Storage\Storage $storage */ | |||
list($storage, $sourceInternalPath) = $this->storage->resolvePath($internalPath); | |||
[$storage, $sourceInternalPath] = $this->storage->resolvePath($internalPath); | |||
$storage->getPropagator()->propagateChange($sourceInternalPath, $time, $sizeDifference); | |||
} | |||
} |
@@ -322,7 +322,7 @@ class UserMountCache implements IUserMountCache { | |||
*/ | |||
public function getMountsForFileId($fileId, $user = null) { | |||
try { | |||
list($storageId, $internalPath) = $this->getCacheInfoFromFileId($fileId); | |||
[$storageId, $internalPath] = $this->getCacheInfoFromFileId($fileId); | |||
} catch (NotFoundException $e) { | |||
return []; | |||
} |
@@ -301,7 +301,7 @@ class Folder extends Node implements \OCP\Files\Folder { | |||
public function getById($id) { | |||
$mountCache = $this->root->getUserMountCache(); | |||
if (strpos($this->getPath(), '/', 1) > 0) { | |||
list(, $user) = explode('/', $this->getPath()); | |||
[, $user] = explode('/', $this->getPath()); | |||
} else { | |||
$user = null; | |||
} |