Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
3b7eac3
chore(psalm): Migrate spaces to tabs
mejo- May 20, 2025
7f0f056
test(psalm): Bump error level to 4
mejo- May 26, 2025
deed7a9
fix(PageInfo): Allow null `fullWidth`
mejo- May 26, 2025
45d6559
fix(CollectiveStorage): Fix return type and add missing import
mejo- May 26, 2025
17b30e9
fix(ExpireManager): Remove dead logic
mejo- May 26, 2025
a526189
fix(ExpireManager): Do not expire labeled versions
mejo- May 26, 2025
de924e2
fix(ExpireManager): Add missing return types
mejo- May 26, 2025
5111991
fix(ExpireManager): Remove accidentally removed condition
mejo- May 26, 2025
e66c649
fix(VersionsBackend): Fix type for CollectiveVersion argument
mejo- May 26, 2025
eaed2db
fix(CollectiveShare): Adjust return types and remove dead code
mejo- May 26, 2025
c4cac94
fix(psalm): Update stubs for circles app
mejo- May 26, 2025
2bb4897
chore(psalm): Migrate spaces to tabs
mejo- May 26, 2025
1142ed6
fix(MountProvider): Remove nulls from returned array in getMountsForUser
mejo- May 26, 2025
d5582f8
fix: Don't call `getUID()` on null
mejo- May 26, 2025
a9d01d5
fix(PageController): always pass index to copy/move function
mejo- May 26, 2025
1a6d283
fix(CollectiveUserSettings): Fix return types
mejo- May 26, 2025
cfdcf7b
fix(DB): Replace deprecated `QueryBuilder->execute()` with `executeQu…
mejo- May 26, 2025
d8189c0
fix(FileIndexer): Make psalm happy by using a local variable for index
mejo- May 26, 2025
1703911
fix(DB): Fix return codes
mejo- May 26, 2025
b44d400
fix(Listeners): Handle empty userId
mejo- May 26, 2025
3826a17
fix(PageInfo): Always pass int to `setSize`
mejo- May 26, 2025
938c4d6
fix(Migration): Fix return type
mejo- May 26, 2025
737c39a
fix(CollectiveFolderManager): Several typing fixes
mejo- May 26, 2025
3d9bf05
fix(CollectiveFolderManager): Ignore inShare from cli
mejo- May 26, 2025
913b2d2
fix(CircleHelper): Make psalm ignore false positives
mejo- May 26, 2025
b27da7e
fix(TemplateService): Fix typing for parentId
mejo- May 26, 2025
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
Prev Previous commit
Next Next commit
fix(CircleHelper): Make psalm ignore false positives
Signed-off-by: Jonas <[email protected]>
  • Loading branch information
mejo- committed May 26, 2025
commit 913b2d235c9e56d3f8aa00fc036b8984b0eceb4e
14 changes: 11 additions & 3 deletions lib/Service/CircleHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ private function getFederatedUser(?string $userId = null): ?FederatedUser {
}

try {
/** @psalm-suppress PossiblyNullReference - we check if circlesManager is null */
return $this->circlesManager->getFederatedUser($userId, Member::TYPE_USER);
} catch (CircleNotFoundException $e) {
throw new NotFoundException($e->getMessage(), 0, $e);
Expand Down Expand Up @@ -108,6 +109,7 @@ public function getCircles(?string $userId = null): array {
$circleProbe->mustBeMember();
$dataProbe = new DataProbe();
$dataProbe->add(DataProbe::INITIATOR);
/** @psalm-suppress PossiblyNullReference - we check if circlesManager is null */
$circles = self::useProbeCircles()
? $this->circlesManager->probeCircles($circleProbe, $dataProbe)
: $this->circlesManager->getCircles($circleProbe, true);
Expand All @@ -132,6 +134,7 @@ public function getCircle(string $circleId, ?string $userId = null, bool $super
} else {
$this->startSession($userId);
}
/** @psalm-suppress PossiblyNullReference - we check if circlesManager is null */
$circle = $this->circlesManager->getCircle($circleId);
} catch (CircleNotFoundException $e) {
throw new NotFoundException($e->getMessage(), 0, $e);
Expand Down Expand Up @@ -167,8 +170,9 @@ public function findCircle(string $name, string $userId, int $level = Member::LE
* @throws NotPermittedException
*/
private function existsCircle(string $name): bool {
$this->circlesManager->startSuperSession();
$this->startSuperSession();
try {
/** @psalm-suppress PossiblyNullReference - we check if circlesManager is null */
$circles = self::useProbeCircles()
? $this->circlesManager->probeCircles()
: $this->circlesManager->getCircles();
Expand Down Expand Up @@ -199,6 +203,7 @@ public function createCircle(string $name, string $userId): Circle {
throw new CircleExistsException('A team with that name exists');
}
$this->startSession($userId);
/** @psalm-suppress PossiblyNullReference - we check if circlesManager is null */
$circle = $this->circlesManager->createCircle($name, null, false, false);
} catch (CircleNotFoundException $e) {
throw new NotFoundException($e->getMessage(), 0, $e);
Expand All @@ -217,8 +222,9 @@ public function createCircle(string $name, string $userId): Circle {
* @throws NotPermittedException
*/
public function flagCircleAsAppManaged(string $circleId): void {
$this->circlesManager->startSuperSession();
$this->startSuperSession();
try {
/** @psalm-suppress PossiblyNullReference - we check if circlesManager is null */
$this->circlesManager->flagAsAppManaged($circleId);
} catch (RequestBuilderException|
FederatedItemException $e) {
Expand All @@ -231,8 +237,9 @@ public function flagCircleAsAppManaged(string $circleId): void {
* @throws NotPermittedException
*/
public function unflagCircleAsAppManaged(string $circleId): void {
$this->circlesManager->startSuperSession();
$this->startSuperSession();
try {
/** @psalm-suppress PossiblyNullReference - we check if circlesManager is null */
$this->circlesManager->flagAsAppManaged($circleId, false);
} catch (RequestBuilderException|
FederatedItemException $e) {
Expand All @@ -253,6 +260,7 @@ public function destroyCircle(string $circleId, string $userId): void {
try {
$this->unflagCircleAsAppManaged($circleId);
$this->startSession($userId);
/** @psalm-suppress PossiblyNullReference - we check if circlesManager is null */
$this->circlesManager->destroyCircle($circleId);
} catch (CircleNotFoundException $e) {
throw new NotFoundException($e->getMessage(), 0, $e);
Expand Down