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 psalm to v6 #3566

Merged
merged 2 commits into from
Jan 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions lib/CacheListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use OCP\Files\Cache\CacheEntryInsertedEvent;
use OCP\Files\Cache\CacheEntryUpdatedEvent;
use OCP\Files\Cache\ICacheEvent;
use RuntimeException;

class CacheListener {
public function __construct(
Expand All @@ -30,6 +31,10 @@ public function onCacheEvent(ICacheEvent $event): void {
}

$jailedPath = preg_replace('/^__groupfolders\/\d+\//', '', $event->getPath());
if ($jailedPath === null) {
throw new RuntimeException('Failed to build jailed path');
}

if ($jailedPath !== $event->getPath()) {
$event->setPath($jailedPath);
}
Expand Down
1 change: 1 addition & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
errorBaseline="tests/psalm-baseline.xml"
findUnusedBaselineEntry="true"
findUnusedCode="false"
phpVersion="8.1"
>
<stubs>
<file name="tests/stubs/doctrine_dbal_schema_abstractasset.php" />
Expand Down
2 changes: 2 additions & 0 deletions tests/Trash/TrashBackendTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,10 @@ public function testHideItemInDeletedFolderAcl(): void {
// everyone can see the parent folder
$this->assertCount(1, $this->trashBackend->listTrashRoot($this->managerUser));
$managerTrashFolder = current($this->trashBackend->listTrashRoot($this->managerUser));
$this->assertNotFalse($managerTrashFolder);
$this->assertCount(1, $this->trashBackend->listTrashRoot($this->normalUser));
$normalTrashFolder = current($this->trashBackend->listTrashRoot($this->normalUser));
$this->assertNotFalse($normalTrashFolder);

// only the manager can see the restricted child, both can see the un-restricted child
$this->assertCount(2, $this->trashBackend->listTrashFolder($managerTrashFolder));
Expand Down
17 changes: 16 additions & 1 deletion tests/psalm-baseline.xml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we have the exception in the code instead of in the baseline?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the baseline is a better fit, in case this false positive gets fixed in a later psalm version. Otherwise we have an ignore in the code which would become useless. It's not like we intentionally want to ignore it because it is correct, we ignore it because psalm is broken.

Original file line number Diff line number Diff line change
@@ -1,2 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="5.26.1@d747f6500b38ac4f7dfc5edbcae6e4b637d7add0"/>
<files psalm-version="6.0.0@b8e96bb617bf59382113b1b56cef751f648a7dc9">
<file src="lib/DAV/ACLPlugin.php">
<InvalidArgument>
<code><![CDATA[fn (Rule $obj_a, Rule $obj_b): int => (
$obj_a->getUserMapping()->getType() === $obj_b->getUserMapping()->getType() &&
$obj_a->getUserMapping()->getId() === $obj_b->getUserMapping()->getId()
) ? 0 : -1]]></code>
</InvalidArgument>
</file>
<file src="lib/Versions/ExpireManager.php">
<InvalidArgument>
<code><![CDATA[fn (IVersion $a, IVersion $b): int => ($a->getRevisionId() <=> $b->getRevisionId()) *
($a->getSourceFile()->getId() <=> $b->getSourceFile()->getId())]]></code>
</InvalidArgument>
</file>
</files>
4 changes: 2 additions & 2 deletions vendor-bin/psalm/composer.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"require-dev": {
"vimeo/psalm": "^5.26"
"vimeo/psalm": "^6"
},
"config": {
"platform": {
"php": "8.1"
"php": "8.1.17"
}
}
}
Loading
Loading