Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): Update nextcloud/coding-standard to v1.3.1 #48181

Merged
merged 2 commits into from
Sep 19, 2024

Conversation

provokateurin
Copy link
Member

Summary

Psalm baseline had to be updated due to it referencing code snippets where the formatting was changed.

Checklist

@@ -108,7 +110,7 @@

$calendar = $this->ensureCalendarExists($principalUri);
foreach (['', '-death', '-anniversary'] as $tag) {
$objectUri = $book['uri'] . '-' . $cardUri . $tag .'.ics';
$objectUri = $book['uri'] . '-' . $cardUri . $tag . '.ics';

Check notice

Code scanning / Psalm

PossiblyNullArrayAccess Note

Cannot access array value on possibly null variable $book of type array<array-key, mixed>|null
@@ -189,15 +193,16 @@
$acl = $this->caldavBackend->applyShareAcl($this->getResourceId(), $acl);
$allowedPrincipals = [
$this->getOwner(),
$this->getOwner(). '/calendar-proxy-read',
$this->getOwner(). '/calendar-proxy-write',
$this->getOwner() . '/calendar-proxy-read',

Check notice

Code scanning / Psalm

PossiblyNullOperand Note

Cannot concatenate with a possibly null null|string
$this->getOwner(). '/calendar-proxy-read',
$this->getOwner(). '/calendar-proxy-write',
$this->getOwner() . '/calendar-proxy-read',
$this->getOwner() . '/calendar-proxy-write',

Check notice

Code scanning / Psalm

PossiblyNullOperand Note

Cannot concatenate with a possibly null null|string
@come-nc
Copy link
Contributor

come-nc commented Sep 18, 2024

diff --git a/apps/dav/lib/CalDAV/Reminder/NotificationProvider/PushProvider.php b/apps/dav/lib/CalDAV/Reminder/NotificationProvider/PushProvider.php
index d8abbc39631..7e48867fcfa 100644
--- a/apps/dav/lib/CalDAV/Reminder/NotificationProvider/PushProvider.php
+++ b/apps/dav/lib/CalDAV/Reminder/NotificationProvider/PushProvider.php
@@ -68,7 +68,9 @@ class PushProvider extends AbstractProvider {
                $eventUUID = (string)$vevent->UID;
                if (!$eventUUID) {
                        return;
-               };
+               }
+
+;
                $eventUUIDHash = hash('sha256', $eventUUID, false);
 
                foreach ($users as $user) {

🤔

@provokateurin
Copy link
Member Author

Unfortunately it also seems to generate a different result than locally.

@come-nc
Copy link
Contributor

come-nc commented Sep 18, 2024

diff --git a/apps/dav/templates/schedule-response-error.php b/apps/dav/templates/schedule-response-error.php
index 9604c83f922..7bdb37f73dd 100644
--- a/apps/dav/templates/schedule-response-error.php
+++ b/apps/dav/templates/schedule-response-error.php
@@ -11,6 +11,8 @@
                <p><?php p($l->t('Please contact the organizer directly.'));?></p>
                <?php if (isset($_['organizer'])): ?>
                        <p><a href="<?php p($_['organizer']) ?>"><?php p(substr($_['organizer'], 7)) ?></a></p>
-               <?php endif; ?>
+               <?php endif;
+
+ ?>
        </div>
 </div>

also not ideal

@come-nc
Copy link
Contributor

come-nc commented Sep 18, 2024

You also need to composer install --no-dev before commit

@come-nc
Copy link
Contributor

come-nc commented Sep 18, 2024

I used git diff master..chore/deps/nextcloud-coding-standard --ignore-all-space --ignore-blank-lines to keep my sanity.
It basically looks good everywhere but in templates files, where it’s not that nice 😕

@provokateurin provokateurin force-pushed the chore/deps/nextcloud-coding-standard branch from 9313fba to 2a664db Compare September 18, 2024 16:59
@provokateurin
Copy link
Member Author

Unfortunately it also seems to generate a different result than locally.

Deleting the cache did the trick and it also changed some things in the templates.

@provokateurin
Copy link
Member Author

Changes to the templates seem to break *DAV.

@nickvergessen
Copy link
Member

Yeah let's just revert the 2 new line rules

@provokateurin provokateurin force-pushed the chore/deps/nextcloud-coding-standard branch from 2a664db to 367ff22 Compare September 19, 2024 09:11
@provokateurin provokateurin changed the title chore(deps): Update nextcloud/coding-standard to v1.3.0 chore(deps): Update nextcloud/coding-standard to v1.3.1 Sep 19, 2024
@@ -39,7 +39,7 @@
$arguments = null,
$loader = null,
$mountOptions = null,
$mountId = null
$mountId = null,

Check notice

Code scanning / Psalm

MissingParamType Note

Parameter $mountId has no provided type
@@ -91,7 +91,7 @@
Filesystem::initMountPoints($uid);
if ($uid !== OC_User::getUser()) {
$info = Filesystem::getFileInfo($filename);
$ownerView = new View('/'.$uid.'/files');
$ownerView = new View('/' . $uid . '/files');

Check notice

Code scanning / Psalm

PossiblyFalseOperand Note

Cannot concatenate with a possibly false false|string
@@ -15,7 +15,7 @@
sort($serverConnections);
$lk = array_pop($serverConnections);
$ln = (int)str_replace('s', '', $lk);
$nk = 's'.str_pad($ln + 1, 2, '0', STR_PAD_LEFT);
$nk = 's' . str_pad($ln + 1, 2, '0', STR_PAD_LEFT);

Check notice

Code scanning / Psalm

InvalidScalarArgument Note

Argument 1 of str_pad expects string, but int provided
@@ -259,11 +259,11 @@
* @param string|null $key
*/
private function getCacheKey($key): string {
$prefix = 'LDAP-'.$this->configID.'-'.$this->configPrefix.'-';
$prefix = 'LDAP-' . $this->configID . '-' . $this->configPrefix . '-';

Check notice

Code scanning / Psalm

PossiblyNullOperand Note

Cannot concatenate with a possibly null null|string
@@ -36,15 +36,15 @@
$userBackendFound = false;
$groupBackendFound = false;
foreach ($serverContainer->getUserManager()->getBackends() as $backend) {
$this->logger->debug('instance '.get_class($backend).' user backend.', ['app' => 'user_ldap']);
$this->logger->debug('instance ' . get_class($backend) . ' user backend.', ['app' => 'user_ldap']);

Check notice

Code scanning / Psalm

DeprecatedMethod Note

The method OCP\IServerContainer::getUserManager has been marked as deprecated
@@ -237,7 +237,7 @@
]);

$this->logger->debug(
'getUsers: Options: search '.$search.' limit '.$limit.' offset '.$offset.' Filter: '.$filter,
'getUsers: Options: search ' . $search . ' limit ' . $limit . ' offset ' . $offset . ' Filter: ' . $filter,

Check notice

Code scanning / Psalm

PossiblyNullOperand Note

Cannot concatenate with a possibly null int<1, max>|null
@@ -495,7 +495,7 @@
* @return array an array of all displayNames (value) and the corresponding uids (key)
*/
public function getDisplayNames($search = '', $limit = null, $offset = null) {
$cacheKey = 'getDisplayNames-'.$search.'-'.$limit.'-'.$offset;
$cacheKey = 'getDisplayNames-' . $search . '-' . $limit . '-' . $offset;

Check notice

Code scanning / Psalm

PossiblyNullOperand Note

Cannot concatenate with a possibly null int|null
@@ -495,7 +495,7 @@
* @return array an array of all displayNames (value) and the corresponding uids (key)
*/
public function getDisplayNames($search = '', $limit = null, $offset = null) {
$cacheKey = 'getDisplayNames-'.$search.'-'.$limit.'-'.$offset;
$cacheKey = 'getDisplayNames-' . $search . '-' . $limit . '-' . $offset;

Check notice

Code scanning / Psalm

PossiblyNullOperand Note

Cannot concatenate with a possibly null int|null
@@ -81,12 +81,12 @@
}
$statusCode = $response->getStatusCode();
if ($statusCode >= 200 && $statusCode < 300) {
$this->logger->debug('Webhook returned status code '.$statusCode, ['body' => $response->getBody()]);
$this->logger->debug('Webhook returned status code ' . $statusCode, ['body' => $response->getBody()]);

Check notice

Code scanning / Psalm

PossiblyInvalidMethodCall Note

Cannot call method on possible array<array-key, mixed> variable $response
} else {
$this->logger->warning('Webhook(' . $webhookId . ') returned unexpected status code '.$statusCode, ['body' => $response->getBody()]);
$this->logger->warning('Webhook(' . $webhookId . ') returned unexpected status code ' . $statusCode, ['body' => $response->getBody()]);

Check notice

Code scanning / Psalm

PossiblyInvalidMethodCall Note

Cannot call method on possible array<array-key, mixed> variable $response
@provokateurin
Copy link
Member Author

Sharding tests are expected to fail, can someone force-merge?

@provokateurin provokateurin merged commit 74c38b8 into master Sep 19, 2024
174 checks passed
@provokateurin provokateurin deleted the chore/deps/nextcloud-coding-standard branch September 19, 2024 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants