chore(psalm): the share listener as Psalm 7.12 reads it, stubs instead of a baseline for Imagick #14
No reviewers
Labels
No labels
ansible
ci
dependencies
digest
docker
fix
go
javascript
major
minor
patch
php
python
released
security
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
dawid/nextcloud-talk-stickers!14
Loading…
Reference in a new issue
No description provided.
Delete branch "psalm-7.12"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Renovate's #7 (Psalm 7.12) fails
standardswith three findings. This PR fixes them in the code instead of adding them to the baseline.TypeDoesNotContainTypeat line 56:method_exists($event, 'getShare')narrows$eventtoEvent&object{getshare()}. Psalm 7.12 then no longer accepts that type asShareCreatedEvent.handle()now checksinstanceof ShareCreatedEventfirst, and checksmethod_exists()only for the other events (Talk'sBeforeDuplicateShareSentEvent). The behaviour is unchanged.TypeDoesNotContainTypeat line 65:class_exists()on a string literal of a class Psalm didn't know. Psalm now loads the existing test stubtests/stubs/files_sharing_events.php, and the listener usesUserShareAccessUpdatedEvent::classandnew UserShareAccessUpdatedEvent(...)directly. That also lets Psalm check the constructor. The unused public constantSHARE_ACCESS_UPDATED_EVENTis gone.UnusedBaselineEntryin StickerService: Psalm 7.12 resolves\Imagickthroughclass_exists()but still doesn't know\ImagickPixelor\ImagickException. A Psalm stubtests/stubs/imagick.phpcovers what StickerService uses, and the baseline's Imagick entries are removed..forgejo/regenerate.yml: the bot's PHP prepare now installs mbstring, as ci.yml's tools do. Without mbstring, Psalm crashes withmb_strcut()undefined, and the step ignores the exit (|| true), so the bot would never have regenerated the baseline.Checked in
php:8.6-cli-alpinewith ci.yml's extensions: Psalm 7.0.5 (main's lock) and 7.12.0 (#7's lock) both report no errors,cs:checkfinds nothing, and PHPUnit passes (17 tests).Once this is merged, Renovate rebases #7, which should then pass.
🤖 Generated with Claude Code
Tests of CI / php (dev-master): passed
17 passed, 0 failed, 0 skipped (17 tests, 0.1 s)
Of
7c0bfb5b6a, the run, updated by every run.Tests of CI / php (dev-stable34): passed
17 passed, 0 failed, 0 skipped (17 tests, 0.1 s)
Of
7c0bfb5b6a, the run, updated by every run.Tests of CI / php (dev-stable33): passed
17 passed, 0 failed, 0 skipped (17 tests, 0.1 s)
Of
7c0bfb5b6a, the run, updated by every run.Tests of CI / php (dev-stable32): passed
17 passed, 0 failed, 0 skipped (17 tests, 0.1 s)
Of
7c0bfb5b6a, the run, updated by every run.Tests of CI / php (dev-stable35): passed
17 passed, 0 failed, 0 skipped (17 tests, 0.1 s)
Of
7c0bfb5b6a, the run, updated by every run.