Skip to content

Commit

Permalink
Bump nextcloud/coding-standard from 0.3.0 to 0.5.0
Browse files Browse the repository at this point in the history
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](nextcloud/coding-standard@v0.3.0...v0.5.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
  • Loading branch information
dependabot-preview[bot] authored and ChristophWurst committed Feb 18, 2021
1 parent d79cc8e commit eb502c0
Show file tree
Hide file tree
Showing 135 changed files with 480 additions and 538 deletions.
2 changes: 1 addition & 1 deletion .php_cs.dist
Original file line number Diff line number Diff line change
Expand Up @@ -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;
4 changes: 2 additions & 2 deletions apps/comments/lib/Notification/Notifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public function prepare(INotification $notification, string $languageCode): INot
if (strpos($path, '/' . $notification->getUser() . '/files/') === 0) {
// Remove /user/files/...
$fullPath = $path;
list(,,, $path) = explode('/', $fullPath, 4);
[,,, $path] = explode('/', $fullPath, 4);
}
$subjectParameters = [
'file' => [
Expand All @@ -155,7 +155,7 @@ public function prepare(INotification $notification, string $languageCode): INot
'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)
Expand Down
2 changes: 1 addition & 1 deletion apps/contactsinteraction/lib/AddressBook.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ public function getACL() {
}

private function getUid(): string {
list(, $uid) = \Sabre\Uri\split($this->principalUri);
[, $uid] = \Sabre\Uri\split($this->principalUri);
return $uid;
}
}
2 changes: 1 addition & 1 deletion apps/dav/lib/AppInfo/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ public function registerHooks(HookManager $hm,
$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');
Expand Down
2 changes: 1 addition & 1 deletion apps/dav/lib/Avatars/AvatarHome.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public function delete() {
}

public function getName() {
list(,$name) = Uri\split($this->principalInfo['uri']);
[,$name] = Uri\split($this->principalInfo['uri']);
return $name;
}

Expand Down
10 changes: 5 additions & 5 deletions apps/dav/lib/CalDAV/CalDavBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ public function getCalendarsForUser($principalUri) {
->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()) {
Expand All @@ -387,7 +387,7 @@ public function getCalendarsForUser($principalUri) {
}
}

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 = [];
Expand Down Expand Up @@ -511,7 +511,7 @@ public function getPublicCalendars() {

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']) {
Expand Down Expand Up @@ -578,7 +578,7 @@ public function getPublicCalendar($uri) {
}

$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']) {
Expand Down Expand Up @@ -2837,7 +2837,7 @@ protected function getCalendarObjectId($calendarId, $uri, $calendarType):int {
*/
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";
}
Expand Down
6 changes: 3 additions & 3 deletions apps/dav/lib/CalDAV/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,9 @@ public function getPrincipalByPath($path) {
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'])
Expand Down Expand Up @@ -404,8 +404,8 @@ public function findByUri($uri, $principalPrefix) {
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'])
Expand Down
4 changes: 2 additions & 2 deletions apps/dav/lib/CalDAV/Schedule/IMipPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ private function addAttendees(IEMailTemplate $template, IL10N $l10n, VEvent $vev
/** @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>',
Expand Down Expand Up @@ -619,7 +619,7 @@ private function addAttendees(IEMailTemplate $template, IL10N $l10n, VEvent $vev
$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),
Expand Down
2 changes: 1 addition & 1 deletion apps/dav/lib/CalDAV/Schedule/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ public function propFindDefaultCalendarUrl(PropFind $propFind, INode $node) {
}

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 ||
Expand Down
2 changes: 1 addition & 1 deletion apps/dav/lib/CalDAV/Search/SearchPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ private function calendarSearch($report) {
$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;
Expand Down
4 changes: 2 additions & 2 deletions apps/dav/lib/CardDAV/CardDavBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ public function getAddressBooksForUser($principalUri) {
}
}

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) . ')';

Expand Down Expand Up @@ -1338,7 +1338,7 @@ public function applyShareAcl($addressBookId, $acl) {

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";
}
Expand Down
2 changes: 1 addition & 1 deletion apps/dav/lib/CardDAV/PhotoCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ private function getPhoto(Card $node) {
return false;
}
if (substr_count($parsed['path'], ';') === 1) {
list($type) = explode(';', $parsed['path']);
[$type] = explode(';', $parsed['path']);
}
$val = file_get_contents($val);
} else {
Expand Down
6 changes: 3 additions & 3 deletions apps/dav/lib/CardDAV/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ public function initialize(Server $server) {
*/
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;
}
}
Expand Down
2 changes: 1 addition & 1 deletion apps/dav/lib/Command/MoveCalendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ protected function getNewCalendarName(string $userDestination, string $name): st
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
Expand Down
2 changes: 1 addition & 1 deletion apps/dav/lib/Connector/LegacyDAVACL.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function getCurrentUserPrincipals() {
}

private function convertPrincipal($principal, $toV2) {
list(, $name) = \Sabre\Uri\split($principal);
[, $name] = \Sabre\Uri\split($principal);
if ($toV2) {
return "principals/users/$name";
}
Expand Down
20 changes: 10 additions & 10 deletions apps/dav/lib/Connector/Sabre/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public function put($data) {
}

/** @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();
Expand All @@ -168,9 +168,9 @@ public function put($data) {

// 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);
Expand Down Expand Up @@ -223,7 +223,7 @@ public function put($data) {
// 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);
}

Expand Down Expand Up @@ -501,7 +501,7 @@ public function getDirectDownload() {
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 [];
}
Expand All @@ -518,7 +518,7 @@ public function getDirectDownload() {
* @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)) {
Expand All @@ -541,13 +541,13 @@ private function createFileChunked($data) {

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);

Expand All @@ -557,13 +557,13 @@ private function createFileChunked($data) {
$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);
Expand Down
6 changes: 3 additions & 3 deletions apps/dav/lib/Connector/Sabre/FilesPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,8 @@ public function checkMove($source, $destination) {
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();
Expand Down Expand Up @@ -496,7 +496,7 @@ public function handleUpdateProperties($path, PropPatch $propPatch) {
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'];
Expand Down
4 changes: 2 additions & 2 deletions apps/dav/lib/Connector/Sabre/Node.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ public function setName($name) {
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();
Expand Down
6 changes: 3 additions & 3 deletions apps/dav/lib/Connector/Sabre/ObjectTree.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public function init(\Sabre\DAV\INode $rootNode, \OC\Files\View $view, \OCP\File
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 = '';
}
Expand Down Expand Up @@ -220,7 +220,7 @@ public function copy($sourcePath, $destinationPath) {
// 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) {
Expand All @@ -237,7 +237,7 @@ public function copy($sourcePath, $destinationPath) {
throw new FileLocked($e->getMessage(), $e->getCode(), $e);
}

list($destinationDir,) = \Sabre\Uri\split($destinationPath);
[$destinationDir,] = \Sabre\Uri\split($destinationPath);
$this->markDirty($destinationDir);
}
}
Loading

0 comments on commit eb502c0

Please sign in to comment.